Class TextExtractorLabelAndDirectSuperclass
java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.util.textExtractors.TextExtractorLabelAndDirectSuperclass
- All Implemented Interfaces:
TextExtractor
Extracts a label for the given resource and also creates a text for the superclass such that more context is provided.
-
Field Summary
Modifier and TypeFieldDescriptionprivate final boolean
private final TextExtractorOnlyLabel
private final String
-
Constructor Summary
ConstructorDescriptionTextExtractorLabelAndDirectSuperclass
(String subClassText, boolean includeQuotes) -
Method Summary
Modifier and TypeMethodDescriptionextract
(org.apache.jena.rdf.model.Resource r) Given a Jena resource this method extracts textual/string representations from it.getSuperclassLabels
(org.apache.jena.rdf.model.Resource r) Returns for each superclass at maximum one label.protected String
optionallyQuote
(String text) optionallyQuote
(Set<String> texts)
-
Field Details
-
labelExtractor
-
subClassText
-
includeQuotes
private final boolean includeQuotes
-
-
Constructor Details
-
TextExtractorLabelAndDirectSuperclass
-
TextExtractorLabelAndDirectSuperclass
public TextExtractorLabelAndDirectSuperclass()
-
-
Method Details
-
extract
Description copied from interface:TextExtractor
Given a Jena resource this method extracts textual/string representations from it.- Specified by:
extract
in interfaceTextExtractor
- Parameters:
r
- the jena resource which also allows to traverse the whole rdf graph- Returns:
- a set of textual representations of the given resource.
-
getSuperclassLabels
Returns for each superclass at maximum one label. If a label for a super class cannot be extracted, it will also not be in the set.- Parameters:
r
- the resource to extract the superclass labels- Returns:
- the superclass labels
-
optionallyQuote
-
optionallyQuote
-