public class OWLRDFConsumer extends Object implements RDFConsumer, AnonymousNodeChecker, AnonymousIndividualByIdProvider
| Constructor and Description |
|---|
OWLRDFConsumer(OWLOntology ontology,
AnonymousNodeChecker checker,
OWLOntologyLoaderConfiguration configuration)
Instantiates a new oWLRDF consumer.
|
OWLRDFConsumer(OWLOntology ontology,
OWLOntologyLoaderConfiguration configuration)
Instantiates a new oWLRDF consumer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAnnotatedSource(IRI annotatedAnonSource,
IRI annotationMainNode)
Records an annotation of an anonymous node (either an annotation of an annotation, or an
annotation of an axiom for example).
|
void |
addClassExpression(IRI iri,
boolean explicitlyTyped)
Adds the class expression.
|
void |
addDataProperty(IRI iri,
boolean explicitlyTyped)
Adds the data property.
|
void |
addDataRange(IRI iri,
boolean explicitlyTyped)
Adds the data range.
|
void |
addObjectProperty(IRI iri,
boolean explicitlyTyped)
Adds the object property.
|
void |
addPrefix(String abbreviation,
String value)
Add a prefix to the underlying ontology format, if prefixes are
supported.
|
void |
endModel()
Called when model parsing is finished.
|
<E extends OWLEntity> |
generateAndLogParseError(EntityType<E> entityType,
IRI mainNode) |
Set<IRI> |
getAnnotatedSourceAnnotationMainNodes(IRI source)
Gets the main nodes of annotations that annotated the specified source.
|
OWLOntologyLoaderConfiguration |
getConfiguration() |
OWLDataFactory |
getDataFactory()
Gets the data factory.
|
OWLAxiom |
getLastAddedAxiom()
Gets the last added axiom.
|
OWLOntology |
getOntology()
Gets the ontology.
|
RDFDocumentFormat |
getOntologyFormat()
Gets the ontology format.
|
OWLAnonymousIndividual |
getOWLAnonymousIndividual(String nodeId) |
OWLOntologyManager |
getOWLOntologyManager()
Gets the oWL ontology manager.
|
Set<OWLAnnotation> |
getPendingAnnotations()
Gets any annotations that were translated since the last call of this method (calling this
method clears the current pending annotations).
|
void |
includeModel(String logicalURI,
String physicalURI)
Receives the notification that the model being parsed includes another
model with supplied URIs.
|
boolean |
isAnonymousNode(IRI iri) |
boolean |
isAnonymousNode(String iri) |
boolean |
isAnonymousSharedNode(String iri) |
boolean |
isClassExpression(IRI iri)
Checks if is class expression.
|
boolean |
isParsedAllTriples()
Checks if is parsed all triples.
|
boolean |
isRestriction(IRI iri)
Checks if is restriction.
|
void |
logicalURI(IRI logicalURI)
Receives the logical URI of the model.
|
IRI |
remapIRI(IRI i)
for iris that need to be mapped to blank nodes, e.g., SWRL rules with an
IRI - the IRI should be dropped for such constructs.
|
String |
remapOnlyIfRemapped(String i)
for iris that have been remapped to blank nodes, e.g., SWRL rules: the
triple subject swrl:body object, for example, needs the subject to be
remapped consistently.
|
void |
setOntologyFormat(RDFDocumentFormat format)
Sets the ontology format.
|
void |
startModel(IRI physicalURI)
Called when model parsing is started.
|
void |
statementWithLiteralValue(IRI subject,
IRI predicate,
String object,
String language,
IRI datatype)
Called when a statement with literal value is added to the model.
|
void |
statementWithLiteralValue(String subject,
String predicate,
String object,
String language,
String datatype)
Called when a statement with literal value is added to the model.
|
void |
statementWithResourceValue(IRI subject,
IRI predicate,
IRI object)
Called when a statement with resource value is added to the model.
|
void |
statementWithResourceValue(String subject,
String predicate,
String object)
Called when a statement with resource value is added to the model.
|
Set<OWLAnnotation> |
translateAnnotations(IRI n)
Translates the annotation on a main node.
|
OWLClassExpression |
translateClassExpression(IRI i)
compatibility proxy for TranslatorAccessor#translateClassExpression
|
OWLDataPropertyExpression |
translateDataPropertyExpression(IRI iri)
Translate data property expression.
|
OWLDataRange |
translateDataRange(IRI n)
Given a main node, translated data ranges according to Table 12.
|
OWLIndividual |
translateIndividual(IRI node)
Translate individual.
|
OWLObjectPropertyExpression |
translateObjectPropertyExpression(IRI mainNode)
Translate object property expression.
|
public OWLRDFConsumer(OWLOntology ontology, OWLOntologyLoaderConfiguration configuration)
ontology - the ontologyconfiguration - the configurationpublic OWLRDFConsumer(OWLOntology ontology, AnonymousNodeChecker checker, OWLOntologyLoaderConfiguration configuration)
ontology - the ontologychecker - anonymous node checkerconfiguration - the configurationpublic void addPrefix(String abbreviation, String value)
RDFConsumeraddPrefix in interface RDFConsumerabbreviation - short name for prefixvalue - replacement for short versionpublic OWLOntology getOntology()
public RDFDocumentFormat getOntologyFormat()
public void setOntologyFormat(RDFDocumentFormat format)
format - the new ontology formatpublic OWLDataFactory getDataFactory()
public Set<OWLAnnotation> getPendingAnnotations()
public boolean isAnonymousNode(String iri)
isAnonymousNode in interface AnonymousNodeCheckerpublic boolean isAnonymousSharedNode(String iri)
isAnonymousSharedNode in interface AnonymousNodeCheckerpublic boolean isAnonymousNode(IRI iri)
isAnonymousNode in interface AnonymousNodeChecker@Nullable public OWLAxiom getLastAddedAxiom()
public void addClassExpression(IRI iri, boolean explicitlyTyped)
iri - the iriexplicitlyTyped - the explicitly typedpublic boolean isClassExpression(IRI iri)
iri - the iripublic void addObjectProperty(IRI iri, boolean explicitlyTyped)
iri - the iriexplicitlyTyped - the explicitly typedpublic void addDataProperty(IRI iri, boolean explicitlyTyped)
iri - the iriexplicitlyTyped - the explicitly typedpublic void addDataRange(IRI iri, boolean explicitlyTyped)
iri - the iriexplicitlyTyped - the explicitly typedpublic boolean isRestriction(IRI iri)
iri - the iripublic OWLOntologyManager getOWLOntologyManager()
public void addAnnotatedSource(IRI annotatedAnonSource, IRI annotationMainNode)
annotatedAnonSource - The source that the annotation annotatesannotationMainNode - The annotationspublic Set<IRI> getAnnotatedSourceAnnotationMainNodes(IRI source)
source - The source (axiom or annotation main node)public OWLAnonymousIndividual getOWLAnonymousIndividual(String nodeId)
getOWLAnonymousIndividual in interface AnonymousIndividualByIdProviderpublic void startModel(IRI physicalURI)
RDFConsumerstartModel in interface RDFConsumerphysicalURI - physical URI of the modelpublic boolean isParsedAllTriples()
public void endModel()
RDFConsumerendModel in interface RDFConsumerpublic void includeModel(@Nullable String logicalURI, @Nullable String physicalURI)
RDFConsumerincludeModel in interface RDFConsumerlogicalURI - logical URI of the modelphysicalURI - physical URI of the modelpublic void logicalURI(IRI logicalURI)
RDFConsumerlogicalURI in interface RDFConsumerlogicalURI - logical URI of the modelpublic void statementWithLiteralValue(String subject, String predicate, String object, @Nullable String language, @Nullable String datatype)
RDFConsumerstatementWithLiteralValue in interface RDFConsumersubject - URI of the subject resourcepredicate - URI of the predicate resourceobject - literal object valuelanguage - the languagedatatype - the URI of the literal's datatype (may be null)public void statementWithLiteralValue(IRI subject, IRI predicate, String object, @Nullable String language, @Nullable IRI datatype)
RDFConsumerstatementWithLiteralValue in interface RDFConsumersubject - URI of the subject resourcepredicate - URI of the predicate resourceobject - literal object valuelanguage - the languagedatatype - the URI of the literal's datatype (may be null)public void statementWithResourceValue(String subject, String predicate, String object)
RDFConsumerstatementWithResourceValue in interface RDFConsumersubject - URI of the subject resourcepredicate - URI of the predicate resourceobject - URI of the object resourcepublic void statementWithResourceValue(IRI subject, IRI predicate, IRI object)
RDFConsumerstatementWithResourceValue in interface RDFConsumersubject - URI of the subject resourcepredicate - URI of the predicate resourceobject - URI of the object resourcepublic OWLClassExpression translateClassExpression(IRI i)
i - iri fr the class expressionpublic OWLDataRange translateDataRange(IRI n)
n - The main nodepublic OWLDataPropertyExpression translateDataPropertyExpression(IRI iri)
iri - the iripublic OWLObjectPropertyExpression translateObjectPropertyExpression(IRI mainNode)
mainNode - the main nodepublic OWLIndividual translateIndividual(IRI node)
node - the nodepublic Set<OWLAnnotation> translateAnnotations(IRI n)
n - The main nodepublic <E extends OWLEntity> E generateAndLogParseError(EntityType<E> entityType, IRI mainNode)
E - entity typeentityType - entity typemainNode - main nodepublic OWLOntologyLoaderConfiguration getConfiguration()
getConfiguration in interface RDFConsumerpublic IRI remapIRI(IRI i)
RDFConsumerremapIRI in interface RDFConsumeri - iri to remap if not blankpublic String remapOnlyIfRemapped(String i)
RDFConsumerremapOnlyIfRemapped in interface RDFConsumeri - iri to remap if not blankCopyright © 2020 The University of Manchester. All rights reserved.