- All Superinterfaces:
org.apache.jena.graph.FrontsNode,OntObject,org.apache.jena.rdf.model.RDFNode,org.apache.jena.rdf.model.Resource
- All Known Implementing Classes:
OntIDImpl
Interface encapsulating an Ontology Identifier.
Each
OWL2 Obtology must have one and only one Ontology ID inside.
Please note: the methods of this interface do not affect the hierarchical structure of the graph
to which this resource is attached, they only affect the structure of the graph itself.
In other words, calling the methods removeImport(String) does not remove the sub-graph
from the main Union Graph.
Similar, calling the method addImport(String) simply adds the corresponding triple to the base graph.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault OntIDaddComment(String txt) Creates_:this rdfs:comment "txt"^^xsd:stringstatement.default OntIDaddComment(String txt, String lang) Adds the given localized text annotation with builtinrdfs:commentpredicate.Adds the triplethis owl:import urito this resource.default OntIDaddVersionInfo(String txt) Adds aowl:versionInfodescription.default OntIDaddVersionInfo(String txt, String lang) Annotates this object withowl:versionInfopredicate and the specified language-tagged literal.default OntIDannotate(OntAnnotationProperty predicate, String txt, String lang) Adds a language-tagged text for this object and the givenpredicatedefault OntIDannotate(OntAnnotationProperty predicate, org.apache.jena.rdf.model.RDFNode value) Annotates the object with the givenpredicateandvalue.default <X extends org.apache.jena.rdf.model.RDFNode>
XSafely converts this RDF resource to the giventypeinterface, if it is possible.default StringReturns an IRI that can be used to createowl:importsstatement in another model to make a reference between a model to which this id belongs and another model.getModel()Returns the ontology model associated with this resource.default StringAnswers the version info string for this ontology id.default StringgetVersionInfo(String lang) Answers the version info string for this ontology id.Returns an IRI from the right side ofthis owl:versionIRI IRIstatement if it is uniquely determined.imports()Lists allowl:imports.booleanisLocal()Determines if this Ontology Resource is locally defined.removeImport(String uri) Removes the triplethis owl:import urifrom this resource.default booleanIndicates whether the givenOntology IDis equal to this one in OWL2 terms.setVersionIRI(String uri) Assigns a new version IRI to this Ontology ID object.Methods inherited from interface org.apache.jena.graph.FrontsNode
asNodeMethods inherited from interface org.apache.jena.ontapi.model.OntObject
addAnnotation, addAnnotation, addAnnotation, addLabel, addLabel, addStatement, annotations, annotationValues, annotationValues, clearAnnotations, content, getComment, getComment, getLabel, getLabel, getMainStatement, getRequiredProperty, hasType, objects, objects, objectType, remove, spec, statement, statement, statements, statements, typesMethods inherited from interface org.apache.jena.rdf.model.RDFNode
as, asLiteral, asResource, asStatementTerm, canAs, isAnon, isLiteral, isResource, isStatementTerm, isURIResource, visitWithMethods inherited from interface org.apache.jena.rdf.model.Resource
abort, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addProperty, addProperty, addProperty, addProperty, begin, commit, equals, getId, getLocalName, getNameSpace, getProperty, getProperty, getPropertyResourceValue, getRequiredProperty, getURI, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasProperty, hasProperty, hasProperty, hasProperty, hasURI, inModel, listProperties, listProperties, listProperties, removeAll, removeProperties, toString
-
Method Details
-
getVersionIRI
String getVersionIRI()Returns an IRI from the right side ofthis owl:versionIRI IRIstatement if it is uniquely determined.- Returns:
- String IRI or
null
-
setVersionIRI
Assigns a new version IRI to this Ontology ID object. Anullargument means that current version IRI should be deleted.- Parameters:
uri- String, can benullto remove versionIRI- Returns:
- this ID-object to allow cascading calls
- Throws:
OntJenaException- if input is wrong
-
addImport
Adds the triplethis owl:import urito this resource.- Parameters:
uri- String, notnull- Returns:
- this ID-object to allow cascading calls
- Throws:
OntJenaException- if input is wrong
-
removeImport
Removes the triplethis owl:import urifrom this resource.- Parameters:
uri- String, notnull- Returns:
- this ID-object to allow cascading calls
-
imports
Lists allowl:imports.- Returns:
Streamof Strings (IRIs)
-
sameAs
Indicates whether the givenOntology IDis equal to this one in OWL2 terms. This means that the IDs must have the same IRI + version IRI pairs. If the method returnstrue, then two ontologies can not be coexisting in the same scope.- Parameters:
other-OntID- Returns:
truein case the IDs are the same, otherwisefalse
-
getImportsIRI
Returns an IRI that can be used to createowl:importsstatement in another model to make a reference between a model to which this id belongs and another model. According to the specification, a version IRI is primary.- Returns:
- String or
null - See Also:
-
addComment
Creates_:this rdfs:comment "txt"^^xsd:stringstatement.- Specified by:
addCommentin interfaceOntObject- Parameters:
txt- String, notnull- Returns:
- this object to allow cascading calls
- See Also:
-
addComment
Adds the given localized text annotation with builtinrdfs:commentpredicate.- Specified by:
addCommentin interfaceOntObject- Parameters:
txt- String, the literal lexical form, notnulllang- String, the language tag, nullable- Returns:
- this object to allow cascading calls
- See Also:
-
addVersionInfo
Adds aowl:versionInfodescription.- Parameters:
txt- String, the literal lexical form, notnull- Returns:
- this ID-object to allow cascading calls
-
addVersionInfo
Annotates this object withowl:versionInfopredicate and the specified language-tagged literal.- Parameters:
txt- String, the literal lexical form, notnulllang- String, the language tag, nullable- Returns:
- this ID-object to allow cascading calls
-
getVersionInfo
Answers the version info string for this ontology id. If there is more than one such resource, an arbitrary selection is made.- Returns:
- a
owl:versionInfostring ornullif nothing is found
-
getVersionInfo
Answers the version info string for this ontology id. If there is more than one such resource, an arbitrary selection is made.- Parameters:
lang- String, the language attribute for the desired comment (EN, FR, etc.) ornullfor don't care; will attempt to retrieve the most specific comment matching the given language; to get no-lang literal string an empty string can be used- Returns:
- a
owl:versionInfostring matching the given language, ornullif there is no version info
-
annotate
Adds a language-tagged text for this object and the givenpredicate- Specified by:
annotatein interfaceOntObject- Parameters:
predicate-OntAnnotationProperty- named annotation property, notnulltxt- String, the literal lexical form, cannot benulllang- String, the language tag, can benull- Returns:
- this object to allow cascading calls
-
annotate
Annotates the object with the givenpredicateandvalue.- Specified by:
annotatein interfaceOntObject- Parameters:
predicate-OntAnnotationProperty- named annotation property, notnullvalue-RDFNode- the value: uri-resource, literal or anonymous individual, notnull- Returns:
- this object to allow cascading calls
- See Also:
-
getModel
OntModel getModel()Returns the ontology model associated with this resource. If the Resource was not created by a Model, the result may be null.- Specified by:
getModelin interfaceorg.apache.jena.rdf.model.RDFNode- Returns:
OntModel
-
isLocal
boolean isLocal()Determines if this Ontology Resource is locally defined. This means that the resource definition (i.e., a theroot statement) belongs to the base ontology graph. If the ontology contains subgraphs (which should matchowl:importsin OWL) and the resource is defined in one of them, than this method called from top-level interface will returnfalse.- Returns:
trueif this resource is local to the base model graph.
-
getAs
Safely converts this RDF resource to the giventypeinterface, if it is possible. Otherwise, returnsnull. A calling of this method is effectively equivalent to the expressionthis.canAs(type) ? this.as(type) : null.- Type Parameters:
X- any subtype ofRDFNode- Parameters:
type- aClass-type of the desired RDF view (interface)- Returns:
- an instance of the type
Xornull - See Also:
-
RDFNode.as(Class)RDFNode.canAs(Class)
-