public class OWLRDFConsumer extends Object implements RDFConsumer, AnonymousNodeChecker, OWLAnonymousIndividualByIdProvider
Constructor and Description |
---|
OWLRDFConsumer(OWLOntology ontology,
AnonymousNodeChecker checker,
OWLOntologyLoaderConfiguration configuration) |
OWLRDFConsumer(OWLOntology ontology,
OWLOntologyLoaderConfiguration configuration) |
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)
Gets an
OWLAnonymousIndividual that has a specific 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 |
setExpectedAxioms(int expectedAxioms)
Sets the expected axioms.
|
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 mainNode)
Translates the annotation on a main node.
|
OWLClassExpression |
translateClassExpression(IRI i)
compatibility proxy for
Translators.TranslatorAccessor.translateClassExpression(IRI) |
OWLDataPropertyExpression |
translateDataPropertyExpression(IRI iri)
Translate data property expression.
|
OWLDataRange |
translateDataRange(IRI mainNode)
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(@Nonnull OWLOntology ontology, @Nonnull OWLOntologyLoaderConfiguration configuration)
ontology
- the ontologyconfiguration
- the configurationpublic OWLRDFConsumer(@Nonnull OWLOntology ontology, @Nonnull AnonymousNodeChecker checker, @Nonnull OWLOntologyLoaderConfiguration configuration)
ontology
- the ontologychecker
- anonymous node checkerconfiguration
- the configurationpublic void addPrefix(String abbreviation, String value)
RDFConsumer
addPrefix
in interface RDFConsumer
abbreviation
- short name for prefixvalue
- replacement for short version@Nonnull public OWLOntology getOntology()
@Nonnull public RDFDocumentFormat getOntologyFormat()
public void setOntologyFormat(RDFDocumentFormat format)
format
- the new ontology formatpublic void setExpectedAxioms(int expectedAxioms)
expectedAxioms
- the new expected axiomspublic OWLDataFactory getDataFactory()
@Nonnull public Set<OWLAnnotation> getPendingAnnotations()
public boolean isAnonymousNode(String iri)
isAnonymousNode
in interface AnonymousNodeChecker
iri
- iri to checkpublic boolean isAnonymousSharedNode(String iri)
isAnonymousSharedNode
in interface AnonymousNodeChecker
iri
- iri to checkpublic boolean isAnonymousNode(IRI iri)
isAnonymousNode
in interface AnonymousNodeChecker
iri
- iri to checkpublic 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)
OWLAnonymousIndividualByIdProvider
OWLAnonymousIndividual
that has a specific NodeID
.getOWLAnonymousIndividual
in interface OWLAnonymousIndividualByIdProvider
nodeId
- A String that represents the NodeID
of the generated
OWLAnonymousIndividual
. Not null
. Note:
nodeId
will be prefixed with "_:" if it is not specified
with an "_:" prefix.OWLAnonymousIndividual
public void startModel(IRI physicalURI)
RDFConsumer
startModel
in interface RDFConsumer
physicalURI
- physical URI of the modelpublic boolean isParsedAllTriples()
public void endModel()
RDFConsumer
endModel
in interface RDFConsumer
public void includeModel(String logicalURI, String physicalURI)
RDFConsumer
includeModel
in interface RDFConsumer
logicalURI
- logical URI of the modelphysicalURI
- physical URI of the modelpublic void logicalURI(IRI logicalURI)
RDFConsumer
logicalURI
in interface RDFConsumer
logicalURI
- logical URI of the modelpublic void statementWithLiteralValue(@Nonnull String subject, @Nonnull String predicate, @Nonnull String object, @Nullable String language, @Nullable String datatype)
RDFConsumer
statementWithLiteralValue
in interface RDFConsumer
subject
- 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(@Nonnull IRI subject, @Nonnull IRI predicate, @Nonnull String object, String language, IRI datatype)
RDFConsumer
statementWithLiteralValue
in interface RDFConsumer
subject
- 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(@Nonnull String subject, @Nonnull String predicate, @Nonnull String object)
RDFConsumer
statementWithResourceValue
in interface RDFConsumer
subject
- URI of the subject resourcepredicate
- URI of the predicate resourceobject
- URI of the object resourcepublic void statementWithResourceValue(@Nonnull IRI subject, @Nonnull IRI predicate, @Nonnull IRI object)
RDFConsumer
statementWithResourceValue
in interface RDFConsumer
subject
- URI of the subject resourcepredicate
- URI of the predicate resourceobject
- URI of the object resource@Nonnull public OWLClassExpression translateClassExpression(@Nonnull IRI i)
Translators.TranslatorAccessor.translateClassExpression(IRI)
i
- iri for the class expression@Nonnull public OWLDataRange translateDataRange(@Nonnull IRI mainNode)
mainNode
- The main node@Nonnull public OWLDataPropertyExpression translateDataPropertyExpression(@Nonnull IRI iri)
iri
- the iri@Nonnull public OWLObjectPropertyExpression translateObjectPropertyExpression(@Nonnull IRI mainNode)
mainNode
- the main node@Nonnull public OWLIndividual translateIndividual(@Nonnull IRI node)
node
- the node@Nonnull public Set<OWLAnnotation> translateAnnotations(IRI mainNode)
mainNode
- The main node@Nonnull public <E extends OWLEntity> E generateAndLogParseError(@Nonnull EntityType<E> entityType, @Nonnull IRI mainNode)
E
- entity typeentityType
- entity typemainNode
- main node@Nonnull public OWLOntologyLoaderConfiguration getConfiguration()
getConfiguration
in interface RDFConsumer
@Nonnull public IRI remapIRI(@Nonnull IRI i)
RDFConsumer
remapIRI
in interface RDFConsumer
i
- iri to remap if not blank@Nonnull public String remapOnlyIfRemapped(@Nonnull String i)
RDFConsumer
remapOnlyIfRemapped
in interface RDFConsumer
i
- iri to remap if not blankCopyright © 2020 The University of Manchester. All rights reserved.