- All Superinterfaces:
org.apache.jena.shared.Lock,org.apache.jena.rdf.model.Model,org.apache.jena.rdf.model.ModelCon,org.apache.jena.rdf.model.ModelGraphInterface,org.apache.jena.shared.PrefixMapping,org.apache.jena.rdf.model.RDFReaderF,org.apache.jena.rdf.model.RDFWriterF
- All Known Implementing Classes:
OntGraphModelImpl
Jena Model about which is known
to contain OWL or RDFS ontology data.
The view supports OWL2 DL specification and all its dialects, including OWL1.
The model also has a component-level support of Semantic Web Rule Language (SWRL).
In addition to the standard Jena Resources and Jena Statements
this model provides access to different ontological components in the form of Objects
and Ontology Statements that support OWL Annotations.
Some of the OntObjects can be constructed using another kind of resource -
OntList, which is an extended analogue of the standard Jena RDFList.
In additional to native Jena Extended Iterators,
this model also provides access to RDF in the form of Streams, that obey the same rules:
both Stream and ExtendedIterator must be closed explicitly
if they are no longer needed but not yet exhausted, see ClosableIterator.
The interface does not extend InfModel,
but the inference model can be accessed via asInferenceModel().
If implementation does not provide inference support, the method will throw an exception.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jena.shared.PrefixMapping
org.apache.jena.shared.PrefixMapping.Factory, org.apache.jena.shared.PrefixMapping.IllegalPrefixException, org.apache.jena.shared.PrefixMapping.JenaLockedException -
Field Summary
Fields inherited from interface org.apache.jena.shared.Lock
READ, WRITEFields inherited from interface org.apache.jena.shared.PrefixMapping
Extended, Standard -
Method Summary
Modifier and TypeMethodDescriptionadd(org.apache.jena.rdf.model.Model m) add(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, String lex, String lang) add(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, String lex, org.apache.jena.datatypes.RDFDatatype datatype) add(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) add(org.apache.jena.rdf.model.Statement s) add(org.apache.jena.rdf.model.Statement[] statements) add(org.apache.jena.rdf.model.StmtIterator it) Adds a sub-model both to theowl:importsection and to the graph hierarchy.addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, boolean v) addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, char v) addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, double v) addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, float v) addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, int v) addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, long v) addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.Literal o) default Stream<OntAnnotationProperty>Lists all annotation properties.default org.apache.jena.rdf.model.InfModelReturns a view of this model that supports inference, if possible.asStatement(org.apache.jena.graph.Triple triple) Answers anOntology Statementin this model who's SPO is that of thetriple.default Stream<OntClass.Named>classes()Lists all named class expressions (OWL classes).default OntAnnotationPropertyCreates annotation property (owl-entity).createBuiltInSWRLAtom(org.apache.jena.rdf.model.Resource predicate, Collection<OntSWRL.DArg> arguments) Creates a BuiltIn Atom.createClassSWRLAtom(OntClass clazz, OntSWRL.IArg arg) Creates a Class Atom.createDataAllValuesFrom(Collection<OntDataProperty> properties, OntDataRange dr) Creates an N-Ary Data Universal Quantification N-Ary Restriction.createDataAllValuesFrom(OntDataProperty property, OntDataRange dr) Creates a Universal Quantification Data Property Restriction.createDataCardinality(OntDataProperty property, int cardinality, OntDataRange dr) Creates a Data Exact Cardinality Restriction, possible Qualified.Creates a Complement of Data Ranges.createDataHasValue(OntDataProperty property, org.apache.jena.rdf.model.Literal literal) Creates a Literal Value Restriction.Creates an Intersection of Data Ranges.default OntDataRange.IntersectionOfcreateDataIntersectionOf(OntDataRange... values) Creates an Intersection of Data Ranges.createDataMaxCardinality(OntDataProperty property, int cardinality, OntDataRange dr) Creates a Data Maximum Cardinality Restriction, possible Qualified.createDataMinCardinality(OntDataProperty property, int cardinality, OntDataRange dr) Creates a Data Minimum Cardinality Restriction, possible Qualified.createDataOneOf(Collection<org.apache.jena.rdf.model.Literal> values) Creates an Enumeration of Literals.default OntDataRange.OneOfcreateDataOneOf(org.apache.jena.rdf.model.Literal... values) Creates an Enumeration of Literals.default OntDataPropertycreateDataProperty(String uri) Creates datatype property (owl-entity).createDataPropertySWRLAtom(OntDataProperty property, OntSWRL.IArg first, OntSWRL.DArg second) Creates a Data Property Atom.createDataRangeSWRLAtom(OntDataRange range, OntSWRL.DArg arg) Creates a Data Range Atom.createDataRestriction(OntDataRange.Named other, Collection<OntFacetRestriction> values) Creates a Datatype Restriction.default OntDataRange.RestrictioncreateDataRestriction(OntDataRange.Named other, OntFacetRestriction... values) Creates a Datatype Restriction.createDataSomeValuesFrom(Collection<OntDataProperty> properties, OntDataRange dr) Creates an N-Ary Data Existential Quantification N-Ary Restriction.createDataSomeValuesFrom(OntDataProperty property, OntDataRange dr) Creates an Existential Quantification Data Property Restriction.default OntDataRange.NamedcreateDatatype(String uri) Creates named datatype (owl-entity), only for OWL2createDataUnionOf(Collection<OntDataRange> values) Creates a Union of Data Ranges.default OntDataRange.UnionOfcreateDataUnionOf(OntDataRange... values) Creates a Union of Data Ranges.createDifferentIndividuals(Collection<OntIndividual> individuals) Creates a Different Individuals Axiom Resource.default OntDisjoint.IndividualscreateDifferentIndividuals(OntIndividual... individuals) Creates a Different Individuals Axiom Resource.createDifferentIndividualsSWRLAtom(OntSWRL.IArg first, OntSWRL.IArg second) Creates a Different Individuals Atom.createDisjointClasses(Collection<OntClass> classes) Creates a Disjoint Classes Axiom Resource.default OntDisjoint.ClassescreateDisjointClasses(OntClass... classes) Creates a Disjoint Classes Axiom Resource.createDisjointDataProperties(Collection<OntDataProperty> properties) Creates a Disjoint Data Properties Axiom Resource.default OntDisjoint.DataPropertiescreateDisjointDataProperties(OntDataProperty... properties) Creates a Disjoint Data Properties Axiom Resource.createDisjointObjectProperties(Collection<OntObjectProperty> properties) Creates a Disjoint Object Properties Axiom Resource.default OntDisjoint.ObjectPropertiescreateDisjointObjectProperties(OntObjectProperty... properties) Creates a Disjoint Object Properties Axiom Resource.<F extends OntFacetRestriction>
FcreateFacetRestriction(Class<F> type, org.apache.jena.rdf.model.Literal literal) Creates a facet restriction by the given type and literal value.createHasSelf(OntObjectProperty property) Creates a Local Reflexivity Class Expression (Self-Restriction).default OntIndividual.NamedcreateIndividual(String uri) Creates named individual (owl-entity), only for OWL2 ifowl:NamedIndividualis enabled.default OntIndividualcreateIndividual(String uri, OntClass type) Creates individual (named or anonymous) of the specified type.createObjectAllValuesFrom(OntObjectProperty property, OntClass ce) Creates a Universal Quantification Object Property Restriction.createObjectCardinality(OntObjectProperty property, int cardinality, OntClass ce) Creates an Object Exact Cardinality Restriction, possible Qualified.Create a Complement of Class Expressions.createObjectHasValue(OntObjectProperty property, OntIndividual individual) Creates an Individual Value Restriction.createObjectIntersectionOf(Collection<OntClass> classes) Creates an Intersection of Class Expressions.default OntClass.IntersectionOfcreateObjectIntersectionOf(OntClass... classes) Creates an Intersection of Class Expressions.createObjectMaxCardinality(OntObjectProperty property, int cardinality, OntClass ce) Creates an Object Maximum Cardinality Restriction, possible Qualified.createObjectMinCardinality(OntObjectProperty property, int cardinality, OntClass ce) Creates an Object Minimum Cardinality Restriction, possible Qualified.createObjectOneOf(Collection<OntIndividual> individuals) Creates an Enumeration of Individuals.default OntClass.OneOfcreateObjectOneOf(OntIndividual... individuals) Creates an Enumeration of Individuals.default OntObjectProperty.NamedCreates named object property (owl-entity).createObjectPropertySWRLAtom(OntObjectProperty property, OntSWRL.IArg first, OntSWRL.IArg second) Creates an Object Property Atom.createObjectSomeValuesFrom(OntObjectProperty property, OntClass ce) Creates an Existential Quantification Object Property Restriction.createObjectUnionOf(Collection<OntClass> classes) Creates a Union of Class Expressions.default OntClass.UnionOfcreateObjectUnionOf(OntClass... classes) Creates a Union of Class Expressions.default OntClass.NamedcreateOntClass(String uri) Creates named class (owl-entity)<E extends OntEntity>
EcreateOntEntity(Class<E> type, String iri) Creates an owl-entity by thetypeandiri.default OntPropertycreateRDFProperty(String uri) Creates namedrdf:Property.createSameIndividualsSWRLAtom(OntSWRL.IArg first, OntSWRL.IArg second) Creates a Same Individuals Atom.createSWRLImp(Collection<OntSWRL.Atom<?>> head, Collection<OntSWRL.Atom<?>> body) Creates a SWRL Rule.createSWRLVariable(String uri) Creates a SWRL Variable, that is a URI resource with a typeswrl:Variable.default Stream<OntDataProperty>Lists all data properties.default Stream<OntDataRange.Named>Lists all datatypes (named data range expressions).default <E extends OntEntity>
EfetchOntEntity(Class<E> type, String uri) Returns an entity of the given type and with the specified URI, creating it if needed.default OntAnnotationPropertydefault OntAnnotationPropertygetAnnotationProperty(org.apache.jena.rdf.model.Resource uri) org.apache.jena.graph.GraphReturns the baseGraph, i.e., the primary ontologicalGraphthat does not contain any subgraph hierarchy.org.apache.jena.rdf.model.ModelReturns thestandard jena modelthat corresponds to thebase graph.default OntDataPropertygetDataProperty(String uri) default OntDataPropertygetDataProperty(org.apache.jena.rdf.model.Resource uri) default OntDataRange.NamedgetDatatype(String uri) default OntDataRange.NamedgetDatatype(org.apache.jena.rdf.model.Literal literal) Retrieves adatatypefrom the given literal.default OntDataRange.NamedgetDatatype(org.apache.jena.rdf.model.Resource uri) default OntIDgetID()Gets the Ontology ID object.default OntIndividual.NamedgetIndividual(String uri) default OntIndividual.NamedgetIndividual(org.apache.jena.rdf.model.Resource uri) default OntObjectProperty.NamedgetObjectProperty(String uri) default OntObjectProperty.NamedgetObjectProperty(org.apache.jena.rdf.model.Resource uri) default OntClass.NamedgetOntClass(String uri) default OntClass.NamedgetOntClass(org.apache.jena.rdf.model.Resource uri) <E extends OntEntity>
EgetOntEntity(Class<E> type, String uri) Returns an ont-entity for the specified type and uri.default <E extends OntEntity>
EgetOntEntity(Class<E> type, org.apache.jena.rdf.model.Resource uri) ReturnsOWL Entitywith the specified class-type anduri.default OntAnnotationPropertydefault OntDataPropertydefault OntObjectProperty.Nameddefault OntAnnotationPropertydefault OntAnnotationPropertydefault OntClass.Nameddefault OntAnnotationPropertydefault OntClass.Nameddefault OntDataPropertydefault OntObjectProperty.Nameddefault OntAnnotationPropertydefault OntAnnotationPropertydefault OntAnnotationPropertydefault OntAnnotationPropertydefault OntDataRange.Nameddefault OntAnnotationPropertybooleanAnswerstrueif the model has a graph with the given uri both inowl:importsand graph-hierarchy.booleanAnswerstrueif the given model is present in theowl:importsof this model.Answers aStreamover the classes in this ontology model that represent the uppermost nodes of the class hierarchy.id()Finds an Ontology ID object.imports()Lists all sub-models that belong to the top-level hierarchy and haveowl:importreference inside the base graph.Lists all class-asserted individuals.default Stream<OntStatement>localStatements(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) Lists all statements from thebase graphfor the specified subject, predicate and object.lock()default Stream<OntIndividual.Named>Lists all named individuals, i.e. all those individuals which have explicitlyowl:NamedIndividualdeclaration.notifyEvent(Object event) Notifies any listeners that theeventhas occurred.default Stream<OntObjectProperty.Named>Lists all named object property expressions (object properties in short).Lists all entities declared in the model.ontEntities(Class<E> type) ontObjects(Class<? extends O> type) Lists all ont-objects of the specified type.default Stream<OntProperty>Lists all OntProperties.read(InputStream in, String base) read(InputStream in, String base, String lang) register(org.apache.jena.rdf.model.ModelChangedListener listener) Registers a listener for model-changed events on this model.remove(org.apache.jena.rdf.model.Model m) remove(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) remove(org.apache.jena.rdf.model.Statement s) remove(org.apache.jena.rdf.model.Statement[] statements) remove(org.apache.jena.rdf.model.StmtIterator it) removeAll(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) removeImport(String uri) Removes the import (bothowl:importdeclaration and the corresponding graph) by the given uri if it is found.Removes a sub-model fromowl:importand from the graph hierarchy.removeNsPrefix(String prefix) removeOntObject(OntObject obj) Removes the givenOntology Objectfrom the graph-model including itscontentand annotations.removeOntStatement(OntStatement statement) Removes the statement from the graph-model including its annotations with sub-annotations hierarchy.Creates a new@uri rdf:type owl:Ontologystatement for the specifieduriand wraps it as Ontology ID Resource.setNsPrefix(String prefix, String uri) setNsPrefixes(Map<String, String> map) setNsPrefixes(org.apache.jena.shared.PrefixMapping other) Lists all ont-statements.statements(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) Lists all statements for the specified subject, predicate and object (SPO).unregister(org.apache.jena.rdf.model.ModelChangedListener listener) Unregisters a listener from model-changed events on this model.withDefaultMappings(org.apache.jena.shared.PrefixMapping map) write(OutputStream out) Writes a serialized representation of a model in a specified language.write(OutputStream out, String lang) Writes a serialized representation of a model in a specified language.write(OutputStream out, String lang, String base) Writes a serialized representation of a model in a specified language.Deprecated.Writes a serialized representation of a model in a specified language.Writes a serialized representation of a model in a specified language.writeAll(OutputStream out, String lang) Writes a serialized representation of all the model's contents, including inferred statements and statements imported from other documents.writeAll(OutputStream out, String lang, String base) Writes a serialized representation of all the model's contents, including inferred statements and statements imported from other documents.Writes a serialized representation of all the model's contents, including inferred statements and statements imported from other documents.Writes a serialized representation of all the model's contents, including inferred statements and statements imported from other documents.Methods inherited from interface org.apache.jena.shared.Lock
enterCriticalSection, leaveCriticalSectionMethods inherited from interface org.apache.jena.rdf.model.Model
abort, begin, calculateInTxn, clearNsPrefixMap, close, commit, contains, contains, contains, containsAll, containsAll, containsAny, containsAny, containsResource, createList, createList, createList, createLiteral, createLiteral, createProperty, createReifier, createReifier, createResource, createResource, createResource, createResource, createStatement, createStatementTerm, createTypedLiteral, createTypedLiteral, createTypedLiteral, difference, equals, executeInTxn, getLock, getProperty, getProperty, getProperty, getReader, getRequiredProperty, getRequiredProperty, getResource, getResource, getWriter, independent, intersection, isClosed, isEmpty, isIsomorphicWith, listNameSpaces, listObjects, listObjectsOfProperty, listObjectsOfProperty, listResourcesWithProperty, listResourcesWithProperty, listStatements, listStatements, listSubjects, listSubjectsWithProperty, listSubjectsWithProperty, removeNsPrefix, setNsPrefix, setNsPrefixes, setNsPrefixes, size, supportsSetOperations, supportsTransactions, union, withDefaultMappingsMethods inherited from interface org.apache.jena.rdf.model.ModelCon
add, contains, contains, contains, containsLiteral, containsLiteral, containsLiteral, containsLiteral, containsLiteral, containsLiteral, containsLiteral, createAlt, createAlt, createBag, createBag, createLiteral, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createProperty, createResource, createResource, createSeq, createSeq, createStatement, createStatement, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, getAlt, getAlt, getBag, getBag, getList, getList, getProperty, getRDFNode, getSeq, getSeq, listLiteralStatements, listLiteralStatements, listLiteralStatements, listLiteralStatements, listLiteralStatements, listLiteralStatements, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listStatements, listStatements, listStatements, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithPropertyMethods inherited from interface org.apache.jena.rdf.model.ModelGraphInterface
asRDFNode, getGraph, wrapAsResourceMethods inherited from interface org.apache.jena.shared.PrefixMapping
expandPrefix, getNsPrefixMap, getNsPrefixURI, getNsURIPrefix, hasNoMappings, numPrefixes, qnameFor, samePrefixMappingAs, shortForm
-
Method Details
-
getBaseGraph
org.apache.jena.graph.Graph getBaseGraph()Returns the baseGraph, i.e., the primary ontologicalGraphthat does not contain any subgraph hierarchy. Only the base graph can be edited from this interface view. To get the whole union graph use the methodModelGraphInterface.getGraph().- Returns:
Graph- See Also:
-
ModelGraphInterface.getGraph()
-
id
Finds an Ontology ID object.Since OWL2 graph requires only one
@uri rdf:type owl:Ontologytriple, the method returnsOptional#emptyin other cases. No changes in theGraphis made. The method works only with thebase graph.- Returns:
- an
Optionalthat contains theOntID - See Also:
-
setID
Creates a new@uri rdf:type owl:Ontologystatement for the specifieduriand wraps it as Ontology ID Resource. Removes all extra ontology objects if they are present and moves their content to the new one, to have a single Ontology header as it is required by OWL2 specification.- Parameters:
uri- String, can benullto make this ontology to be anonymous- Returns:
- the new
OntIDinstance - Throws:
OntJenaException- if ontology can't be added (e.g. due to collision with imports)- See Also:
-
addImport
Adds a sub-model both to theowl:importsection and to the graph hierarchy.- Parameters:
m-ont jena modelto add, notnull- Returns:
- this model to allow cascading calls
- Throws:
OntJenaException- if specified, ontology is anonymous or already present in the imports (both as graph and in owl-declaration)- See Also:
-
removeImport
Removes a sub-model fromowl:importand from the graph hierarchy. Does nothing if the specified model does not belong to this ontology. Matching is performed by graph, not uri (seehasImport(OntModel)description).- Parameters:
m-ont jena modelto remove, notnull- Returns:
- this model to allow cascading calls
- See Also:
-
removeImport
Removes the import (bothowl:importdeclaration and the corresponding graph) by the given uri if it is found.- Parameters:
uri- String, an iri of ontology to find, notnull- Returns:
- this model to allow cascading calls
- See Also:
-
imports
Lists all sub-models that belong to the top-level hierarchy and haveowl:importreference inside the base graph. Caution: since recursive hierarchies are not prohibited, the rectilinear usage of this method may cause a StackOverflow Error.- Returns:
StreamofOntModels- See Also:
-
hasImport
Answerstrueif the given model is present in theowl:importsof this model. This means that at the top-level of the import hierarchy there is a base graph of the givenothermodel. Please note: the model may contain the same uri as that of the specified model, but a different (base) graph, i.e. if the methodhasImport(String)returnstrue, it does not mean this method also returnstrue.- Parameters:
other-OntModelto test, notnull- Returns:
trueif the model is in imports
-
hasImport
Answerstrueif the model has a graph with the given uri both inowl:importsand graph-hierarchy.- Parameters:
uri- String, notnull- Returns:
- boolean
- See Also:
-
ontObjects
Lists all ont-objects of the specified type. Note: this method may return non-distinct results, it is implementation dependent. -
ontEntities
Lists all entities declared in the model. Built-ins are not included. The retrieved entities can belong to the underlying graphs also. Note: this method returns non-distinct stream. The duplicate elements (byequalsandhasCode, not by real class-type) means that there is so-called punning.- Returns:
StreamofOntEntity- See Also:
-
individuals
Stream<OntIndividual> individuals()Lists all class-asserted individuals.A class assertion axiom is a statement
a rdf:type C, whereais a retrieving individual (named or anonymous) andCis any class expression. Notice, that the methodontObjects(Class)called with the parameterOntIndividual.class(i.e.model.ontObject(OntIndividual.class)) must return all individuals from a model, even those which have no explicit declarations (e.g. any part ofowl:sameAsis an individual), while this method returns only class-asserted individuals. Also notice: the methodnamedIndividuals()must return only explicitly declared named individuals, while this method does not require the declarationowl:NamedIndividualto be present for an individual: according to the specification, it is optional; for more details see 5.8.1 Typing Constraints of OWL 2 DL. Also note: in case of valid distinctRDF graphthe returnedStreamis also distinct, which means an individual that has more than one class assertions, must appear in the stream only once.- Returns:
StreamofOntIndividuals- See Also:
-
getOntEntity
Returns an ont-entity for the specified type and uri. This method can also be used to wrap builtin entities, which, in fact, do not belong to the RDF graph, but can be considered as belonged to the OWL model. An IRI for such a built-in entity must be in theBuiltins Vocabulary, otherwise the method returnsnull. -
statements
Stream<OntStatement> statements()Lists all ont-statements.- Returns:
StreamofOntStatement- See Also:
-
Model.listStatements()
-
statements
Stream<OntStatement> statements(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) Lists all statements for the specified subject, predicate and object (SPO).- Parameters:
s-Resource, the subjectp-Property, the predicateo-RDFNode, the object- Returns:
StreamofOntStatement- See Also:
-
Model.listStatements(Resource, Property, RDFNode)
-
localStatements
Stream<OntStatement> localStatements(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) Lists all statements from thebase graphfor the specified subject, predicate and object. Effectively equivalent to themodel.statements(s, p, o).filter(OntStatement::isLocal)expression.- Parameters:
s-Resource, the subjectp-Property, the predicateo-RDFNode, the object- Returns:
StreamofOntStatement- See Also:
-
asStatement
Answers anOntology Statementin this model who's SPO is that of thetriple.- Specified by:
asStatementin interfaceorg.apache.jena.rdf.model.ModelGraphInterface- Parameters:
triple-Triple, notnull- Returns:
OntStatement
-
removeOntObject
Removes the givenOntology Objectfrom the graph-model including itscontentand annotations. This operation does not guarantee the removal of all references to objects: it takes into account only statements where the given object in a subject position. For example, in case of deleting an OWL class that is on the right side in a statement with the predicaterdfs:subClassOf, that statement remains unchanged in the graph, but becomes meaningless: its right side will no longer be a class, but just uri. But if a class is on the left side of the statement with therdfs:subClassOfpredicate, that statement is being removed from the graph along with its annotations, because it belongs to the class content.- Parameters:
obj-OntObject- Returns:
- this model
- See Also:
-
removeOntStatement
Removes the statement from the graph-model including its annotations with sub-annotations hierarchy.- Parameters:
statement-OntStatement- Returns:
- this model
- See Also:
-
Model.remove(Statement)
-
createOntEntity
Creates an owl-entity by thetypeandiri.- Type Parameters:
E- type of ont-entity- Parameters:
type-Class, the type ofOntEntity, notnulliri- String, notnull- Returns:
OntEntity- Throws:
OntJenaException.Creation- in case something is wrong (e.g. configuration does not support creation of the specified type)- See Also:
-
createFacetRestriction
<F extends OntFacetRestriction> F createFacetRestriction(Class<F> type, org.apache.jena.rdf.model.Literal literal) Creates a facet restriction by the given type and literal value. Each call to this method creates a fresh b-node within the graph.- Type Parameters:
F- type of ont-facet-restriction- Parameters:
type-Class, the type ofOntFacetRestriction, notnullliteral-Literal, notnull- Returns:
OntFacetRestriction- See Also:
-
OntDataRange.RestrictionCreateRanges.createDataRestriction(OntDataRange.Named, Collection)
-
getBaseModel
org.apache.jena.rdf.model.Model getBaseModel()Returns thestandard jena modelthat corresponds to thebase graph. Note: there is theJena Builtin Personalitywithin the returned model.- Returns:
Model- See Also:
-
asInferenceModel
default org.apache.jena.rdf.model.InfModel asInferenceModel()Returns a view of this model that supports inference, if possible.- Returns:
InfModel, notnull- Throws:
OntJenaException.Unsupported- if implementation does not support inference, or there is no reasoner attached to the model
-
getID
Gets the Ontology ID object.Since OWL2 graph can only contain the one
@uri rdf:type owl:Ontologytriple inside, this method creates such a statement if it absent; in case there are more than oneResourcewith the type equaled toowl:Ontology, it chooses the most bulky one (i.e. those that contains the largest number of associated statements) and all the others leave intact.- Returns:
OntIDan existing or freshResource, that is subject in the_:x rdf:type owl:Ontologystatement
-
createOntClass
Creates named class (owl-entity)- Parameters:
uri- IRI of class- Returns:
- named class
-
createDatatype
Creates named datatype (owl-entity), only for OWL2- Parameters:
uri- IRI of datarange- Returns:
- named datarange
-
createIndividual
Creates named individual (owl-entity), only for OWL2 ifowl:NamedIndividualis enabled.- Parameters:
uri- IRI of individual- Returns:
- named individual
-
createRDFProperty
Creates namedrdf:Property.- Parameters:
uri-<uri> a rdf:Property- Returns:
OntProperty
-
createAnnotationProperty
Creates annotation property (owl-entity).- Parameters:
uri- IRI of annotation property- Returns:
- annotation property
-
createDataProperty
Creates datatype property (owl-entity).- Parameters:
uri- IRI of datatype property- Returns:
- datatype property
-
createObjectProperty
Creates named object property (owl-entity).- Parameters:
uri- IRI of object property- Returns:
- named object property
-
createIndividual
Creates individual (named or anonymous) of the specified type.- Parameters:
uri- String, ornullfor anonymous individualtype-OntClass- Returns:
OntIndividual
-
getOntClass
-
getDatatype
-
getIndividual
-
getAnnotationProperty
-
getDataProperty
-
getObjectProperty
-
getOntClass
-
getDatatype
-
getIndividual
-
getAnnotationProperty
-
getDataProperty
-
getObjectProperty
-
localStatements
-
ontEntities
-
getDatatype
Retrieves adatatypefrom the given literal.- Parameters:
literal-Literal, notnull- Returns:
OntDataRange.Named
-
fetchOntEntity
Returns an entity of the given type and with the specified URI, creating it if needed.- Type Parameters:
E- any subtype ofOntEntity- Parameters:
type- a class-type of entityuri- String uri, notnull- Returns:
E
-
classes
Lists all named class expressions (OWL classes).- Returns:
StreamofOntology Classes
-
hierarchyRoots
Answers aStreamover the classes in this ontology model that represent the uppermost nodes of the class hierarchy. Built-ins are not included.- Returns:
- a
Streamof the rootclassesin the local class hierarchy
-
properties
Lists all OntProperties. The result includes not only OWL properties (Named and Inverse ObjectProperties, DatatypeProperties, AnnotationProperties), but also RDF-properties (<uri> rdf:type rdf:Property).For getting only OWL Properties, use
Stream.of(m.objectProperties(), m.dataProperties(), m.annotationProperties()).flatMap(it -> it). If you need all named properties, usethis.ontEntities(OntNamedProperty.class)Note that this method does not care about punnings: it will return property even if it has both
owl:ObjectPropertyandowl:DatatypePropertydeclarations and such punning is prohibited in the model settings.- Returns:
- distinct
StreamofOntPropertys
-
annotationProperties
Lists all annotation properties.- Returns:
StreamofAnnotation Propertys
-
dataProperties
Lists all data properties.- Returns:
StreamofData Propertys
-
objectProperties
Lists all named object property expressions (object properties in short).- Returns:
StreamofNamed Object Propertys
-
datatypes
Lists all datatypes (named data range expressions).- Returns:
StreamofOntology Datatypes
-
namedIndividuals
Lists all named individuals, i.e. all those individuals which have explicitlyowl:NamedIndividualdeclaration.- Returns:
StreamofNamed Individuals- See Also:
-
getOntEntity
ReturnsOWL Entitywith the specified class-type anduri.- Type Parameters:
E- anyOntEntitysubtype, notnull- Parameters:
type-Class, notnulluri-Resource, must be URI, notnull- Returns:
- a
Einstance
-
getRDFSComment
-
getRDFSLabel
-
getRDFSSeeAlso
-
getRDFSIsDefinedBy
-
getOWLDeprecated
-
getOWLVersionInfo
-
getOWLPriorVersion
-
getOWLBackwardCompatibleWith
-
getOWLIncompatibleWith
-
getOWLThing
-
getOWLNothing
-
getRDFSLiteral
-
getOWLTopObjectProperty
-
getOWLBottomObjectProperty
-
getOWLTopDataProperty
-
getOWLBottomDataProperty
-
add
- Specified by:
addin interfaceorg.apache.jena.rdf.model.Model
-
add
OntModel add(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) - Specified by:
addin interfaceorg.apache.jena.rdf.model.ModelCon
-
add
- Specified by:
addin interfaceorg.apache.jena.rdf.model.Model
-
add
- Specified by:
addin interfaceorg.apache.jena.rdf.model.Model
-
add
- Specified by:
addin interfaceorg.apache.jena.rdf.model.Model
-
add
- Specified by:
addin interfaceorg.apache.jena.rdf.model.Model
-
remove
- Specified by:
removein interfaceorg.apache.jena.rdf.model.Model
-
remove
OntModel remove(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) - Specified by:
removein interfaceorg.apache.jena.rdf.model.ModelCon
-
remove
- Specified by:
removein interfaceorg.apache.jena.rdf.model.ModelCon
-
remove
- Specified by:
removein interfaceorg.apache.jena.rdf.model.ModelCon
-
removeAll
OntModel removeAll(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) - Specified by:
removeAllin interfaceorg.apache.jena.rdf.model.Model
-
remove
- Specified by:
removein interfaceorg.apache.jena.rdf.model.Model
-
remove
- Specified by:
removein interfaceorg.apache.jena.rdf.model.Model
-
removeAll
OntModel removeAll()- Specified by:
removeAllin interfaceorg.apache.jena.rdf.model.Model
-
addLiteral
OntModel addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, boolean v) - Specified by:
addLiteralin interfaceorg.apache.jena.rdf.model.ModelCon
-
addLiteral
OntModel addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, long v) - Specified by:
addLiteralin interfaceorg.apache.jena.rdf.model.ModelCon
-
addLiteral
OntModel addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, int v) - Specified by:
addLiteralin interfaceorg.apache.jena.rdf.model.ModelCon
-
addLiteral
OntModel addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, char v) - Specified by:
addLiteralin interfaceorg.apache.jena.rdf.model.ModelCon
-
addLiteral
OntModel addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, float v) - Specified by:
addLiteralin interfaceorg.apache.jena.rdf.model.ModelCon
-
addLiteral
OntModel addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, double v) - Specified by:
addLiteralin interfaceorg.apache.jena.rdf.model.ModelCon
-
addLiteral
OntModel addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.Literal o) - Specified by:
addLiteralin interfaceorg.apache.jena.rdf.model.ModelCon
-
add
OntModel add(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, String lex) - Specified by:
addin interfaceorg.apache.jena.rdf.model.ModelCon
-
add
OntModel add(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, String lex, org.apache.jena.datatypes.RDFDatatype datatype) - Specified by:
addin interfaceorg.apache.jena.rdf.model.ModelCon
-
add
OntModel add(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, String lex, String lang) - Specified by:
addin interfaceorg.apache.jena.rdf.model.ModelCon
-
register
Registers a listener for model-changed events on this model. The methods on the listener will be called when API add/remove calls on the model succeed [in whole or in part]. The same listener may be registered many times; if so, its methods will be called as many times as it's registered for each event.- Specified by:
registerin interfaceorg.apache.jena.rdf.model.Model- Parameters:
listener-ModelChangedListener, not null- Returns:
- this model, for cascading
-
unregister
Unregisters a listener from model-changed events on this model. The listener is detached from the model. The model is returned to permit cascading. If the listener is not attached to the model, then nothing happens.- Specified by:
unregisterin interfaceorg.apache.jena.rdf.model.Model- Parameters:
listener-ModelChangedListener, not null
-
notifyEvent
Notifies any listeners that theeventhas occurred.- Specified by:
notifyEventin interfaceorg.apache.jena.rdf.model.Model- Parameters:
event- the event, which has occurred, e.g.GraphEvents#startRead- Returns:
- this model, for cascading
- See Also:
-
ModelChangedListenerGraphEvents
-
setNsPrefix
- Specified by:
setNsPrefixin interfaceorg.apache.jena.shared.PrefixMapping
-
removeNsPrefix
- Specified by:
removeNsPrefixin interfaceorg.apache.jena.shared.PrefixMapping
-
clearNsPrefixMap
OntModel clearNsPrefixMap()- Specified by:
clearNsPrefixMapin interfaceorg.apache.jena.shared.PrefixMapping
-
setNsPrefixes
- Specified by:
setNsPrefixesin interfaceorg.apache.jena.shared.PrefixMapping
-
lock
OntModel lock()- Specified by:
lockin interfaceorg.apache.jena.shared.PrefixMapping
-
read
- Specified by:
readin interfaceorg.apache.jena.rdf.model.Model
-
read
- Specified by:
readin interfaceorg.apache.jena.rdf.model.Model
-
read
- Specified by:
readin interfaceorg.apache.jena.rdf.model.Model
-
read
- Specified by:
readin interfaceorg.apache.jena.rdf.model.Model
-
read
- Specified by:
readin interfaceorg.apache.jena.rdf.model.Model
-
read
- Specified by:
readin interfaceorg.apache.jena.rdf.model.Model
-
read
- Specified by:
readin interfaceorg.apache.jena.rdf.model.Model
-
write
Deprecated.Writes a serialized representation of a model in a specified language. Note(1): this method is adapted for the ontology model to write out only the base model (which contains the asserted data). To write all triples, including imported data and inferred triples, usewriteAll. Note(2): it is often better to use anOutputStreamrather than aWriter, since this will avoid character encoding errors.The language in which to write the model is specified by the
langargument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". SeeLangfor all supported formats. The default value, represented bynull, is "RDF/XML".- Specified by:
writein interfaceorg.apache.jena.rdf.model.Model- Parameters:
writer- the output writer- Returns:
- this model
-
write
Writes a serialized representation of a model in a specified language. Note(1): this method is adapted for the ontology model to write out only the base model (which contains the asserted data). To write all triples, including imported data and inferred triples, usewriteAll. Note(2): it is often better to use anOutputStreamrather than aWriter, since this will avoid character encoding errors.The language in which to write the model is specified by the
langargument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". SeeLangfor all supported formats. The default value, represented bynull, is "RDF/XML".- Specified by:
writein interfaceorg.apache.jena.rdf.model.Model- Parameters:
writer- the output writerlang- the language in which the RDF should be written- Returns:
- this model
-
write
Writes a serialized representation of a model in a specified language. Note(1): this method is adapted for the ontology model to write out only the base model (which contains the asserted data). To write all triples, including imported data and inferred triples, usewriteAll. Note(2): it is often better to use anOutputStreamrather than aWriter, since this will avoid character encoding errors.The language in which to write the model is specified by the
langargument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". SeeLangfor all supported formats. The default value, represented bynull, is "RDF/XML".- Specified by:
writein interfaceorg.apache.jena.rdf.model.Model- Parameters:
writer- the output writerlang- the language in which the RDF should be writtenbase- the base URI for relative URI calculations;nullmeans use only absolute URI's.- Returns:
- this model
-
write
Writes a serialized representation of a model in a specified language. Note: this method is adapted for the ontology model to write out only the base model (which contains the asserted data). To write all triples, including imported data and inferred triples, usewriteAll.The language in which to write the model is specified by the
langargument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". SeeLangfor all supported formats. The default value, represented bynull, is "RDF/XML".- Specified by:
writein interfaceorg.apache.jena.rdf.model.Model- Parameters:
out- tre output stream to which the RDF is written- Returns:
- this model
-
write
Writes a serialized representation of a model in a specified language. Note: this method is adapted for the ontology model to write out only the base model (which contains the asserted data). To write all triples, including imported data and inferred triples, usewriteAll.The language in which to write the model is specified by the
langargument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". SeeLangfor all supported formats. The default value, represented bynull, is "RDF/XML".- Specified by:
writein interfaceorg.apache.jena.rdf.model.Model- Parameters:
out- tre output stream to which the RDF is writtenlang- the language in which the RDF should be written- Returns:
- this model
-
write
Writes a serialized representation of a model in a specified language. Note: this method is adapted for the ontology model to write out only the base model (which contains the asserted data). To write all triples, including imported data and inferred triples, usewriteAll.The language in which to write the model is specified by the
langargument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". SeeLangfor all supported formats. The default value, represented bynull, is "RDF/XML".- Specified by:
writein interfaceorg.apache.jena.rdf.model.Model- Parameters:
out- tre output stream to which the RDF is writtenlang- the language in which the RDF should be writtenbase- the base URI for relative URI calculations;nullmeans use only absolute URI's.- Returns:
- this model
-
writeAll
Writes a serialized representation of all the model's contents, including inferred statements and statements imported from other documents. To write only the data asserted in the base model, usewrite. Note: it is often better to use anOutputStreamrather than aWriter, since this will avoid character encoding errors.The language in which to write the model is specified by the
langargument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". SeeLangfor all supported formats. The default value, represented bynull, is "RDF/XML".- Parameters:
writer- the output writerlang- the language in which the RDF should be writtenbase- the base URI for relative URI calculations;nullmeans use only absolute URI's.- Returns:
- this model
-
writeAll
Writes a serialized representation of all the model's contents, including inferred statements and statements imported from other documents. To write only the data asserted in the base model, usewrite. Note: it is often better to use anOutputStreamrather than aWriter, since this will avoid character encoding errors.The language in which to write the model is specified by the
langargument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". SeeLangfor all supported formats. The default value, represented bynull, is "RDF/XML".- Parameters:
writer- the output writerlang- the language in which the RDF should be written- Returns:
- this model
-
writeAll
Writes a serialized representation of all the model's contents, including inferred statements and statements imported from other documents. To write only the data asserted in the base model, usewrite.The language in which to write the model is specified by the
langargument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". SeeLangfor all supported formats. The default value, represented bynull, is "RDF/XML".- Parameters:
out- tre output stream to which the RDF is writtenlang- the language in which the RDF should be writtenbase- the base URI for relative URI calculations;nullmeans use only absolute URI's.- Returns:
- this model
-
writeAll
Writes a serialized representation of all the model's contents, including inferred statements and statements imported from other documents. To write only the data asserted in the base model, usewrite.The language in which to write the model is specified by the
langargument. Some of the supported formats are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE". SeeLangfor all supported formats. The default value, represented bynull, is "RDF/XML".- Parameters:
out- tre output stream to which the RDF is writtenlang- the language in which the RDF should be written- Returns:
- this model
-
createObjectSomeValuesFrom
Creates an Existential Quantification Object Property Restriction. The RDF structure:_:x rdf:type owl:Restriction . _:x owl:onProperty P . _:x owl:someValuesFrom C .- Parameters:
property-object property expression, notnullce-class expression, notnull- Returns:
OntClass.ObjectSomeValuesFrom- See Also:
-
createDataSomeValuesFrom
Creates an Existential Quantification Data Property Restriction. The RDF structure:_:x rdf:type owl:Restriction . _:x owl:onProperty R . _:x owl:someValuesFrom D .- Parameters:
property-data property, notnulldr-data range, notnull- Returns:
OntClass.DataSomeValuesFrom- See Also:
-
createObjectAllValuesFrom
Creates a Universal Quantification Object Property Restriction. The RDF structure:_:x rdf:type owl:Restriction . _:x owl:onProperty P . _:x owl:allValuesFrom C .- Parameters:
property-object property expression, notnullce-class expression, notnull- Returns:
OntClass.ObjectAllValuesFrom- See Also:
-
createDataAllValuesFrom
Creates a Universal Quantification Data Property Restriction. The RDF structure:_:x rdf:type owl:Restriction . _:x owl:onProperty R . _:x owl:allValuesFrom D .- Parameters:
property-data property, notnulldr-data range, notnull- Returns:
OntClass.DataAllValuesFrom- See Also:
-
createObjectHasValue
Creates an Individual Value Restriction. The RDF structure:_:x rdf:type owl:Restriction . _:x owl:onProperty P . _:x owl:hasValue a .- Parameters:
property-object property expression, notnullindividual-OntIndividual, notnull- Returns:
OntClass.ObjectHasValue- See Also:
-
createDataHasValue
OntClass.DataHasValue createDataHasValue(OntDataProperty property, org.apache.jena.rdf.model.Literal literal) Creates a Literal Value Restriction. The RDF structure:_:x rdf:type owl:Restriction . _:x owl:onProperty R . _:x owl:hasValue v .- Parameters:
property-data property, notnullliteral-Literal, notnull- Returns:
OntClass.DataHasValue- See Also:
-
createObjectMinCardinality
OntClass.ObjectMinCardinality createObjectMinCardinality(OntObjectProperty property, int cardinality, OntClass ce) Creates an Object Minimum Cardinality Restriction, possible Qualified. Ifceisnull, it is taken to beowl:Thing. In that case the return restriction is unqualified. The RDF structure:
or_:x rdf:type owl:Restriction . _:x owl:onProperty P . _:x owl:minCardinality n ._:x rdf:type owl:Restriction . _:x owl:onProperty P . _:x owl:minQualifiedCardinality n . _:x owl:onClass C .- Parameters:
property-object property expression, notnullcardinality-int, non-negative numberce-class expressionornull- Returns:
OntClass.ObjectMinCardinality- See Also:
-
createDataMinCardinality
OntClass.DataMinCardinality createDataMinCardinality(OntDataProperty property, int cardinality, OntDataRange dr) Creates a Data Minimum Cardinality Restriction, possible Qualified. Ifdrisnull, it is taken to berdfs:Literal. The RDF structure:
or_:x rdf:type owl:Restriction . _:x owl:onProperty R . _:x owl:minCardinality n ._:x rdf:type owl:Restriction . _:x owl:onProperty R . _:x owl:minQualifiedCardinality n . _:x owl:onDataRange D .- Parameters:
property-data property, notnullcardinality-int, non-negative numberdr-data rangeornull- Returns:
OntClass.DataMinCardinality- See Also:
-
createObjectMaxCardinality
OntClass.ObjectMaxCardinality createObjectMaxCardinality(OntObjectProperty property, int cardinality, OntClass ce) Creates an Object Maximum Cardinality Restriction, possible Qualified. Ifceisnull, it is taken to beowl:Thing. In that case the return restriction is unqualified. The RDF structure:
or_:x rdf:type owl:Restriction . _:x owl:onProperty P . _:x owl:maxCardinality n ._:x rdf:type owl:Restriction . _:x owl:onProperty P . _:x owl:maxQualifiedCardinality n . _:x owl:onClass C .- Parameters:
property-object property expression, notnullcardinality-int, non-negative numberce-class expressionornull- Returns:
OntClass.ObjectMaxCardinality- See Also:
-
createDataMaxCardinality
OntClass.DataMaxCardinality createDataMaxCardinality(OntDataProperty property, int cardinality, OntDataRange dr) Creates a Data Maximum Cardinality Restriction, possible Qualified. Ifdrisnull, it is taken to berdfs:Literal. The RDF structure:
or_:x rdf:type owl:Restriction . _:x owl:onProperty R . _:x owl:maxCardinality n ._:x rdf:type owl:Restriction . _:x owl:onProperty R . _:x owl:maxQualifiedCardinality n . _:x owl:onDataRange D .- Parameters:
property-data property, notnullcardinality-int, non-negative numberdr-data rangeornull- Returns:
OntClass.DataMaxCardinality- See Also:
-
createObjectCardinality
OntClass.ObjectCardinality createObjectCardinality(OntObjectProperty property, int cardinality, OntClass ce) Creates an Object Exact Cardinality Restriction, possible Qualified. Ifceisnull, it is taken to beowl:Thing. In that case the return restriction is unqualified. The RDF structure:
or_:x rdf:type owl:Restriction . _:x owl:onProperty P . _:x owl:cardinality n ._:x rdf:type owl:Restriction . _:x owl:onProperty P . _:x owl:qualifiedCardinality n . _:x owl:onClass C .- Parameters:
property-object property expression, notnullcardinality-int, non-negative numberce-class expressionornull- Returns:
OntClass.ObjectCardinality- See Also:
-
createDataCardinality
OntClass.DataCardinality createDataCardinality(OntDataProperty property, int cardinality, OntDataRange dr) Creates a Data Exact Cardinality Restriction, possible Qualified. Ifdrisnull, it is taken to berdfs:Literal. The RDF structure:
or_:x rdf:type owl:Restriction . _:x owl:onProperty R . _:x owl:cardinality n ._:x rdf:type owl:Restriction . _:x owl:onProperty R . _:x owl:qualifiedCardinality n . _:x owl:onDataRange D .- Parameters:
property-data property, notnullcardinality-int, non-negative numberdr-data rangeornull- Returns:
OntClass.DataCardinality- See Also:
-
createHasSelf
Creates a Local Reflexivity Class Expression (Self-Restriction). The RDF structure:_:x rdf:type owl:Restriction . _:x owl:onProperty P . _:x owl:hasSelf "true"^^xsd:boolean .- Parameters:
property-object property expression, notnull- Returns:
OntClass.HasSelf- See Also:
-
createObjectUnionOf
Creates a Union of Class Expressions. The RDF structure:_:x rdf:type owl:Class . _:x owl:unionOf ( C1 ... Cn ) .- Parameters:
classes-Collectionofclass expressions withoutnulls- Returns:
OntClass.UnionOf- See Also:
-
createObjectIntersectionOf
Creates an Intersection of Class Expressions. The RDF structure:_:x rdf:type owl:Class . _:x owl:intersectionOf ( C1 ... Cn ) .- Parameters:
classes-Collectionofclass expressions withoutnulls- Returns:
OntClass.IntersectionOf- See Also:
-
createObjectOneOf
Creates an Enumeration of Individuals. The RDF structure:_:x rdf:type owl:Class . _:x owl:oneOf ( a1 ... an ).- Parameters:
individuals-Collectionofindividuals withoutnulls- Returns:
OntClass.OneOf- See Also:
-
createObjectComplementOf
Create a Complement of Class Expressions. The RDF structure:_:x rdf:type owl:Class . _:x owl:complementOf C .- Parameters:
ce-class expressionornull- Returns:
OntClass.ComplementOf- See Also:
-
createDataAllValuesFrom
OntClass.NaryDataAllValuesFrom createDataAllValuesFrom(Collection<OntDataProperty> properties, OntDataRange dr) Creates an N-Ary Data Universal Quantification N-Ary Restriction. Note: currently a Unary Restriction is preferable since in OWL2 data-range arity is always1. The RDF structure:_:x rdf:type owl:Restriction . _:x owl:onProperties ( R1 ... Rn ) . _:x owl:allValuesFrom Dn .- Parameters:
properties-Collectionofdata ranges withoutnullsdr-data range, notnull- Returns:
OntClass.NaryDataAllValuesFrom- See Also:
-
createDataSomeValuesFrom
OntClass.NaryDataSomeValuesFrom createDataSomeValuesFrom(Collection<OntDataProperty> properties, OntDataRange dr) Creates an N-Ary Data Existential Quantification N-Ary Restriction. Note: currently a Unary Restriction is preferable since in OWL2 data-range arity is always1. The RDF structure:_:x rdf:type owl:Restriction . _:x owl:onProperties ( R1 ... Rn ) . _:x owl:someValuesFrom Dn .- Parameters:
properties-Collectionofdata ranges withoutnullsdr-data range, notnull- Returns:
OntClass.NaryDataAllValuesFrom- See Also:
-
createObjectIntersectionOf
Creates an Intersection of Class Expressions.- Parameters:
classes- Array ofclass expressions withoutnulls- Returns:
OntClass.IntersectionOf- See Also:
-
createObjectUnionOf
Creates a Union of Class Expressions.- Parameters:
classes- Array ofclass expressions withoutnulls- Returns:
OntClass.UnionOf- See Also:
-
createObjectOneOf
Creates an Enumeration of Individuals.- Parameters:
individuals- Array ofindividuals withoutnulls- Returns:
OntClass.OneOf- See Also:
-
createDataOneOf
Creates an Enumeration of Literals. RDF (turtle) syntax:_:x rdf:type rdfs:Datatype . _:x owl:oneOf ( v1 ... vn ) .- Parameters:
values-Collectionofliterals, withoutnulls- Returns:
OntDataRange.OneOf- See Also:
-
createDataRestriction
OntDataRange.Restriction createDataRestriction(OntDataRange.Named other, Collection<OntFacetRestriction> values) Creates a Datatype Restriction. RDF (turtle) syntax:_:x rdf:type rdfs:Datatype . _:x owl:onDatatype DN . _:x owl:withRestrictions ( _:x1 ... _:xn ) . _:xj fj vj .- Parameters:
other-OntDataRange.Named, notnullvalues-Collectionoffacet restrictions, withoutnulls- Returns:
OntDataRange.Restriction- See Also:
-
createDataComplementOf
Creates a Complement of Data Ranges. RDF (turtle) syntax:_:x rdf:type rdfs:Datatype . _:x owl:datatypeComplementOf D .- Parameters:
other-OntDataRange, notnull- Returns:
OntDataRange.ComplementOf- See Also:
-
createDataUnionOf
Creates a Union of Data Ranges. RDF (turtle) syntax:_:x rdf:type rdfs:Datatype . _:x owl:unionOf ( D1 ... Dn ) .- Parameters:
values-Collectionofdata ranges, withoutnulls- Returns:
OntDataRange.UnionOf- See Also:
-
createDataIntersectionOf
Creates an Intersection of Data Ranges. RDF (turtle) syntax:_:x rdf:type rdfs:Datatype . _:x owl:intersectionOf ( D1 ... Dn ) .- Parameters:
values-Collectionofdata ranges, withoutnulls- Returns:
OntDataRange.IntersectionOf- See Also:
-
createDataOneOf
Creates an Enumeration of Literals.- Parameters:
values- Array ofliterals, withoutnull-elements- Returns:
OntDataRange.OneOf- See Also:
-
createDataRestriction
default OntDataRange.Restriction createDataRestriction(OntDataRange.Named other, OntFacetRestriction... values) Creates a Datatype Restriction.- Parameters:
other-Named Data Range, notnullvalues- Array offacet restrictions, withoutnulls- Returns:
OntDataRange.Restriction- See Also:
-
createDataUnionOf
Creates a Union of Data Ranges.- Parameters:
values-Collectionofdata ranges, withoutnull-elements- Returns:
OntDataRange.UnionOf- See Also:
-
createDataIntersectionOf
Creates an Intersection of Data Ranges.- Parameters:
values- Array ofdata ranges, withoutnull-elements- Returns:
OntDataRange.IntersectionOf- See Also:
-
createDisjointClasses
Creates a Disjoint Classes Axiom Resource. The RDF structure:_:x rdf:type owl:AllDisjointClasses . _:x owl:members ( C1 ... Cn ) .- Parameters:
classes-CollectionofClass Expressions withoutnull-elements- Returns:
OntDisjoint.Classes- See Also:
-
createDifferentIndividuals
Creates a Different Individuals Axiom Resource. The RDF structure:
Note: instead of_:x rdf:type owl:AllDifferent . _:x owl:members ( a1 ... an ).owl:members, alternatively, the predicateowl:distinctMemberscan be used.- Parameters:
individuals-CollectionofIndividuals withoutnull-elements- Returns:
OntDisjoint.Individuals- See Also:
-
createDisjointObjectProperties
OntDisjoint.ObjectProperties createDisjointObjectProperties(Collection<OntObjectProperty> properties) Creates a Disjoint Object Properties Axiom Resource. The RDF structure:_:x rdf:type owl:AllDisjointProperties . _:x owl:members ( P1 ... Pn ) .- Parameters:
properties-Collectionofobject property expressions withoutnull-elements- Returns:
OntDisjoint.ObjectProperties- See Also:
-
createDisjointDataProperties
Creates a Disjoint Data Properties Axiom Resource. The RDF structure:_:x rdf:type owl:AllDisjointProperties . _:x owl:members ( R1 ... Rn ) .- Parameters:
properties-Collectionofdata propertieswithoutnull-elements- Returns:
OntDisjoint.DataProperties- See Also:
-
createDisjointClasses
Creates a Disjoint Classes Axiom Resource.- Parameters:
classes- Array ofClass Expressions withoutnull-elements- Returns:
OntDisjoint.Classes- See Also:
-
createDifferentIndividuals
Creates a Different Individuals Axiom Resource.- Parameters:
individuals- Array ofindividuals withoutnull-elements- Returns:
OntDisjoint.Individuals- See Also:
-
createDisjointObjectProperties
default OntDisjoint.ObjectProperties createDisjointObjectProperties(OntObjectProperty... properties) Creates a Disjoint Object Properties Axiom Resource.- Parameters:
properties- Array ofObject Property Expressions withoutnull-elements- Returns:
OntDisjoint.ObjectProperties- See Also:
-
createDisjointDataProperties
Creates a Disjoint Data Properties Axiom Resource.- Parameters:
properties- Array ofData Propertieswithoutnull-elements- Returns:
OntDisjoint.DataProperties- See Also:
-
createSWRLVariable
Creates a SWRL Variable, that is a URI resource with a typeswrl:Variable.- Parameters:
uri- String, notnull- Returns:
OntSWRL.Variable
-
createBuiltInSWRLAtom
OntSWRL.Atom.WithBuiltin createBuiltInSWRLAtom(org.apache.jena.rdf.model.Resource predicate, Collection<OntSWRL.DArg> arguments) Creates a BuiltIn Atom. An input predicate can be taken fromSWRL Builins Vocabulary. Turtle syntax:_:x rdf:type swrl:BuiltinAtom . _:x swrl:arguments ( d1 ... d2 ) . _:x swrl:builtin U .- Parameters:
predicate- an URI,Resource, notnullarguments-CollectionofOntSWRL.DArgs- Returns:
OntSWRL.Atom.WithBuiltin- See Also:
-
SWRLB
-
createClassSWRLAtom
Creates a Class Atom. Turtle syntax:_:x rdf:type swrl:ClassAtom . _:x swrl:argument1 i . _:x swrl:classPredicate C .- Parameters:
clazz-OntClass, notnullarg-OntSWRL.IArg(eitherOntIndividualorOntSWRL.Variable), notnull- Returns:
OntSWRL.Atom.WithClass
-
createDataRangeSWRLAtom
Creates a Data Range Atom. Turtle syntax:_:x rdf:type swrl:DataRangeAtom . _:x swrl:argument1 d . _:x swrl:dataRange D .- Parameters:
range-OntDataRange, notnullarg-OntSWRL.DArg(eitherOntSWRL.VariableorLiteral), notnull- Returns:
OntSWRL.Atom.WithDataRange
-
createDataPropertySWRLAtom
OntSWRL.Atom.WithDataProperty createDataPropertySWRLAtom(OntDataProperty property, OntSWRL.IArg first, OntSWRL.DArg second) Creates a Data Property Atom. Turtle syntax:_:x rdf:type swrl:DatavaluedPropertyAtom . _:x swrl:argument1 i . _:x swrl:argument2 d . _:x swrl:propertyPredicate R .- Parameters:
property-OntDataProperty, notnullfirst-OntSWRL.IArg(eitherOntIndividualorOntSWRL.Variable), notnullsecond-OntSWRL.DArg(eitherOntSWRL.VariableorLiteral), notnull- Returns:
OntSWRL.Atom.WithDataProperty
-
createObjectPropertySWRLAtom
OntSWRL.Atom.WithObjectProperty createObjectPropertySWRLAtom(OntObjectProperty property, OntSWRL.IArg first, OntSWRL.IArg second) Creates an Object Property Atom. Turtle syntax:_:x rdf:type swrl:IndividualPropertyAtom . _:x swrl:argument1 i1 . _:x swrl:argument2 i2 . _:x swrl:propertyPredicate P .- Parameters:
property-OntObjectProperty, notnullfirst-OntSWRL.IArg(eitherOntIndividualorOntSWRL.Variable), notnullsecond-OntSWRL.IArg(eitherOntIndividualorOntSWRL.Variable), notnull- Returns:
OntSWRL.Atom.WithObjectProperty
-
createDifferentIndividualsSWRLAtom
OntSWRL.Atom.WithDifferentIndividuals createDifferentIndividualsSWRLAtom(OntSWRL.IArg first, OntSWRL.IArg second) Creates a Different Individuals Atom. Turtle syntax:_:x rdf:type swrl:DifferentIndividualsAtom . _:x swrl:argument1 i1 . _:x swrl:argument2 i2 .- Parameters:
first-OntSWRL.IArg(eitherOntIndividualorOntSWRL.Variable), notnullsecond-OntSWRL.IArg(eitherOntIndividualorOntSWRL.Variable), notnull- Returns:
OntSWRL.Atom.WithDifferentIndividuals
-
createSameIndividualsSWRLAtom
OntSWRL.Atom.WithSameIndividuals createSameIndividualsSWRLAtom(OntSWRL.IArg first, OntSWRL.IArg second) Creates a Same Individuals Atom. Turtle syntax:_:x rdf:type swrl:SameIndividualAtom . _:x swrl:argument1 i1 . _:x swrl:argument2 i2 .- Parameters:
first-OntSWRL.IArg(eitherOntIndividualorOntSWRL.Variable), notnullsecond-OntSWRL.IArg(eitherOntIndividualorOntSWRL.Variable), notnull- Returns:
OntSWRL.Atom.WithSameIndividuals
-
createSWRLImp
Creates a SWRL Rule. A rule consists of a head and a body. Both the head and the body consist of a conjunction of Atoms. In RDF, instead of a regular []-list, a typed version of []-lis is used, whererdf:typeisswrl:AtomList. Turtle syntax:_:x rdf:type swrl:Impl . _:x swrl:body (swrl:AtomList: A1 ... An ) . _:x swrl:head (swrl:AtomList: A1 ... Am ) .- Parameters:
head-CollectionofOntSWRL.Atomsbody-CollectionofOntSWRL.Atoms- Returns:
OntSWRL.Imp
-