Package org.aksw.gerbil.io.nif
Class AnnotationParser
java.lang.Object
org.aksw.gerbil.io.nif.AnnotationParser
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static org.slf4j.Loggerprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate TypedNamedEntityaddTypeInformation(TypedNamedEntity typedNE, org.apache.jena.rdf.model.Model nifModel)private MeaningSpanaddTypeInformationIfPossible(NamedEntity ne, org.apache.jena.rdf.model.Model nifModel)private MeaningSpanaddTypeInformationIfPossible(ScoredNamedEntity ne, org.apache.jena.rdf.model.Model nifModel)protected static CalendargetCalendarValue(org.apache.jena.rdf.model.Model model, org.apache.jena.rdf.model.Resource subject, org.apache.jena.rdf.model.Property predicate, org.apache.jena.datatypes.xsd.XSDDatatype dateType)static CalendargetDateTimeValue(org.apache.jena.rdf.model.Model model, org.apache.jena.rdf.model.Resource subject, org.apache.jena.rdf.model.Property predicate)Returns the object asCalendarof the first triple that has the given subject and predicate and that can be found in the given model.static CalendargetDateValue(org.apache.jena.rdf.model.Model model, org.apache.jena.rdf.model.Resource subject, org.apache.jena.rdf.model.Property predicate)Returns the object asCalendarof the first triple that has the given subject and predicate and that can be found in the given model.voidparseAnnotations(org.apache.jena.rdf.model.Model nifModel, Document document, org.apache.jena.rdf.model.Resource documentResource)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
removeUsedProperties
private boolean removeUsedProperties
-
-
Constructor Details
-
AnnotationParser
public AnnotationParser() -
AnnotationParser
public AnnotationParser(boolean removeUsedProperties)
-
-
Method Details
-
parseAnnotations
public void parseAnnotations(org.apache.jena.rdf.model.Model nifModel, Document document, org.apache.jena.rdf.model.Resource documentResource) -
addTypeInformationIfPossible
private MeaningSpan addTypeInformationIfPossible(NamedEntity ne, org.apache.jena.rdf.model.Model nifModel) -
addTypeInformationIfPossible
private MeaningSpan addTypeInformationIfPossible(ScoredNamedEntity ne, org.apache.jena.rdf.model.Model nifModel) -
addTypeInformation
private TypedNamedEntity addTypeInformation(TypedNamedEntity typedNE, org.apache.jena.rdf.model.Model nifModel) -
getDateValue
public static Calendar getDateValue(org.apache.jena.rdf.model.Model model, org.apache.jena.rdf.model.Resource subject, org.apache.jena.rdf.model.Property predicate)Returns the object asCalendarof the first triple that has the given subject and predicate and that can be found in the given model.- Parameters:
model- the model that should contain the triplesubject- the subject of the triple.nullworks like a wildcard.predicate- the predicate of the triple.nullworks like a wildcard.- Returns:
- object of the triple as
Calendarornullif such a triple couldn't be found or the value can not be read as XSDDate
-
getDateTimeValue
public static Calendar getDateTimeValue(org.apache.jena.rdf.model.Model model, org.apache.jena.rdf.model.Resource subject, org.apache.jena.rdf.model.Property predicate)Returns the object asCalendarof the first triple that has the given subject and predicate and that can be found in the given model.- Parameters:
model- the model that should contain the triplesubject- the subject of the triple.nullworks like a wildcard.predicate- the predicate of the triple.nullworks like a wildcard.- Returns:
- object of the triple as
Calendarornullif such a triple couldn't be found or the value can not be read as XSDDateTime
-
getCalendarValue
protected static Calendar getCalendarValue(org.apache.jena.rdf.model.Model model, org.apache.jena.rdf.model.Resource subject, org.apache.jena.rdf.model.Property predicate, org.apache.jena.datatypes.xsd.XSDDatatype dateType)
-