public class OWLRDFConsumer extends Object implements RDFConsumer, OWLAnonymousIndividualByIdProvider
Constructor and Description |
---|
OWLRDFConsumer(OWLOntology ontology,
AnonymousNodeChecker checker,
OWLOntologyLoaderConfiguration configuration)
Instantiates a new oWLRDF consumer.
|
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).
|
void |
addAxiom(IRI axiomIRI)
Adds the axiom.
|
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 |
addFirst(IRI subject,
IRI object)
Adds the first.
|
void |
addFirst(IRI subject,
OWLLiteral object)
Adds the first.
|
void |
addModelAttribte(String string,
String string1)
Receives the notification that the attribute and its value has been
parsed.
|
void |
addObjectProperty(IRI iri,
boolean explicitlyTyped)
Adds the object property.
|
void |
addOntology(IRI iri)
Adds the ontology.
|
void |
addPrefix(String abbreviation,
String value)
Add a prefix to the underlying ontology format, if prefixes are
supported.
|
void |
addRest(IRI subject,
IRI object)
Adds the rest.
|
void |
addTriple(IRI subject,
IRI predicate,
IRI object)
Adds the triple.
|
void |
addTriple(IRI subject,
IRI predicate,
OWLLiteral con)
Adds the triple.
|
void |
endModel()
Called when model parsing is finished.
|
Set<IRI> |
getAnnotatedSourceAnnotationMainNodes(IRI source)
Gets the main nodes of annotations that annotated the specified source.
|
OWLClassExpression |
getClassExpressionIfTranslated(IRI mainNode)
Gets the class expression if translated.
|
OWLOntologyLoaderConfiguration |
getConfiguration()
Gets the configuration.
|
OWLDataFactory |
getDataFactory()
Gets the data factory.
|
OWLLiteral |
getFirstLiteral(IRI subject)
Gets the first literal.
|
IRI |
getFirstResource(IRI subject,
boolean consume)
Gets the first resource.
|
OWLAxiom |
getLastAddedAxiom()
Gets the last added axiom.
|
OWLLiteral |
getLiteralObject(IRI subject,
IRI predicate,
boolean consume)
Gets the literal object.
|
OWLLiteral |
getLiteralObject(IRI subject,
OWLRDFVocabulary predicate,
boolean consume)
Gets the literal object.
|
Set<OWLLiteral> |
getLiteralObjects(IRI subject,
IRI predicate)
Gets the literal objects.
|
Set<IRI> |
getOntologies()
Gets the ontologies.
|
OWLOntology |
getOntology()
Gets the ontology.
|
RDFOntologyFormat |
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).
|
Set<IRI> |
getPredicatesBySubject(IRI subject)
Gets the predicates by subject.
|
IRI |
getResourceObject(IRI subject,
IRI predicate,
boolean consume)
Gets the resource object.
|
IRI |
getResourceObject(IRI subject,
OWLRDFVocabulary predicate,
boolean consume)
Gets the resource object.
|
Set<IRI> |
getResourceObjects(IRI subject,
IRI predicate)
Gets the resource objects.
|
IRI |
getRest(IRI subject,
boolean consume)
Gets the rest.
|
IRI |
getSynonym(IRI original)
Gets the synonym.
|
void |
handle(IRI subject,
IRI predicate,
IRI object)
Handles triples in a non-streaming mode.
|
void |
handle(IRI subject,
IRI predicate,
OWLLiteral object)
Handle.
|
boolean |
hasPredicate(IRI subject,
IRI predicate)
Checks for predicate.
|
void |
importsClosureChanged()
Imports closure changed.
|
void |
includeModel(String string,
String string1)
Receives the notification that the model being parsed includes another
model with supplied URIs.
|
boolean |
isAxiom(IRI iri)
Checks if is axiom.
|
boolean |
isClassExpression(IRI iri)
Checks if is class expression.
|
boolean |
isDataRange(IRI iri)
Checks if is data range.
|
boolean |
isParsedAllTriples()
Checks if is parsed all triples.
|
boolean |
isRestriction(IRI iri)
Checks if is restriction.
|
boolean |
isTriplePresent(IRI subject,
IRI predicate,
IRI object,
boolean consume)
Checks if is triple present.
|
boolean |
isTriplePresent(IRI subject,
IRI predicate,
OWLLiteral object,
boolean consume)
Checks if is triple present.
|
void |
logicalURI(String string)
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 |
setIRIProvider(IRIProvider iriProvider)
Sets the iRI provider.
|
void |
setOntologyFormat(RDFOntologyFormat format)
Sets the ontology format.
|
void |
setPendingAnnotations(Set<OWLAnnotation> annotations)
Sets the pending annotations.
|
void |
startModel(String string)
Called when model parsing is started.
|
void |
statementWithLiteralValue(String subject,
String predicate,
String object,
String lang,
String datatype)
Called when a statement with literal 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 mainNode)
Translate class expression.
|
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.
|
Set<OWLClassExpression> |
translateToClassExpressionSet(IRI mainNode)
Translate to class expression set.
|
Set<OWLLiteral> |
translateToConstantSet(IRI mainNode)
Translate to constant set.
|
List<OWLDataPropertyExpression> |
translateToDataPropertyList(IRI mainNode)
Translate to data property list.
|
Set<OWLDataRange> |
translateToDataRangeSet(IRI mainNode)
Translate to data range set.
|
Set<OWLFacetRestriction> |
translateToFacetRestrictionSet(IRI mainNode)
Translate to facet restriction set.
|
Set<OWLIndividual> |
translateToIndividualSet(IRI mainNode)
Translate to individual set.
|
List<OWLObjectPropertyExpression> |
translateToObjectPropertyList(IRI mainNode)
Translate to object property list.
|
public OWLRDFConsumer(OWLOntology ontology, AnonymousNodeChecker checker, OWLOntologyLoaderConfiguration configuration)
ontology
- the ontologychecker
- the checkerconfiguration
- the configuration@Deprecated public OWLRDFConsumer(OWLOntologyManager owlOntologyManager, OWLOntology ontology, AnonymousNodeChecker checker, OWLOntologyLoaderConfiguration configuration)
owlOntologyManager
- the owl ontology managerontology
- the ontologychecker
- the checkerconfiguration
- the configurationpublic void addPrefix(String abbreviation, String value)
RDFConsumer
addPrefix
in interface RDFConsumer
abbreviation
- short name for prefixvalue
- replacement for short versionpublic void setIRIProvider(IRIProvider iriProvider)
iriProvider
- the new iRI providerpublic OWLOntology getOntology()
public RDFOntologyFormat getOntologyFormat()
public void setOntologyFormat(RDFOntologyFormat format)
format
- the new ontology formatpublic void setExpectedAxioms(int expectedAxioms)
expectedAxioms
- the new expected axiomspublic OWLDataFactory getDataFactory()
public Set<OWLAnnotation> getPendingAnnotations()
public void setPendingAnnotations(Set<OWLAnnotation> annotations)
annotations
- the new pending annotationspublic void importsClosureChanged()
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)
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 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)
subject
- the subjectpredicate
- the predicateobject
- the objectpublic void startModel(String string) throws SAXException
RDFConsumer
startModel
in interface RDFConsumer
string
- physical URI of the modelSAXException
- sax exceptionpublic boolean isParsedAllTriples()
public void endModel() throws SAXException
RDFConsumer
endModel
in interface RDFConsumer
SAXException
- sax exceptionpublic void addModelAttribte(String string, String string1) throws SAXException
RDFConsumer
addModelAttribte
in interface RDFConsumer
string
- the key of the attributestring1
- the value of the attributeSAXException
- sax exceptionpublic void includeModel(String string, String string1) throws SAXException
RDFConsumer
includeModel
in interface RDFConsumer
string
- logical URI of the modelstring1
- physical URI of the modelSAXException
- sax exceptionpublic void logicalURI(String string) throws SAXException
RDFConsumer
logicalURI
in interface RDFConsumer
string
- logical URI of the modelSAXException
- sax exceptionpublic IRI getSynonym(IRI original)
original
- the originalpublic void statementWithLiteralValue(String subject, String predicate, String object, String lang, String datatype) throws 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
)SAXException
- sax exceptionpublic void statementWithResourceValue(String subject, String predicate, String object) throws SAXException
RDFConsumer
statementWithResourceValue
in interface RDFConsumer
subject
- URI of the subject resourcepredicate
- URI of the predicate resourceobject
- URI of the object resourceSAXException
- sax exceptionpublic OWLDataRange translateDataRange(IRI mainNode)
mainNode
- 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 mainNode)
mainNode
- The main nodepublic OWLClassExpression translateClassExpression(IRI mainNode)
mainNode
- the main nodepublic OWLClassExpression getClassExpressionIfTranslated(IRI mainNode)
mainNode
- the main nodepublic List<OWLObjectPropertyExpression> translateToObjectPropertyList(IRI mainNode)
mainNode
- the main nodepublic List<OWLDataPropertyExpression> translateToDataPropertyList(IRI mainNode)
mainNode
- the main nodepublic Set<OWLClassExpression> translateToClassExpressionSet(IRI mainNode)
mainNode
- the main nodepublic Set<OWLLiteral> translateToConstantSet(IRI mainNode)
mainNode
- the main nodepublic Set<OWLIndividual> translateToIndividualSet(IRI mainNode)
mainNode
- the main nodepublic Set<OWLDataRange> translateToDataRangeSet(IRI mainNode)
mainNode
- the main nodepublic Set<OWLFacetRestriction> translateToFacetRestrictionSet(IRI mainNode)
mainNode
- the main nodepublic Set<IRI> getPredicatesBySubject(IRI subject)
subject
- the subjectpublic IRI getResourceObject(IRI subject, OWLRDFVocabulary predicate, boolean consume)
subject
- the subjectpredicate
- the predicateconsume
- the consumepublic IRI getResourceObject(IRI subject, IRI predicate, boolean consume)
subject
- the subjectpredicate
- the predicateconsume
- the consumepublic Set<IRI> getResourceObjects(IRI subject, IRI predicate)
subject
- the subjectpredicate
- the predicatepublic OWLLiteral getLiteralObject(IRI subject, OWLRDFVocabulary predicate, boolean consume)
subject
- the subjectpredicate
- the predicateconsume
- the consumepublic OWLLiteral getLiteralObject(IRI subject, IRI predicate, boolean consume)
subject
- the subjectpredicate
- the predicateconsume
- the consumepublic Set<OWLLiteral> getLiteralObjects(IRI subject, IRI predicate)
subject
- the subjectpredicate
- the predicatepublic boolean isTriplePresent(IRI subject, IRI predicate, IRI object, boolean consume)
subject
- the subjectpredicate
- the predicateobject
- the objectconsume
- the consumepublic boolean isTriplePresent(IRI subject, IRI predicate, OWLLiteral object, boolean consume)
subject
- the subjectpredicate
- the predicateobject
- the objectconsume
- the consumepublic boolean hasPredicate(IRI subject, IRI predicate)
subject
- the subjectpredicate
- the predicatepublic void addRest(IRI subject, IRI object)
subject
- the subjectobject
- the objectpublic void addFirst(IRI subject, IRI object)
subject
- the subjectobject
- the objectpublic IRI getFirstResource(IRI subject, boolean consume)
subject
- the subjectconsume
- the consumepublic OWLLiteral getFirstLiteral(IRI subject)
subject
- the subjectpublic IRI getRest(IRI subject, boolean consume)
subject
- the subjectconsume
- the consumepublic void addFirst(IRI subject, OWLLiteral object)
subject
- the subjectobject
- the objectpublic void addOntology(IRI iri)
iri
- the iripublic void addAxiom(IRI axiomIRI)
axiomIRI
- the axiom iripublic boolean isAxiom(IRI iri)
iri
- the iripublic boolean isDataRange(IRI iri)
iri
- the iripublic OWLOntologyLoaderConfiguration getConfiguration()
public IRI remapIRI(IRI i)
RDFConsumer
remapIRI
in interface RDFConsumer
i
- iri to remap if not blankpublic String remapOnlyIfRemapped(String i)
RDFConsumer
remapOnlyIfRemapped
in interface RDFConsumer
i
- iri to remap if not blankpublic void addTriple(IRI subject, IRI predicate, IRI object)
subject
- the subjectpredicate
- the predicateobject
- the objectpublic void addTriple(IRI subject, IRI predicate, OWLLiteral con)
subject
- the subjectpredicate
- the predicatecon
- the conCopyright © 2017 The University of Manchester. All Rights Reserved.