Interface TextExtractor
- All Known Implementing Classes:
TextExtractorAllAnnotationProperties
,TextExtractorAllLiterals
,TextExtractorAllStringLiterals
,TextExtractorFallback
,TextExtractorForTransformers
,TextExtractorLabelAndDirectSuperclass
,TextExtractorMultipleProperties
,TextExtractorOnlyLabel
,TextExtractorProperty
,TextExtractorRDFBase
,TextExtractorResourceDescriptionInRDF
,TextExtractorSet
,TextExtractorShortAndLongTexts
,TextExtractorUrlFragment
,TextExtractorUrlLocalName
,TextExtractorUseLongestLiteralOrFragment
,TextExtractorVerbalizedRDF
public interface TextExtractor
Given a Jena resource, a ValueExtractor can derive zero or more String representations.
Developer remark:
If you implement a new extractor: For a good design, you may want to implement a
LiteralExtractor
and use
this interface to wrap it. Code for wrapping:
extractor.extract(resource).stream().map(Literal::getLexicalForm).filter(x -> !x.trim().equals("")).collect(Collectors.toSet());
-
Method Summary
Modifier and TypeMethodDescriptionstatic TextExtractor
appendStringPostProcessing
(TextExtractor e, Function<String, String> postprocessing) extract
(org.apache.jena.rdf.model.Resource r) Given a Jena resource this method extracts textual/string representations from it.static TextExtractor
static TextExtractor
static TextExtractor
-
Method Details
-
extract
Given a Jena resource this method extracts textual/string representations from it.- Parameters:
r
- the jena resource which also allows to traverse the whole rdf graph- Returns:
- a set of textual representations of the given resource.
-
wrapLiteralExtractor
-
wrapLiteralExtractorMap
-
wrapTextExtractorMap
-
appendStringPostProcessing
static TextExtractor appendStringPostProcessing(TextExtractor e, Function<String, String> postprocessing)
-