public class OWLRDFConsumer extends java.lang.Object implements RDFConsumer
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<IRI,BuiltInTypeHandler> |
axiomTypeTripleHandlers |
protected TPInverseOfHandler |
inverseOfHandler |
protected java.util.List<AbstractLiteralTripleHandler> |
literalTripleHandlers |
protected java.util.List<AbstractResourceTripleHandler> |
resourceTripleHandlers |
Constructor and Description |
---|
OWLRDFConsumer(OWLOntology ontology,
AnonymousNodeChecker checker,
OWLOntologyLoaderConfiguration configuration) |
OWLRDFConsumer(OWLOntologyManager owlOntologyManager,
OWLOntology ontology,
AnonymousNodeChecker checker,
OWLOntologyLoaderConfiguration configuration)
Deprecated.
|
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)
|
protected void |
addAnnotationIRI(IRI iri) |
protected void |
addAnnotationProperty(IRI iri,
boolean explicitlyTyped) |
void |
addAxiom(IRI axiomIRI) |
protected void |
addAxiom(OWLAxiom axiom) |
void |
addClassExpression(IRI iri,
boolean explicitlyTyped) |
void |
addDataProperty(IRI iri,
boolean explicitlyTyped) |
void |
addDataRange(IRI iri,
boolean explicitlyTyped) |
void |
addFirst(IRI subject,
IRI object) |
void |
addFirst(IRI subject,
OWLLiteral object) |
protected void |
addImport(OWLImportsDeclaration declaration) |
void |
addModelAttribte(java.lang.String string,
java.lang.String string1)
Receives the notification that the attribute and its value has been parsed.
|
void |
addObjectProperty(IRI iri,
boolean explicitlyTyped) |
void |
addOntology(IRI iri) |
protected void |
addOntologyAnnotation(OWLAnnotation annotation) |
protected void |
addOWLNamedIndividual(IRI iri,
boolean explicitlyType) |
protected void |
addOWLRestriction(IRI iri,
boolean explicitlyTyped) |
protected void |
addRDFProperty(IRI iri) |
void |
addRest(IRI subject,
IRI object) |
protected void |
addSharedAnonymousNode(IRI iri,
java.lang.Object translation) |
protected void |
addSWRLBuiltInAtom(IRI iri) |
protected void |
addSWRLClassAtom(IRI iri) |
protected void |
addSWRLDataPropertyAtom(IRI iri) |
protected void |
addSWRLDataRangeAtom(IRI iri) |
protected void |
addSWRLDifferentFromAtom(IRI iri) |
protected void |
addSWRLIndividualPropertyAtom(IRI iri) |
protected void |
addSWRLRule(IRI iri) |
protected void |
addSWRLSameAsAtom(IRI iri) |
protected void |
addSWRLVariable(IRI iri) |
void |
addTriple(IRI subject,
IRI predicate,
IRI object) |
void |
addTriple(IRI subject,
IRI predicate,
OWLLiteral con) |
protected void |
applyChange(OWLOntologyChange change) |
protected void |
checkForAndProcessAnnotatedDeclaration(IRI mainNode) |
protected void |
consumeTriple(IRI subject,
IRI predicate,
IRI object) |
protected void |
consumeTriple(IRI subject,
IRI predicate,
OWLLiteral con) |
protected void |
dumpRemainingTriples() |
void |
endModel()
This is where we do all remaining parsing
|
java.util.Set<IRI> |
getAnnotatedSourceAnnotationMainNodes(IRI source)
Gets the main nodes of annotations that annotated the specified source
|
OWLClassExpression |
getClassExpressionIfTranslated(IRI mainNode) |
OWLOntologyLoaderConfiguration |
getConfiguration() |
OWLDataFactory |
getDataFactory() |
OWLLiteral |
getFirstLiteral(IRI subject) |
IRI |
getFirstResource(IRI subject,
boolean consume) |
OWLAxiom |
getLastAddedAxiom() |
OWLLiteral |
getLiteralObject(IRI subject,
IRI predicate,
boolean consume) |
OWLLiteral |
getLiteralObject(IRI subject,
OWLRDFVocabulary predicate,
boolean consume) |
java.util.Set<OWLLiteral> |
getLiteralObjects(IRI subject,
IRI predicate) |
java.util.Set<IRI> |
getOntologies() |
OWLOntology |
getOntology() |
RDFOntologyFormat |
getOntologyFormat() |
protected OWLClass |
getOWLClass(IRI iri) |
protected OWLDataProperty |
getOWLDataProperty(IRI iri) |
protected OWLIndividual |
getOWLIndividual(IRI iri) |
protected OWLObjectProperty |
getOWLObjectProperty(IRI iri) |
OWLOntologyManager |
getOWLOntologyManager() |
java.util.Set<OWLAnnotation> |
getPendingAnnotations()
Gets any annotations that were translated since the last call of this method (calling
this method clears the current pending annotations)
|
java.util.Set<IRI> |
getPredicatesBySubject(IRI subject) |
IRI |
getResourceObject(IRI subject,
IRI predicate,
boolean consume) |
IRI |
getResourceObject(IRI subject,
OWLRDFVocabulary predicate,
boolean consume) |
java.util.Set<IRI> |
getResourceObjects(IRI subject,
IRI predicate) |
IRI |
getRest(IRI subject,
boolean consume) |
protected java.lang.Object |
getSharedAnonymousNode(IRI iri) |
IRI |
getSynonym(IRI original) |
void |
handle(IRI subject,
IRI predicate,
IRI object)
Handles triples in a non-streaming mode.
|
void |
handle(IRI subject,
IRI predicate,
OWLLiteral object) |
boolean |
hasPredicate(IRI subject,
IRI predicate) |
void |
importsClosureChanged() |
void |
includeModel(java.lang.String string,
java.lang.String string1)
Receives the notification that the model being parsed includes another model with supplied URIs.
|
protected boolean |
isAnnotation(IRI iri) |
protected boolean |
isAnnotationProperty(IRI iri) |
protected boolean |
isAnnotationPropertyOnly(IRI iri)
Determines if a given IRI is currently an annotation property IRI and not a data property IRI and not
an object property IRI.
|
protected boolean |
isAnonymousNode(IRI iri)
Checks whether a node is anonymous.
|
boolean |
isAxiom(IRI iri) |
boolean |
isClassExpression(IRI iri) |
protected boolean |
isDataProperty(IRI iri) |
protected boolean |
isDataPropertyOnly(IRI iri)
Determines if a given IRI is currently a data property IRI and not an object property IRI and not
an annotation property IRI.
|
boolean |
isDataRange(IRI iri) |
protected boolean |
isGeneralPredicate(IRI predicate) |
protected boolean |
isIndividual(IRI iri) |
protected boolean |
isObjectProperty(IRI iri) |
protected boolean |
isObjectPropertyOnly(IRI iri)
Determines if a given IRI is currently an object property IRI and not a data property IRI and not
an annotation property IRI.
|
protected boolean |
isOntology(IRI iri) |
boolean |
isParsedAllTriples() |
protected boolean |
isRDFProperty(IRI iri) |
boolean |
isRestriction(IRI iri) |
protected boolean |
isSharedAnonymousNode(IRI iri) |
protected boolean |
isSWRLBuiltInAtom(IRI iri) |
protected boolean |
isSWRLClassAtom(IRI iri) |
protected boolean |
isSWRLDataRangeAtom(IRI iri) |
protected boolean |
isSWRLDataValuedPropertyAtom(IRI iri) |
protected boolean |
isSWRLDifferentFromAtom(IRI iri) |
protected boolean |
isSWRLIndividualPropertyAtom(IRI iri) |
protected boolean |
isSWRLRule(IRI iri) |
protected boolean |
isSWRLSameAsAtom(IRI iri) |
protected boolean |
isSWRLVariable(IRI iri) |
boolean |
isTriplePresent(IRI subject,
IRI predicate,
IRI object,
boolean consume) |
boolean |
isTriplePresent(IRI subject,
IRI predicate,
OWLLiteral object,
boolean consume) |
<E extends java.lang.Throwable> |
iterateLiteralTriples(org.coode.owlapi.rdfxml.parser.OWLRDFConsumer.LiteralTripleIterator<E> iterator) |
<E extends java.lang.Throwable> |
iterateResourceTriples(org.coode.owlapi.rdfxml.parser.OWLRDFConsumer.ResourceTripleIterator<E> iterator) |
void |
logicalURI(java.lang.String string)
Receives the logical URI of the model.
|
protected void |
removeAxiom(OWLAxiom axiom)
Marks an axioms for removal at the end of parsing.
|
void |
setExpectedAxioms(int expectedAxioms) |
void |
setIRIProvider(IRIProvider iriProvider) |
void |
setOntologyFormat(RDFOntologyFormat format) |
protected void |
setOntologyID(OWLOntologyID ontologyID) |
void |
setPendingAnnotations(java.util.Set<OWLAnnotation> annotations) |
void |
startModel(java.lang.String string)
Called when model parsing is started.
|
void |
statementWithLiteralValue(java.lang.String subject,
java.lang.String predicate,
java.lang.String object,
java.lang.String lang,
java.lang.String datatype)
Called when a statement with literal value is added to the model.
|
void |
statementWithResourceValue(java.lang.String subject,
java.lang.String predicate,
java.lang.String object)
Called when a statement with resource value is added to the model.
|
java.util.Set<OWLAnnotation> |
translateAnnotations(IRI mainNode)
Translates the annotation on a main node.
|
OWLClassExpression |
translateClassExpression(IRI mainNode) |
OWLDataPropertyExpression |
translateDataPropertyExpression(IRI iri) |
OWLDataRange |
translateDataRange(IRI mainNode)
Given a main node, translated data ranges according to Table 12
|
OWLIndividual |
translateIndividual(IRI node) |
OWLObjectPropertyExpression |
translateObjectPropertyExpression(IRI mainNode) |
java.util.Set<OWLClassExpression> |
translateToClassExpressionSet(IRI mainNode) |
java.util.Set<OWLLiteral> |
translateToConstantSet(IRI mainNode) |
java.util.List<OWLDataPropertyExpression> |
translateToDataPropertyList(IRI mainNode) |
java.util.Set<OWLDataRange> |
translateToDataRangeSet(IRI mainNode) |
java.util.Set<OWLFacetRestriction> |
translateToFacetRestrictionSet(IRI mainNode) |
java.util.Set<OWLIndividual> |
translateToIndividualSet(IRI mainNode) |
java.util.List<OWLObjectPropertyExpression> |
translateToObjectPropertyList(IRI mainNode) |
protected java.util.Map<IRI,BuiltInTypeHandler> axiomTypeTripleHandlers
protected java.util.List<AbstractLiteralTripleHandler> literalTripleHandlers
protected java.util.List<AbstractResourceTripleHandler> resourceTripleHandlers
protected TPInverseOfHandler inverseOfHandler
public OWLRDFConsumer(OWLOntology ontology, AnonymousNodeChecker checker, OWLOntologyLoaderConfiguration configuration)
@Deprecated public OWLRDFConsumer(OWLOntologyManager owlOntologyManager, OWLOntology ontology, AnonymousNodeChecker checker, OWLOntologyLoaderConfiguration configuration)
public void setIRIProvider(IRIProvider iriProvider)
public OWLOntology getOntology()
public RDFOntologyFormat getOntologyFormat()
public void setOntologyFormat(RDFOntologyFormat format)
public void setExpectedAxioms(int expectedAxioms)
public OWLDataFactory getDataFactory()
public java.util.Set<OWLAnnotation> getPendingAnnotations()
public void setPendingAnnotations(java.util.Set<OWLAnnotation> annotations)
public void importsClosureChanged()
protected boolean isAnonymousNode(IRI iri)
iri
- The IRI of the node to be checked.true
if the node is anonymous, or
false
if the node is not anonymous.protected boolean isSharedAnonymousNode(IRI iri)
protected void addSharedAnonymousNode(IRI iri, java.lang.Object translation)
protected java.lang.Object getSharedAnonymousNode(IRI iri)
protected void addAxiom(OWLAxiom axiom)
protected void removeAxiom(OWLAxiom axiom)
axiom
- The axiom to be removed.protected void checkForAndProcessAnnotatedDeclaration(IRI mainNode) throws UnloadableImportException
UnloadableImportException
protected void applyChange(OWLOntologyChange change)
protected void setOntologyID(OWLOntologyID ontologyID)
protected void addOntologyAnnotation(OWLAnnotation annotation)
protected void addImport(OWLImportsDeclaration declaration)
public OWLAxiom getLastAddedAxiom()
protected boolean isIndividual(IRI iri)
protected void addRDFProperty(IRI iri)
protected boolean isRDFProperty(IRI iri)
public void addClassExpression(IRI iri, boolean explicitlyTyped)
public boolean isClassExpression(IRI iri)
public void addObjectProperty(IRI iri, boolean explicitlyTyped)
public void addDataProperty(IRI iri, boolean explicitlyTyped)
protected void addAnnotationProperty(IRI iri, boolean explicitlyTyped)
public void addDataRange(IRI iri, boolean explicitlyTyped)
protected void addOWLNamedIndividual(IRI iri, boolean explicitlyType)
protected void addOWLRestriction(IRI iri, boolean explicitlyTyped)
public boolean isRestriction(IRI iri)
protected void addAnnotationIRI(IRI iri)
protected boolean isAnnotation(IRI iri)
protected boolean isObjectPropertyOnly(IRI iri)
iri
- The IRI to check.true
if the IRI is an object property IRI and not a data property IRI and not
an annotation property IRI. Otherwise, false
.protected boolean isObjectProperty(IRI iri)
protected boolean isDataPropertyOnly(IRI iri)
iri
- The IRI to check.true
if the IRI is a data property IRI and not an object property IRI and not
an annotation property IRI. Otherwise, false
.protected boolean isDataProperty(IRI iri)
protected boolean isAnnotationPropertyOnly(IRI iri)
iri
- The IRI to check.true
if the IRI is an annotation property IRI and not a data property IRI and not
an object property IRI. Otherwise, false
.protected boolean isAnnotationProperty(IRI iri)
protected boolean isOntology(IRI iri)
public OWLOntologyManager getOWLOntologyManager()
public void addAnnotatedSource(IRI annotatedAnonSource, IRI annotationMainNode)
annotatedAnonSource
- The source that the annotation annotatesannotationMainNode
- The annotationspublic java.util.Set<IRI> getAnnotatedSourceAnnotationMainNodes(IRI source)
source
- The source (axiom or annotation main node)protected OWLObjectProperty getOWLObjectProperty(IRI iri)
protected OWLDataProperty getOWLDataProperty(IRI iri)
protected OWLIndividual getOWLIndividual(IRI iri)
protected void consumeTriple(IRI subject, IRI predicate, OWLLiteral con)
protected void addSWRLRule(IRI iri)
protected boolean isSWRLRule(IRI iri)
protected void addSWRLIndividualPropertyAtom(IRI iri)
protected boolean isSWRLIndividualPropertyAtom(IRI iri)
protected void addSWRLDataPropertyAtom(IRI iri)
protected boolean isSWRLDataValuedPropertyAtom(IRI iri)
protected void addSWRLClassAtom(IRI iri)
protected boolean isSWRLClassAtom(IRI iri)
protected void addSWRLSameAsAtom(IRI iri)
protected boolean isSWRLSameAsAtom(IRI iri)
protected void addSWRLDifferentFromAtom(IRI iri)
protected boolean isSWRLDifferentFromAtom(IRI iri)
protected void addSWRLDataRangeAtom(IRI iri)
protected boolean isSWRLDataRangeAtom(IRI iri)
protected void addSWRLBuiltInAtom(IRI iri)
protected boolean isSWRLBuiltInAtom(IRI iri)
protected void addSWRLVariable(IRI iri)
protected boolean isSWRLVariable(IRI iri)
public void handle(IRI subject, IRI predicate, IRI object) throws UnloadableImportException
subject
- The subject of the triplepredicate
- The predicate of the tripleobject
- The object of the tripleUnloadableImportException
- if such exception is raised by handleTriple()public void handle(IRI subject, IRI predicate, OWLLiteral object)
protected void dumpRemainingTriples()
public void startModel(java.lang.String string) throws org.xml.sax.SAXException
RDFConsumer
startModel
in interface RDFConsumer
string
- physical URI of the modelorg.xml.sax.SAXException
public boolean isParsedAllTriples()
public void endModel() throws org.xml.sax.SAXException
endModel
in interface RDFConsumer
org.xml.sax.SAXException
public void addModelAttribte(java.lang.String string, java.lang.String string1) throws org.xml.sax.SAXException
RDFConsumer
addModelAttribte
in interface RDFConsumer
string
- the key of the attributestring1
- the value of the attributeorg.xml.sax.SAXException
public void includeModel(java.lang.String string, java.lang.String string1) throws org.xml.sax.SAXException
RDFConsumer
includeModel
in interface RDFConsumer
string
- logical URI of the modelstring1
- physical URI of the modelorg.xml.sax.SAXException
public void logicalURI(java.lang.String string) throws org.xml.sax.SAXException
RDFConsumer
logicalURI
in interface RDFConsumer
string
- logical URI of the modelorg.xml.sax.SAXException
public void statementWithLiteralValue(java.lang.String subject, java.lang.String predicate, java.lang.String object, java.lang.String lang, java.lang.String datatype) throws org.xml.sax.SAXException
RDFConsumer
statementWithLiteralValue
in interface RDFConsumer
subject
- URI of the subject resourcepredicate
- URI of the predicate resourceobject
- literal object valuelang
- the languagedatatype
- the URI of the literal's datatype (may be null
)org.xml.sax.SAXException
public void statementWithResourceValue(java.lang.String subject, java.lang.String predicate, java.lang.String object) throws org.xml.sax.SAXException
RDFConsumer
statementWithResourceValue
in interface RDFConsumer
subject
- URI of the subject resourcepredicate
- URI of the predicate resourceobject
- URI of the object resourceorg.xml.sax.SAXException
public OWLDataRange translateDataRange(IRI mainNode)
mainNode
- The main nodepublic OWLDataPropertyExpression translateDataPropertyExpression(IRI iri)
public OWLObjectPropertyExpression translateObjectPropertyExpression(IRI mainNode)
public OWLIndividual translateIndividual(IRI node)
public java.util.Set<OWLAnnotation> translateAnnotations(IRI mainNode)
mainNode
- The main nodepublic OWLClassExpression translateClassExpression(IRI mainNode)
public OWLClassExpression getClassExpressionIfTranslated(IRI mainNode)
public java.util.List<OWLObjectPropertyExpression> translateToObjectPropertyList(IRI mainNode)
public java.util.List<OWLDataPropertyExpression> translateToDataPropertyList(IRI mainNode)
public java.util.Set<OWLClassExpression> translateToClassExpressionSet(IRI mainNode)
public java.util.Set<OWLLiteral> translateToConstantSet(IRI mainNode)
public java.util.Set<OWLIndividual> translateToIndividualSet(IRI mainNode)
public java.util.Set<OWLDataRange> translateToDataRangeSet(IRI mainNode)
public java.util.Set<OWLFacetRestriction> translateToFacetRestrictionSet(IRI mainNode)
public IRI getResourceObject(IRI subject, OWLRDFVocabulary predicate, boolean consume)
public OWLLiteral getLiteralObject(IRI subject, OWLRDFVocabulary predicate, boolean consume)
public OWLLiteral getLiteralObject(IRI subject, IRI predicate, boolean consume)
public java.util.Set<OWLLiteral> getLiteralObjects(IRI subject, IRI predicate)
public boolean isTriplePresent(IRI subject, IRI predicate, IRI object, boolean consume)
protected boolean isGeneralPredicate(IRI predicate)
public boolean isTriplePresent(IRI subject, IRI predicate, OWLLiteral object, boolean consume)
public OWLLiteral getFirstLiteral(IRI subject)
public void addFirst(IRI subject, OWLLiteral object)
public void addOntology(IRI iri)
public java.util.Set<IRI> getOntologies()
public void addAxiom(IRI axiomIRI)
public boolean isAxiom(IRI iri)
public boolean isDataRange(IRI iri)
public OWLOntologyLoaderConfiguration getConfiguration()
public <E extends java.lang.Throwable> void iterateResourceTriples(org.coode.owlapi.rdfxml.parser.OWLRDFConsumer.ResourceTripleIterator<E> iterator) throws E extends java.lang.Throwable
E extends java.lang.Throwable
public <E extends java.lang.Throwable> void iterateLiteralTriples(org.coode.owlapi.rdfxml.parser.OWLRDFConsumer.LiteralTripleIterator<E> iterator) throws E extends java.lang.Throwable
E extends java.lang.Throwable
public void addTriple(IRI subject, IRI predicate, OWLLiteral con)