- All Implemented Interfaces:
OntEnhGraph
,OntModel
,org.apache.jena.rdf.model.InfModel
,org.apache.jena.rdf.model.Model
,org.apache.jena.rdf.model.ModelCon
,org.apache.jena.rdf.model.ModelGraphInterface
,org.apache.jena.rdf.model.RDFReaderF
,org.apache.jena.rdf.model.RDFWriterF
,org.apache.jena.shared.Lock
,org.apache.jena.shared.PrefixMapping
OntPersonality
is responsible for the configuration of the model.
Also see OntModelControls
- a set of settings,
that can be accessed through OntPersonality.getConfig()
.- See Also:
-
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, WRITE
Fields inherited from interface org.apache.jena.shared.PrefixMapping
Extended, Standard
-
Constructor Summary
ConstructorDescriptionOntGraphModelImpl
(UnionGraph graph, OntPersonality personality) OntGraphModelImpl
(org.apache.jena.reasoner.InfGraph graph, OntPersonality personality) -
Method Summary
Modifier and TypeMethodDescriptionadd
(org.apache.jena.rdf.model.Model data) 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 iter) Adds a sub-model both to theowl:import
section 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) ambiguousEntities
(boolean withImports) Gets 'punnings', i.e. theOntEntity
s which have not only a single type.org.apache.jena.rdf.model.InfModel
Returns a view of this model that supports inference, if possible.<E extends org.apache.jena.rdf.model.RDFNode>
OntListImpl<E>asOntList
(org.apache.jena.rdf.model.RDFList list, OntObject subject, org.apache.jena.rdf.model.Property predicate, boolean checkRecursions, org.apache.jena.rdf.model.Resource listType, Class<E> elementType) Wraps the existing given[]-list
asONT-list
.<E extends org.apache.jena.rdf.model.RDFNode>
OntListImpl<E>asOntList
(org.apache.jena.rdf.model.RDFList list, OntObject subject, org.apache.jena.rdf.model.Property predicate, Class<E> type) Wraps the existing given[]-list
asONT-list
.asStatement
(org.apache.jena.graph.Triple triple) Answers anOntology Statement
in this model who's SPO is that of thetriple
.static void
checkFeature
(OntModel m, OntModelControls setting, String featureName) static boolean
configValue
(OntModel m, OntModelControls setting) boolean
containsLocal
(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) Determines if the given(s, p, o)
pattern is present in the base graph, withnull
allowed to represent a wildcard match.createBuiltInSWRLAtom
(org.apache.jena.rdf.model.Resource predicate, Collection<OntSWRL.DArg> arguments) createClassSWRLAtom
(OntClass clazz, OntSWRL.IArg arg) createDataAllValuesFrom
(Collection<OntDataProperty> properties, OntDataRange dr) createDataAllValuesFrom
(OntDataProperty property, OntDataRange dr) createDataCardinality
(OntDataProperty property, int cardinality, OntDataRange dr) createDataHasValue
(OntDataProperty property, org.apache.jena.rdf.model.Literal literal) default OntDataRange.IntersectionOf
createDataIntersectionOf
(OntDataRange... values) Creates an Intersection of Data Ranges.createDataMaxCardinality
(OntDataProperty property, int cardinality, OntDataRange dr) createDataMinCardinality
(OntDataProperty property, int cardinality, OntDataRange dr) createDataOneOf
(Collection<org.apache.jena.rdf.model.Literal> values) default OntDataRange.OneOf
createDataOneOf
(org.apache.jena.rdf.model.Literal... values) Creates an Enumeration of Literals.createDataPropertySWRLAtom
(OntDataProperty dataProperty, OntSWRL.IArg firstArg, OntSWRL.DArg secondArg) createDataRangeSWRLAtom
(OntDataRange range, OntSWRL.DArg arg) createDataRestriction
(OntDataRange.Named datatype, Collection<OntFacetRestriction> values) default OntDataRange.Restriction
createDataRestriction
(OntDataRange.Named other, OntFacetRestriction... values) Creates a Datatype Restriction.createDataSomeValuesFrom
(Collection<OntDataProperty> properties, OntDataRange dr) createDataSomeValuesFrom
(OntDataProperty property, OntDataRange dr) createDataUnionOf
(Collection<OntDataRange> values) default OntDataRange.UnionOf
createDataUnionOf
(OntDataRange... values) Creates a Union of Data Ranges.createDifferentIndividuals
(Collection<OntIndividual> individuals) default OntDisjoint.Individuals
createDifferentIndividuals
(OntIndividual... individuals) Creates a Different Individuals Axiom Resource.createDifferentIndividualsSWRLAtom
(OntSWRL.IArg firstArg, OntSWRL.IArg secondArg) createDisjointClasses
(Collection<OntClass> classes) default OntDisjoint.Classes
createDisjointClasses
(OntClass... classes) Creates a Disjoint Classes Axiom Resource.createDisjointDataProperties
(Collection<OntDataProperty> properties) default OntDisjoint.DataProperties
createDisjointDataProperties
(OntDataProperty... properties) Creates a Disjoint Data Properties Axiom Resource.createDisjointObjectProperties
(Collection<OntObjectProperty> properties) default OntDisjoint.ObjectProperties
createDisjointObjectProperties
(OntObjectProperty... properties) Creates a Disjoint Object Properties Axiom Resource.<T extends OntFacetRestriction>
TcreateFacetRestriction
(Class<T> view, org.apache.jena.rdf.model.Literal literal) Creates a facet restriction by the given type and literal value.createHasSelf
(OntObjectProperty property) createIndividual
(String uri, OntClass type) Creates individual (named or anonymous) of the specified type.createObjectAllValuesFrom
(OntObjectProperty property, OntClass ce) createObjectCardinality
(OntObjectProperty property, int cardinality, OntClass ce) createObjectHasValue
(OntObjectProperty property, OntIndividual individual) createObjectIntersectionOf
(Collection<OntClass> classes) default OntClass.IntersectionOf
createObjectIntersectionOf
(OntClass... classes) Creates an Intersection of Class Expressions.createObjectMaxCardinality
(OntObjectProperty property, int cardinality, OntClass ce) createObjectMinCardinality
(OntObjectProperty property, int cardinality, OntClass ce) createObjectOneOf
(Collection<OntIndividual> individuals) default OntClass.OneOf
createObjectOneOf
(OntIndividual... individuals) Creates an Enumeration of Individuals.createObjectPropertySWRLAtom
(OntObjectProperty dataProperty, OntSWRL.IArg firstArg, OntSWRL.IArg secondArg) createObjectSomeValuesFrom
(OntObjectProperty property, OntClass ce) createObjectUnionOf
(Collection<OntClass> classes) default OntClass.UnionOf
createObjectUnionOf
(OntClass... classes) Creates a Union of Class Expressions.<T extends OntEntity>
TcreateOntEntity
(Class<T> type, String iri) Creates an owl-entity by thetype
andiri
.<E extends org.apache.jena.rdf.model.RDFNode>
OntListImpl<E>createOntList
(OntObject subject, org.apache.jena.rdf.model.Property predicate, Class<E> type, Iterator<E> elements) Creates ONT-List with given elements and other settings.<E extends org.apache.jena.rdf.model.RDFNode>
OntListImpl<E>createOntList
(OntObject subject, org.apache.jena.rdf.model.Property predicate, org.apache.jena.rdf.model.Resource listType, Class<E> elementType, Iterator<E> elements) Creates ONT-List with given elements and other settings.<T extends OntObject>
TcreateOntObject
(Class<T> type, String uri) Creates and caches an ontology object resource by the given type and uri.createSameIndividualsSWRLAtom
(OntSWRL.IArg firstArg, OntSWRL.IArg secondArg) createStatement
(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) createSWRLImp
(Collection<OntSWRL.Atom<?>> head, Collection<OntSWRL.Atom<?>> body) createSWRLVariable
(String uri) deleteOntList
(OntObject subject, org.apache.jena.rdf.model.Property predicate, OntList<?> object) Deletes the specifiedOntList
including its annotations.<N extends org.apache.jena.rdf.model.RDFNode>
NfindNodeAs
(org.apache.jena.graph.Node node, Class<N> type) Returns aRDFNode
for the given type and, if the result is present, caches it node at the model level.org.apache.jena.graph.Graph
Returns the baseGraph
, i.e., the primary ontologicalGraph
that does not contain any subgraph hierarchy.org.apache.jena.rdf.model.Model
Returns thestandard jena model
that corresponds to thebase graph
.org.apache.jena.rdf.model.Model
Returns a derivations model.Iterator<org.apache.jena.reasoner.Derivation>
getDerivation
(org.apache.jena.rdf.model.Statement statement) Returns the derivation of the given statement (which should be the result of some previous list operation).getID()
Gets the Ontology ID object.org.apache.jena.reasoner.InfGraph
ReturnsInfGraph
ornull
if no-inf model<N extends org.apache.jena.rdf.model.RDFNode>
NAnswers an enhanced node that wraps the given node and conforms to the given interface type.<E extends OntEntity>
EgetOntEntity
(Class<E> type, String uri) Returns an ont-entity for the specified type and uri.Returns the model personality, that is unmodifiable model's configuration storage.org.apache.jena.shared.PrefixMapping
org.apache.jena.rdf.model.Model
Returns the raw RDF model being processed (i.e. the argument to theReasoner.bind(Graph)
call that created thisInfModel
).org.apache.jena.datatypes.RDFDatatype
getRDFDatatype
(String uri) org.apache.jena.reasoner.Reasoner
Returns theReasoner
which is being used to answer queries to this graph ornull
if reasoner is not supported by the model.Gets the top-levelOntology Graph Model impl
.ReturnsUnionGraph
.boolean
Answerstrue
if the model has a graph with the given uri both inowl:imports
and graph-hierarchy.boolean
Answerstrue
if the given model is present in theowl:imports
of this model.Answers aStream
over 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:import
reference inside the base graph.imports
(OntPersonality personality) Lists all top-level sub-models built with the givenpersonality
.boolean
Determines whether this model is independent.Lists all class-asserted individuals.<E extends OntObjectImpl & OntEntity>
booleanisBuiltIn
(E e) Answerstrue
if the given entity is built-in.org.apache.jena.util.iterator.ExtendedIterator<org.apache.jena.rdf.model.Resource>
listAnnotations
(org.apache.jena.rdf.model.Resource t, org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) Lists all (bulk) annotation anonymous resources for the givenrdf:type
and SPO.org.apache.jena.util.iterator.ExtendedIterator<OntClass>
final org.apache.jena.util.iterator.ExtendedIterator<OntGraphModelImpl>
listImportModels
(OntPersonality personality, org.apache.jena.reasoner.Reasoner reasoner) Listsmodel impl
s with the specifiedpersonality
from the top tier of the imports' hierarchy.org.apache.jena.util.iterator.ExtendedIterator<OntIndividual>
Returns anExtendedIterator
over all individuals that participate in class assertion statementa rdf:type C
.static <M extends OntModel & OntEnhGraph>
org.apache.jena.util.iterator.ExtendedIterator<OntIndividual>listIndividuals
(M model, Set<String> reserved, org.apache.jena.util.iterator.ExtendedIterator<org.apache.jena.graph.Triple> assertions) FiltersOntIndividual
s from the specifiedExtendedIterator
.org.apache.jena.util.iterator.ExtendedIterator<OntEntity>
The same aslistOntEntities()
but for the base graph.<O extends OntObject>
org.apache.jena.util.iterator.ExtendedIterator<O>listLocalOntObjects
(Class<? extends O> type) The same aslistOntObjects(Class)
, but for the base graph.org.apache.jena.util.iterator.ExtendedIterator<OntStatement>
listLocalStatements
(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) Lists all statements in the base model that match a pattern in the form ofExtended Iterator
.org.apache.jena.util.iterator.ExtendedIterator<OntEntity>
Lists all Ontology Entities.<O extends OntObject>
org.apache.jena.util.iterator.ExtendedIterator<O>listOntObjects
(Class<? extends O> type) Lists allOntology Object
s and caches them inside this model.static <M extends org.apache.jena.enhanced.EnhGraph & OntEnhGraph,
O extends OntObject>
org.apache.jena.util.iterator.ExtendedIterator<O>listOntObjects
(M m, Class<? extends O> type) Lists allOntObject
s for the givenOntGraphModelImpl
.org.apache.jena.util.iterator.ExtendedIterator<OntStatement>
listOntStatements
(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) Returns anextended iterator
over all the statements in the model that match a pattern.org.apache.jena.rdf.model.StmtIterator
listStatements
(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) org.apache.jena.rdf.model.StmtIterator
listStatements
(org.apache.jena.rdf.model.Resource subject, org.apache.jena.rdf.model.Property predicate, org.apache.jena.rdf.model.RDFNode object, org.apache.jena.rdf.model.Model posit) Finds all the statements matching a pattern.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 graph
for the specified subject, predicate and object.lock()
notifyEvent
(Object event) Lists all entities declared in the model.ontObjects
(Class<? extends O> type) Retrieves the stream ofOntology Object
s.void
prepare()
Performs any initial processing and caching.read
(InputStream reader, String base) read
(InputStream reader, String base, String lang) void
rebind()
Causes the inference model to reconsult the underlying data to take into account changes.register
(org.apache.jena.rdf.model.ModelChangedListener listener) remove
(org.apache.jena.rdf.model.Model data) 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 iter) 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:import
declaration and the corresponding graph) by the given uri if it is found.Removes a sub-model fromowl:import
and from the graph hierarchy.removeNsPrefix
(String prefix) removeOntObject
(OntObject obj) Removes the givenOntology Object
from the graph-model including itscontent
and annotations.removeOntStatement
(OntStatement statement) Removes the statement from the graph-model including its annotations with sub-annotations hierarchy.void
reset()
Resets any internal caches.<N extends org.apache.jena.rdf.model.RDFNode>
NsafeFindNodeAs
(org.apache.jena.graph.Node node, Class<N> type) Answers an enhanced node that wraps the given node and conforms to the given interface type, taking into account possible graph recursions.void
setDerivationLogging
(boolean logOn) Switches on/off derivation logging.Creates a new@uri rdf:type owl:Ontology
statement for the specifieduri
and wraps it as Ontology ID Resource.setNsPrefix
(String prefix, String uri) setNsPrefixes
(Map<String, String> map) setNsPrefixes
(org.apache.jena.shared.PrefixMapping pm) 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) org.apache.jena.reasoner.ValidityReport
validate()
Tests the consistency of the underlying data.withDefaultMappings
(org.apache.jena.shared.PrefixMapping other) write
(OutputStream out) write
(OutputStream out, String lang) write
(OutputStream out, String lang, String base) writeAll
(OutputStream out, String lang) writeAll
(OutputStream out, String lang, String base) Methods inherited from class org.apache.jena.rdf.model.impl.ModelCom
abort, adapt, addNamespaces, asModel, asNode, asRDFNode, asStatements, asStatements, asStatements, begin, calculateInTxn, close, commit, contains, contains, contains, contains, contains, containsAll, containsAll, containsAny, containsAny, containsLiteral, containsLiteral, containsLiteral, containsLiteral, containsLiteral, containsLiteral, containsLiteral, containsResource, createAlt, createAlt, createBag, createBag, createList, createList, createList, createLiteral, createLiteral, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createProperty, createProperty, createResource, createResource, createResource, createResource, createResource, createResource, createSeq, createSeq, createStatement, createStatement, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, createTypedLiteral, difference, enterCriticalSection, executeInTxn, expandPrefix, getAlt, getAlt, getBag, getBag, getGraph, getList, getList, getLock, getModelLock, getNsPrefixMap, getNsPrefixURI, getNsURIPrefix, getProperty, getProperty, getProperty, getProperty, getRDFNode, getReader, getRequiredProperty, getRequiredProperty, getResource, getResource, getSeq, getSeq, getWriter, hasNoMappings, intersect, intersection, isClosed, isEmpty, isIsomorphicWith, leaveCriticalSection, listBySubject, listLiteralStatements, listLiteralStatements, listLiteralStatements, listLiteralStatements, listLiteralStatements, listLiteralStatements, listNameSpaces, listObjects, listObjectsOfProperty, listObjectsOfProperty, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listResourcesWithProperty, listStatements, listStatements, listStatements, listSubjects, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, numPrefixes, qnameFor, reifiedToString, samePrefixMappingAs, shortForm, size, supportsSetOperations, supportsTransactions, toString, union, wrapAsResource
Methods inherited from class org.apache.jena.enhanced.EnhGraph
asGraph, equals, hashCode, isIsomorphicWith
Methods inherited from interface org.apache.jena.shared.Lock
enterCriticalSection, leaveCriticalSection
Methods inherited from interface org.apache.jena.rdf.model.Model
abort, begin, calculateInTxn, close, commit, contains, contains, contains, containsAll, containsAll, containsAny, containsAny, containsResource, createList, createList, createList, createLiteral, createProperty, createResource, createResource, createResource, createResource, createTypedLiteral, createTypedLiteral, createTypedLiteral, difference, equals, executeInTxn, getLock, getProperty, getProperty, getProperty, getReader, getRequiredProperty, getRequiredProperty, getResource, getResource, getWriter, intersection, isClosed, isEmpty, isIsomorphicWith, listNameSpaces, listObjects, listObjectsOfProperty, listObjectsOfProperty, listResourcesWithProperty, listResourcesWithProperty, listStatements, listSubjects, listSubjectsWithProperty, listSubjectsWithProperty, size, supportsSetOperations, supportsTransactions, union
Methods inherited from interface org.apache.jena.rdf.model.ModelCon
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, listSubjectsWithProperty, listSubjectsWithProperty
Methods inherited from interface org.apache.jena.rdf.model.ModelGraphInterface
asRDFNode, getGraph, wrapAsResource
Methods inherited from interface org.apache.jena.ontapi.common.OntEnhGraph
canNodeAs, checkType
Methods inherited from interface org.apache.jena.ontapi.model.OntModel
annotationProperties, classes, createAnnotationProperty, createDataProperty, createDatatype, createIndividual, createObjectProperty, createOntClass, createRDFProperty, dataProperties, datatypes, fetchOntEntity, getAnnotationProperty, getAnnotationProperty, getDataProperty, getDataProperty, getDatatype, getDatatype, getDatatype, getIndividual, getIndividual, getObjectProperty, getObjectProperty, getOntClass, getOntClass, getOntEntity, getOWLBackwardCompatibleWith, getOWLDeprecated, getOWLIncompatibleWith, getOWLPriorVersion, getOWLVersionInfo, getRDFSIsDefinedBy, getRDFSSeeAlso, localStatements, namedIndividuals, objectProperties, ontEntities, properties
Methods inherited from interface org.apache.jena.shared.PrefixMapping
expandPrefix, getNsPrefixMap, getNsPrefixURI, getNsURIPrefix, hasNoMappings, numPrefixes, qnameFor, samePrefixMappingAs, shortForm
-
Field Details
-
propertyStore
-
-
Constructor Details
-
OntGraphModelImpl
-
OntGraphModelImpl
-
-
Method Details
-
listOntObjects
public static <M extends org.apache.jena.enhanced.EnhGraph & OntEnhGraph,O extends OntObject> org.apache.jena.util.iterator.ExtendedIterator<O> listOntObjects(M m, Class<? extends O> type) Lists allOntObject
s for the givenOntGraphModelImpl
.- Type Parameters:
M
- a subtype ofEnhGraph
andOntEnhGraph
O
- subtype ofOntObject
- Parameters:
m
-OntGraphModelImpl
the impl to cachetype
-Class
the type ofOntObject
, not null- Returns:
- an
Extended Iterator
ofOntObject
s
-
listIndividuals
public static <M extends OntModel & OntEnhGraph> org.apache.jena.util.iterator.ExtendedIterator<OntIndividual> listIndividuals(M model, Set<String> reserved, org.apache.jena.util.iterator.ExtendedIterator<org.apache.jena.graph.Triple> assertions) FiltersOntIndividual
s from the specifiedExtendedIterator
.- Type Parameters:
M
- a subtype ofOntModel
andOntEnhGraph
- Parameters:
model
-M
, notnull
reserved
- aSet
of forbidden URIs, that cannot be treated asOntology Class
es, notnull
assertions
-ExtendedIterator
ofTriple
s with therdf:type
as predicate, notnull
- Returns:
ExtendedIterator
ofOntIndividual
s that are attached to themodel
-
checkFeature
-
configValue
-
getOntPersonality
Description copied from interface:OntEnhGraph
Returns the model personality, that is unmodifiable model's configuration storage.- Specified by:
getOntPersonality
in interfaceOntEnhGraph
- Returns:
OntPersonality
-
getUnionGraph
ReturnsUnionGraph
. This implementation requires that the underlying graph is union-graph or inf-graph.- Returns:
UnionGraph
-
getBaseGraph
public org.apache.jena.graph.Graph getBaseGraph()Description copied from interface:OntModel
Returns the baseGraph
, i.e., the primary ontologicalGraph
that 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()
.- Specified by:
getBaseGraph
in interfaceOntModel
- Returns:
Graph
- See Also:
-
ModelGraphInterface.getGraph()
-
getBaseModel
public org.apache.jena.rdf.model.Model getBaseModel()Description copied from interface:OntModel
Returns thestandard jena model
that corresponds to thebase graph
. Note: there is theJena Builtin Personality
within the returned model.- Specified by:
getBaseModel
in interfaceOntModel
- Returns:
Model
- See Also:
-
register
- Specified by:
register
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
register
in classorg.apache.jena.rdf.model.impl.ModelCom
-
unregister
- Specified by:
unregister
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
unregister
in classorg.apache.jena.rdf.model.impl.ModelCom
-
notifyEvent
- Specified by:
notifyEvent
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
notifyEvent
in classorg.apache.jena.rdf.model.impl.ModelCom
-
getID
Description copied from interface:OntModel
Gets the Ontology ID object.Since OWL2 graph can only contain the one
@uri rdf:type owl:Ontology
triple inside, this method creates such a statement if it absent; in case there are more than oneResource
with 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. -
createIndividual
Description copied from interface:OntModel
Creates individual (named or anonymous) of the specified type.- Specified by:
createIndividual
in interfaceOntModel
- Parameters:
uri
- String, ornull
for anonymous individualtype
-OntClass
- Returns:
OntIndividual
-
id
Description copied from interface:OntModel
Finds an Ontology ID object.Since OWL2 graph requires only one
@uri rdf:type owl:Ontology
triple, the method returnsOptional#empty
in other cases. No changes in theGraph
is made. The method works only with thebase graph
. -
setID
Description copied from interface:OntModel
Creates a new@uri rdf:type owl:Ontology
statement for the specifieduri
and 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. -
addImport
Description copied from interface:OntModel
Adds a sub-model both to theowl:import
section and to the graph hierarchy.- Specified by:
addImport
in interfaceOntModel
- Parameters:
m
-ont jena model
to add, notnull
- Returns:
- this model to allow cascading calls
- See Also:
-
hasImport
Description copied from interface:OntModel
Answerstrue
if the given model is present in theowl:imports
of this model. This means that at the top-level of the import hierarchy there is a base graph of the givenother
model. Please note: the model may contain the same uri as that of the specified model, but a different (base) graph, i.e. if the methodOntModel.hasImport(String)
returnstrue
, it does not mean this method also returnstrue
. -
hasImport
Description copied from interface:OntModel
Answerstrue
if the model has a graph with the given uri both inowl:imports
and graph-hierarchy. -
removeImport
Description copied from interface:OntModel
Removes a sub-model fromowl:import
and from the graph hierarchy. Does nothing if the specified model does not belong to this ontology. Matching is performed by graph, not uri (seeOntModel.hasImport(OntModel)
description).- Specified by:
removeImport
in interfaceOntModel
- Parameters:
m
-ont jena model
to remove, notnull
- Returns:
- this model to allow cascading calls
- See Also:
-
removeImport
Description copied from interface:OntModel
Removes the import (bothowl:import
declaration and the corresponding graph) by the given uri if it is found.- Specified by:
removeImport
in interfaceOntModel
- Parameters:
uri
- String, an iri of ontology to find, notnull
- Returns:
- this model to allow cascading calls
- See Also:
-
imports
Description copied from interface:OntModel
Lists all sub-models that belong to the top-level hierarchy and haveowl:import
reference inside the base graph. Caution: since recursive hierarchies are not prohibited, the rectilinear usage of this method may cause a StackOverflow Error. -
imports
Lists all top-level sub-models built with the givenpersonality
.- Parameters:
personality
-OntPersonality
, notnull
- Returns:
Stream
ofOntModel
s
-
listImportModels
public final org.apache.jena.util.iterator.ExtendedIterator<OntGraphModelImpl> listImportModels(OntPersonality personality, org.apache.jena.reasoner.Reasoner reasoner) Listsmodel impl
s with the specifiedpersonality
from the top tier of the imports' hierarchy.- Parameters:
personality
-OntPersonality
, notnull
reasoner
-Reasoner
, can benull
- Returns:
- non-distinct
ExtendedIterator
ofOntGraphModelImpl
s
-
getTopModel
Gets the top-levelOntology Graph Model impl
. The returned model may contain import declarations, but cannot contain sub-models. Be warned: any listeners, attached on theModelCom.getGraph()
- Returns:
OntGraphModelImpl
- See Also:
-
independent
public boolean independent()Determines whether this model is independent.- Specified by:
independent
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
independent
in classorg.apache.jena.rdf.model.impl.ModelCom
- Returns:
true
if this model is independent of others
-
isBuiltIn
Answerstrue
if the given entity is built-in.- Type Parameters:
E
- subtype ofOntObjectImpl
andOntEntity
- Parameters:
e
-OntEntity
object impl- Returns:
- boolean
-
ontObjects
Retrieves the stream ofOntology Object
s. The result object will be cached inside the model. Note: this method may return non-distinct results, this is determined by the reasoner and nature of the underlying graph; for non-inference the standard memory graph implementation the result Stream is distinct. -
listOntObjects
public <O extends OntObject> org.apache.jena.util.iterator.ExtendedIterator<O> listOntObjects(Class<? extends O> type) Lists allOntology Object
s and caches them inside this model. -
listLocalOntObjects
public <O extends OntObject> org.apache.jena.util.iterator.ExtendedIterator<O> listLocalOntObjects(Class<? extends O> type) The same aslistOntObjects(Class)
, but for the base graph. -
ontEntities
Description copied from interface:OntModel
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 (byequals
andhasCode
, not by real class-type) means that there is so-called punning.- Specified by:
ontEntities
in interfaceOntModel
- Returns:
Stream
ofOntEntity
- See Also:
-
listOntEntities
Lists all Ontology Entities. Built-ins are not included.- Returns:
Extended Iterator
ofOntEntity
s- See Also:
-
listLocalOntEntities
The same aslistOntEntities()
but for the base graph.- Returns:
Extended Iterator
ofOntEntity
s- See Also:
-
ambiguousEntities
Gets 'punnings', i.e. theOntEntity
s which have not only a single type.- Parameters:
withImports
- if it false takes into account only the base model- Returns:
Stream
ofOntEntity
s.
-
individuals
Description copied from interface:OntModel
Lists all class-asserted individuals.A class assertion axiom is a statement
a rdf:type C
, wherea
is a retrieving individual (named or anonymous) andC
is any class expression. Notice, that the methodOntModel.ontObjects(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:sameAs
is an individual), while this method returns only class-asserted individuals. Also notice: the methodOntModel.namedIndividuals()
must return only explicitly declared named individuals, while this method does not require the declarationowl:NamedIndividual
to 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 graph
the returnedStream
is also distinct, which means an individual that has more than one class assertions, must appear in the stream only once.- Specified by:
individuals
in interfaceOntModel
- Returns:
Stream
ofOntIndividual
s- See Also:
-
listIndividuals
Returns anExtendedIterator
over all individuals that participate in class assertion statementa rdf:type C
.- Returns:
ExtendedIterator
ofOntIndividual
s
-
hierarchyRoots
Description copied from interface:OntModel
Answers aStream
over the classes in this ontology model that represent the uppermost nodes of the class hierarchy. Built-ins are not included.- Specified by:
hierarchyRoots
in interfaceOntModel
- Returns:
- a
Stream
of the rootclasses
in the local class hierarchy
-
listHierarchyRoots
-
getOntEntity
Description copied from interface:OntModel
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
.- Specified by:
getOntEntity
in interfaceOntModel
- Type Parameters:
E
- type of OntEntity- Parameters:
type
-Class
, the type ofOntEntity
, notnull
uri
- String, notnull
- Returns:
OntEntity
ornull
- See Also:
-
createOntEntity
Description copied from interface:OntModel
Creates an owl-entity by thetype
andiri
.- Specified by:
createOntEntity
in interfaceOntModel
- Type Parameters:
T
- type of ont-entity- Parameters:
type
-Class
, the type ofOntEntity
, notnull
iri
- String, notnull
- Returns:
OntEntity
- See Also:
-
createOntObject
Creates and caches an ontology object resource by the given type and uri.- Type Parameters:
T
- class-type ofOntObject
- Parameters:
type
- Class, object typeuri
- String, URI (IRI), can benull
for anonymous resource- Returns:
OntObject
, new instance- Throws:
OntJenaException.Unsupported
- profile mismatch
-
removeOntObject
Description copied from interface:OntModel
Removes the givenOntology Object
from the graph-model including itscontent
and 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:subClassOf
predicate, that statement is being removed from the graph along with its annotations, because it belongs to the class content.- Specified by:
removeOntObject
in interfaceOntModel
- Parameters:
obj
-OntObject
- Returns:
- this model
- See Also:
-
removeOntStatement
Description copied from interface:OntModel
Removes the statement from the graph-model including its annotations with sub-annotations hierarchy.- Specified by:
removeOntStatement
in interfaceOntModel
- Parameters:
statement
-OntStatement
- Returns:
- this model
- See Also:
-
Model.remove(Statement)
-
statements
Description copied from interface:OntModel
Lists all ont-statements.- Specified by:
statements
in interfaceOntModel
- Returns:
Stream
ofOntStatement
- See Also:
-
Model.listStatements()
-
statements
public Stream<OntStatement> statements(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) Description copied from interface:OntModel
Lists all statements for the specified subject, predicate and object (SPO).- Specified by:
statements
in interfaceOntModel
- Parameters:
s
-Resource
, the subjectp
-Property
, the predicateo
-RDFNode
, the object- Returns:
Stream
ofOntStatement
- See Also:
-
Model.listStatements(Resource, Property, RDFNode)
-
localStatements
public Stream<OntStatement> localStatements(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) Description copied from interface:OntModel
Lists all statements from thebase graph
for the specified subject, predicate and object. Effectively equivalent to themodel.statements(s, p, o).filter(OntStatement::isLocal)
expression.- Specified by:
localStatements
in interfaceOntModel
- Parameters:
s
-Resource
, the subjectp
-Property
, the predicateo
-RDFNode
, the object- Returns:
Stream
ofOntStatement
- See Also:
-
listStatements
public org.apache.jena.rdf.model.StmtIterator listStatements(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) - Specified by:
listStatements
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
listStatements
in classorg.apache.jena.rdf.model.impl.ModelCom
- Parameters:
s
-Resource
the subject sought, can benull
p
-Property
the predicate sought, can benull
o
-RDFNode
the object sought, can benull
- Returns:
StmtIterator
ofOntStatement
s
-
listOntStatements
public org.apache.jena.util.iterator.ExtendedIterator<OntStatement> listOntStatements(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) Returns anextended iterator
over all the statements in the model that match a pattern. The statements selected are those whose subject matches thes
argument, whose predicate matches thep
argument and whose object matches theo
argument. If an argument isnull
it matches anything. The method is equivalent to the expressionlistStatements(s, p, o).mapWith(OntStatement.class::cast)
.- Parameters:
s
-Resource
the subject sought, can benull
p
-Property
the predicate sought, can benull
o
-RDFNode
the object sought, can benull
- Returns:
ExtendedIterator
ofOntStatement
s- See Also:
-
listLocalStatements
public org.apache.jena.util.iterator.ExtendedIterator<OntStatement> listLocalStatements(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) Lists all statements in the base model that match a pattern in the form ofExtended Iterator
. The method is equivalent to the expressionlistStatements(s, p, o).mapWith(OntStatement.class::cast).filterKeep(OntStatement::isLocal)
.- Parameters:
s
-Resource
the subject sought, can benull
p
-Property
the predicate sought, can benull
o
-RDFNode
the object sought, can benull
- Returns:
ExtendedIterator
ofOntStatement
s, which are local to the base graph- See Also:
-
createStatement
public OntStatementImpl createStatement(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) - Specified by:
createStatement
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
createStatement
in classorg.apache.jena.rdf.model.impl.ModelCom
-
asStatement
Description copied from interface:OntModel
Answers anOntology Statement
in this model who's SPO is that of thetriple
.- Specified by:
asStatement
in interfaceorg.apache.jena.rdf.model.ModelGraphInterface
- Specified by:
asStatement
in interfaceOntModel
- Overrides:
asStatement
in classorg.apache.jena.rdf.model.impl.ModelCom
- Parameters:
triple
-Triple
, notnull
- Returns:
OntStatement
-
containsLocal
public boolean containsLocal(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) Determines if the given(s, p, o)
pattern is present in the base graph, withnull
allowed to represent a wildcard match.- Parameters:
s
- -Resource
- the subject of the statement tested (null
as wildcard)p
- -Property
- the predicate of the statement tested (null
as wildcard)o
- -RDFNode
- the object of the statement tested (null
as wildcard)- Returns:
- boolean
- See Also:
-
Model.contains(Resource, Property, RDFNode)
-
asOntList
public <E extends org.apache.jena.rdf.model.RDFNode> OntListImpl<E> asOntList(org.apache.jena.rdf.model.RDFList list, OntObject subject, org.apache.jena.rdf.model.Property predicate, Class<E> type) Wraps the existing given[]-list
asONT-list
.- Type Parameters:
E
- anyRDFNode
- Parameters:
list
-RDFList
, notnull
subject
-OntObject
, notnull
predicate
-Property
, notnull
type
- aClass
-type for list elementE
, notnull
- Returns:
OntList
-
asOntList
public <E extends org.apache.jena.rdf.model.RDFNode> OntListImpl<E> asOntList(org.apache.jena.rdf.model.RDFList list, OntObject subject, org.apache.jena.rdf.model.Property predicate, boolean checkRecursions, org.apache.jena.rdf.model.Resource listType, Class<E> elementType) Wraps the existing given[]-list
asONT-list
.- Type Parameters:
E
- anyRDFNode
- Parameters:
list
-RDFList
, notnull
subject
-OntObject
, notnull
predicate
-Property
, notnull
checkRecursions
- boolean, iftrue
more careful and expensive checking for list content is performedlistType
- an uri-Resource
, used as an archaic RDF-type, usually this parameter should benull
elementType
- aClass
-type for list elementE
, notnull
- Returns:
OntList
-
createOntList
public <E extends org.apache.jena.rdf.model.RDFNode> OntListImpl<E> createOntList(OntObject subject, org.apache.jena.rdf.model.Property predicate, Class<E> type, Iterator<E> elements) Creates ONT-List with given elements and other settings.- Type Parameters:
E
- anyRDFNode
- Parameters:
subject
-OntObject
, notnull
predicate
-Property
, notnull
type
- aClass
-type for elementE
, notnull
elements
- andIterator
ofE
-elements (the order is preserved), notnull
- Returns:
OntList
-
createOntList
public <E extends org.apache.jena.rdf.model.RDFNode> OntListImpl<E> createOntList(OntObject subject, org.apache.jena.rdf.model.Property predicate, org.apache.jena.rdf.model.Resource listType, Class<E> elementType, Iterator<E> elements) Creates ONT-List with given elements and other settings.- Type Parameters:
E
- anyRDFNode
- Parameters:
subject
-OntObject
, notnull
predicate
-Property
, notnull
listType
- an uri-Resource
, used as an archaic RDF-type, usually this parameter should benull
elementType
- aClass
-type for elementE
, notnull
elements
- andIterator
ofE
-elements (the order is preserved), notnull
- Returns:
OntList
-
listAnnotations
public org.apache.jena.util.iterator.ExtendedIterator<org.apache.jena.rdf.model.Resource> listAnnotations(org.apache.jena.rdf.model.Resource t, org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) Lists all (bulk) annotation anonymous resources for the givenrdf:type
and SPO.- Parameters:
t
-Resource
eitherowl:Axiom
orowl:Annotation
s
-Resource
subjectp
-Property
predicateo
-RDFNode
object- Returns:
ExtendedIterator
of annotationresource
s
-
deleteOntList
public OntGraphModelImpl deleteOntList(OntObject subject, org.apache.jena.rdf.model.Property predicate, OntList<?> object) Deletes the specifiedOntList
including its annotations. -
createDisjointClasses
-
createDifferentIndividuals
-
createDisjointObjectProperties
public OntDisjoint.ObjectProperties createDisjointObjectProperties(Collection<OntObjectProperty> properties) -
createDisjointDataProperties
public OntDisjoint.DataProperties createDisjointDataProperties(Collection<OntDataProperty> properties) -
createFacetRestriction
public <T extends OntFacetRestriction> T createFacetRestriction(Class<T> view, org.apache.jena.rdf.model.Literal literal) Description copied from interface:OntModel
Creates a facet restriction by the given type and literal value. Each call to this method creates a fresh b-node within the graph.- Specified by:
createFacetRestriction
in interfaceOntModel
- Type Parameters:
T
- type of ont-facet-restriction- Parameters:
view
-Class
, the type ofOntFacetRestriction
, notnull
literal
-Literal
, notnull
- Returns:
OntFacetRestriction
- See Also:
-
OntDataRange.Restriction
CreateRanges.createDataRestriction(OntDataRange.Named, Collection)
-
createDataOneOf
-
createDataRestriction
public OntDataRange.Restriction createDataRestriction(OntDataRange.Named datatype, Collection<OntFacetRestriction> values) -
createDataComplementOf
-
createDataUnionOf
-
createDataIntersectionOf
-
createObjectSomeValuesFrom
public OntClass.ObjectSomeValuesFrom createObjectSomeValuesFrom(OntObjectProperty property, OntClass ce) -
createDataSomeValuesFrom
public OntClass.DataSomeValuesFrom createDataSomeValuesFrom(OntDataProperty property, OntDataRange dr) -
createObjectAllValuesFrom
public OntClass.ObjectAllValuesFrom createObjectAllValuesFrom(OntObjectProperty property, OntClass ce) -
createDataAllValuesFrom
public OntClass.DataAllValuesFrom createDataAllValuesFrom(OntDataProperty property, OntDataRange dr) -
createObjectHasValue
public OntClass.ObjectHasValue createObjectHasValue(OntObjectProperty property, OntIndividual individual) -
createDataHasValue
public OntClass.DataHasValue createDataHasValue(OntDataProperty property, org.apache.jena.rdf.model.Literal literal) -
createObjectMinCardinality
public OntClass.ObjectMinCardinality createObjectMinCardinality(OntObjectProperty property, int cardinality, OntClass ce) -
createDataMinCardinality
public OntClass.DataMinCardinality createDataMinCardinality(OntDataProperty property, int cardinality, OntDataRange dr) -
createObjectMaxCardinality
public OntClass.ObjectMaxCardinality createObjectMaxCardinality(OntObjectProperty property, int cardinality, OntClass ce) -
createDataMaxCardinality
public OntClass.DataMaxCardinality createDataMaxCardinality(OntDataProperty property, int cardinality, OntDataRange dr) -
createObjectCardinality
public OntClass.ObjectCardinality createObjectCardinality(OntObjectProperty property, int cardinality, OntClass ce) -
createDataCardinality
public OntClass.DataCardinality createDataCardinality(OntDataProperty property, int cardinality, OntDataRange dr) -
createObjectUnionOf
-
createObjectIntersectionOf
-
createObjectOneOf
-
createHasSelf
-
createDataAllValuesFrom
public OntClass.NaryDataAllValuesFrom createDataAllValuesFrom(Collection<OntDataProperty> properties, OntDataRange dr) -
createDataSomeValuesFrom
public OntClass.NaryDataSomeValuesFrom createDataSomeValuesFrom(Collection<OntDataProperty> properties, OntDataRange dr) -
createObjectComplementOf
-
createSWRLVariable
-
createBuiltInSWRLAtom
public OntSWRL.Atom.WithBuiltin createBuiltInSWRLAtom(org.apache.jena.rdf.model.Resource predicate, Collection<OntSWRL.DArg> arguments) -
createClassSWRLAtom
-
createDataRangeSWRLAtom
-
createDataPropertySWRLAtom
public OntSWRL.Atom.WithDataProperty createDataPropertySWRLAtom(OntDataProperty dataProperty, OntSWRL.IArg firstArg, OntSWRL.DArg secondArg) -
createObjectPropertySWRLAtom
public OntSWRL.Atom.WithObjectProperty createObjectPropertySWRLAtom(OntObjectProperty dataProperty, OntSWRL.IArg firstArg, OntSWRL.IArg secondArg) -
createDifferentIndividualsSWRLAtom
public OntSWRL.Atom.WithDifferentIndividuals createDifferentIndividualsSWRLAtom(OntSWRL.IArg firstArg, OntSWRL.IArg secondArg) -
createSameIndividualsSWRLAtom
public OntSWRL.Atom.WithSameIndividuals createSameIndividualsSWRLAtom(OntSWRL.IArg firstArg, OntSWRL.IArg secondArg) -
createSWRLImp
public OntSWRL.Imp createSWRLImp(Collection<OntSWRL.Atom<?>> head, Collection<OntSWRL.Atom<?>> body) -
getRDFDatatype
-
getPrefixMapping
public org.apache.jena.shared.PrefixMapping getPrefixMapping() -
setNsPrefix
- Specified by:
setNsPrefix
in interfaceorg.apache.jena.rdf.model.Model
- Specified by:
setNsPrefix
in interfaceorg.apache.jena.shared.PrefixMapping
- Overrides:
setNsPrefix
in classorg.apache.jena.rdf.model.impl.ModelCom
-
removeNsPrefix
- Specified by:
removeNsPrefix
in interfaceorg.apache.jena.rdf.model.Model
- Specified by:
removeNsPrefix
in interfaceorg.apache.jena.shared.PrefixMapping
- Overrides:
removeNsPrefix
in classorg.apache.jena.rdf.model.impl.ModelCom
-
clearNsPrefixMap
- Specified by:
clearNsPrefixMap
in interfaceorg.apache.jena.rdf.model.Model
- Specified by:
clearNsPrefixMap
in interfaceorg.apache.jena.shared.PrefixMapping
- Overrides:
clearNsPrefixMap
in classorg.apache.jena.rdf.model.impl.ModelCom
-
setNsPrefixes
- Specified by:
setNsPrefixes
in interfaceorg.apache.jena.rdf.model.Model
- Specified by:
setNsPrefixes
in interfaceorg.apache.jena.shared.PrefixMapping
- Overrides:
setNsPrefixes
in classorg.apache.jena.rdf.model.impl.ModelCom
-
lock
- Specified by:
lock
in interfaceorg.apache.jena.shared.PrefixMapping
- Overrides:
lock
in classorg.apache.jena.rdf.model.impl.ModelCom
-
add
- Specified by:
add
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
add
in classorg.apache.jena.rdf.model.impl.ModelCom
-
remove
- Specified by:
remove
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
remove
in classorg.apache.jena.rdf.model.impl.ModelCom
-
add
public OntGraphModelImpl add(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) - Specified by:
add
in interfaceorg.apache.jena.rdf.model.ModelCon
- Overrides:
add
in classorg.apache.jena.rdf.model.impl.ModelCom
-
remove
public OntGraphModelImpl remove(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) - Specified by:
remove
in interfaceorg.apache.jena.rdf.model.ModelCon
- Overrides:
remove
in classorg.apache.jena.rdf.model.impl.ModelCom
-
add
- Specified by:
add
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
add
in classorg.apache.jena.rdf.model.impl.ModelCom
-
remove
- Specified by:
remove
in interfaceorg.apache.jena.rdf.model.ModelCon
- Overrides:
remove
in classorg.apache.jena.rdf.model.impl.ModelCom
-
add
- Specified by:
add
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
add
in classorg.apache.jena.rdf.model.impl.ModelCom
-
remove
- Specified by:
remove
in interfaceorg.apache.jena.rdf.model.ModelCon
- Overrides:
remove
in classorg.apache.jena.rdf.model.impl.ModelCom
-
add
- Specified by:
add
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
add
in classorg.apache.jena.rdf.model.impl.ModelCom
-
remove
- Specified by:
remove
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
remove
in classorg.apache.jena.rdf.model.impl.ModelCom
-
add
- Specified by:
add
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
add
in classorg.apache.jena.rdf.model.impl.ModelCom
-
remove
- Specified by:
remove
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
remove
in classorg.apache.jena.rdf.model.impl.ModelCom
-
removeAll
public OntGraphModelImpl removeAll(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.RDFNode o) - Specified by:
removeAll
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
removeAll
in classorg.apache.jena.rdf.model.impl.ModelCom
-
removeAll
- Specified by:
removeAll
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
removeAll
in classorg.apache.jena.rdf.model.impl.ModelCom
-
addLiteral
public OntGraphModelImpl addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, boolean v) - Specified by:
addLiteral
in interfaceorg.apache.jena.rdf.model.ModelCon
- Overrides:
addLiteral
in classorg.apache.jena.rdf.model.impl.ModelCom
-
addLiteral
public OntGraphModelImpl addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, long v) - Specified by:
addLiteral
in interfaceorg.apache.jena.rdf.model.ModelCon
- Overrides:
addLiteral
in classorg.apache.jena.rdf.model.impl.ModelCom
-
addLiteral
public OntGraphModelImpl addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, int v) - Specified by:
addLiteral
in interfaceorg.apache.jena.rdf.model.ModelCon
- Overrides:
addLiteral
in classorg.apache.jena.rdf.model.impl.ModelCom
-
addLiteral
public OntGraphModelImpl addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, char v) - Specified by:
addLiteral
in interfaceorg.apache.jena.rdf.model.ModelCon
- Overrides:
addLiteral
in classorg.apache.jena.rdf.model.impl.ModelCom
-
addLiteral
public OntGraphModelImpl addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, float v) - Specified by:
addLiteral
in interfaceorg.apache.jena.rdf.model.ModelCon
- Overrides:
addLiteral
in classorg.apache.jena.rdf.model.impl.ModelCom
-
addLiteral
public OntGraphModelImpl addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, double v) - Specified by:
addLiteral
in interfaceorg.apache.jena.rdf.model.ModelCon
- Overrides:
addLiteral
in classorg.apache.jena.rdf.model.impl.ModelCom
-
addLiteral
public OntGraphModelImpl addLiteral(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, org.apache.jena.rdf.model.Literal o) - Specified by:
addLiteral
in interfaceorg.apache.jena.rdf.model.ModelCon
- Overrides:
addLiteral
in classorg.apache.jena.rdf.model.impl.ModelCom
-
add
public OntGraphModelImpl add(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, String lex) - Specified by:
add
in interfaceorg.apache.jena.rdf.model.ModelCon
- Overrides:
add
in classorg.apache.jena.rdf.model.impl.ModelCom
-
add
public OntGraphModelImpl 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:
add
in interfaceorg.apache.jena.rdf.model.ModelCon
- Overrides:
add
in classorg.apache.jena.rdf.model.impl.ModelCom
-
add
public OntGraphModelImpl add(org.apache.jena.rdf.model.Resource s, org.apache.jena.rdf.model.Property p, String lex, String lang) - Specified by:
add
in interfaceorg.apache.jena.rdf.model.ModelCon
- Overrides:
add
in classorg.apache.jena.rdf.model.impl.ModelCom
-
read
- Specified by:
read
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
read
in classorg.apache.jena.rdf.model.impl.ModelCom
-
read
- Specified by:
read
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
read
in classorg.apache.jena.rdf.model.impl.ModelCom
-
read
- Specified by:
read
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
read
in classorg.apache.jena.rdf.model.impl.ModelCom
-
read
- Specified by:
read
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
read
in classorg.apache.jena.rdf.model.impl.ModelCom
-
read
- Specified by:
read
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
read
in classorg.apache.jena.rdf.model.impl.ModelCom
-
read
- Specified by:
read
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
read
in classorg.apache.jena.rdf.model.impl.ModelCom
-
read
- Specified by:
read
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
read
in classorg.apache.jena.rdf.model.impl.ModelCom
-
write
- Specified by:
write
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
write
in classorg.apache.jena.rdf.model.impl.ModelCom
-
write
- Specified by:
write
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
write
in classorg.apache.jena.rdf.model.impl.ModelCom
-
write
- Specified by:
write
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
write
in classorg.apache.jena.rdf.model.impl.ModelCom
-
write
- Specified by:
write
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
write
in classorg.apache.jena.rdf.model.impl.ModelCom
-
write
- Specified by:
write
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
write
in classorg.apache.jena.rdf.model.impl.ModelCom
-
write
- Specified by:
write
in interfaceorg.apache.jena.rdf.model.Model
- Overrides:
write
in classorg.apache.jena.rdf.model.impl.ModelCom
-
writeAll
-
writeAll
-
writeAll
-
writeAll
-
getRDFSComment
- Specified by:
getRDFSComment
in interfaceOntModel
-
getRDFSLabel
- Specified by:
getRDFSLabel
in interfaceOntModel
-
getOWLThing
- Specified by:
getOWLThing
in interfaceOntModel
-
getRDFSLiteral
- Specified by:
getRDFSLiteral
in interfaceOntModel
-
getOWLNothing
- Specified by:
getOWLNothing
in interfaceOntModel
-
getOWLTopObjectProperty
- Specified by:
getOWLTopObjectProperty
in interfaceOntModel
-
getOWLBottomObjectProperty
- Specified by:
getOWLBottomObjectProperty
in interfaceOntModel
-
getOWLTopDataProperty
- Specified by:
getOWLTopDataProperty
in interfaceOntModel
-
getOWLBottomDataProperty
- Specified by:
getOWLBottomDataProperty
in interfaceOntModel
-
getReasoner
public org.apache.jena.reasoner.Reasoner getReasoner()Returns theReasoner
which is being used to answer queries to this graph ornull
if reasoner is not supported by the model.- Specified by:
getReasoner
in interfaceorg.apache.jena.rdf.model.InfModel
-
setDerivationLogging
public void setDerivationLogging(boolean logOn) Switches on/off derivation logging. If this option is enabled, then each time a derivation is made, that fact is recorded, and the resulting record can be accessed through a later call to getDerivation. This can take up a lot of space!- Specified by:
setDerivationLogging
in interfaceorg.apache.jena.rdf.model.InfModel
-
getDerivation
public Iterator<org.apache.jena.reasoner.Derivation> getDerivation(org.apache.jena.rdf.model.Statement statement) Returns the derivation of the given statement (which should be the result of some previous list operation). Not all reasoners support derivations.- Specified by:
getDerivation
in interfaceorg.apache.jena.rdf.model.InfModel
- Parameters:
statement
-Statement
to get derivation information- Returns:
- an iterator over
Derivation
records ornull
if there is no derivation information available for this triple - See Also:
-
Derivation
-
getInfGraph
public org.apache.jena.reasoner.InfGraph getInfGraph()ReturnsInfGraph
ornull
if no-inf model- Returns:
InfGraph
-
rebind
public void rebind()Causes the inference model to reconsult the underlying data to take into account changes. Normally, changes are made through the InfModel's, add and remove calls are will be handled appropriately. However, in some cases, changes are made behind the InfModel's back and this forces a full reconsult of the changed data.- Specified by:
rebind
in interfaceorg.apache.jena.rdf.model.InfModel
-
prepare
public void prepare()Performs any initial processing and caching. This call is optional. Most engines either have negligible set-up work or will perform an implicit "prepare" if necessary. The call is provided for those occasions where substantial preparation work is possible (e.g. running a forward chaining rule system) and where an application might wish greater control over when this preparation is done rather than just leaving to be done at first query time.- Specified by:
prepare
in interfaceorg.apache.jena.rdf.model.InfModel
-
reset
public void reset()Resets any internal caches. Some systems, such as the tabled backchainer, retain information after each query. A reset will wipe this information preventing unbounded memory use at the expense of more expensive future queries. A reset does not cause the raw data to be reconsulted and so is less expensive than a rebinding.- Specified by:
reset
in interfaceorg.apache.jena.rdf.model.InfModel
-
validate
public org.apache.jena.reasoner.ValidityReport validate()Tests the consistency of the underlying data. This normally tests the validity of the bound instance data against the bound schema data.- Specified by:
validate
in interfaceorg.apache.jena.rdf.model.InfModel
- Returns:
- a
ValidityReport
structure
-
listStatements
public org.apache.jena.rdf.model.StmtIterator listStatements(org.apache.jena.rdf.model.Resource subject, org.apache.jena.rdf.model.Property predicate, org.apache.jena.rdf.model.RDFNode object, org.apache.jena.rdf.model.Model posit) Finds all the statements matching a pattern. Returns an iterator over all the statements in a model that match a pattern.The SPO terms may refer to resources which are temporarily defined in the "posit" model. This allows one, for example, to query what resources are of type CE where CE is a class expression rather than a named class - put CE in the posit arg.
- Specified by:
listStatements
in interfaceorg.apache.jena.rdf.model.InfModel
- Parameters:
subject
- The subject soughtpredicate
- The predicate soughtobject
- The value soughtposit
- Model containing additional assertions to be considered when matching statements- Returns:
- an iterator over the subjects
-
asInferenceModel
public org.apache.jena.rdf.model.InfModel asInferenceModel()Description copied from interface:OntModel
Returns a view of this model that supports inference, if possible.- Specified by:
asInferenceModel
in interfaceOntModel
- Returns:
InfModel
, notnull
-
getDeductionsModel
public org.apache.jena.rdf.model.Model getDeductionsModel()Returns a derivations model. The rule reasoners typically create a graph containing those triples added to the base graph due to rule firings. In some applications, it can be useful to be able to access those deductions directly, without seeing the raw data which triggered them. In particular, this allows the forward rules to be used as if they were rewrite transformation rules.- Specified by:
getDeductionsModel
in interfaceorg.apache.jena.rdf.model.InfModel
- Returns:
- The derivation model, if one is defined, or else
null
-
getRawModel
public org.apache.jena.rdf.model.Model getRawModel()Returns the raw RDF model being processed (i.e. the argument to theReasoner.bind(Graph)
call that created thisInfModel
).- Specified by:
getRawModel
in interfaceorg.apache.jena.rdf.model.InfModel
-
findNodeAs
public <N extends org.apache.jena.rdf.model.RDFNode> N findNodeAs(org.apache.jena.graph.Node node, Class<N> type) Returns aRDFNode
for the given type and, if the result is present, caches it node at the model level. The method works silently: normally no exception is expected.- Specified by:
findNodeAs
in interfaceOntEnhGraph
- Type Parameters:
N
- any subtype ofRDFNode
- Parameters:
node
-Node
type
-Class
-type- Returns:
RDFNode
ornull
- Throws:
RuntimeException
- unexpected misconfiguration (RDF recursion, wrong input, personality mismatch, etc.)- See Also:
-
getNodeAs
public <N extends org.apache.jena.rdf.model.RDFNode> N getNodeAs(org.apache.jena.graph.Node node, Class<N> type) Answers an enhanced node that wraps the given node and conforms to the given interface type. The returned RDF node is cached at the model-level.- Specified by:
getNodeAs
in interfaceOntEnhGraph
- Overrides:
getNodeAs
in classorg.apache.jena.enhanced.EnhGraph
- Type Parameters:
N
- a subtype ofRDFNode
- Parameters:
node
- a node (assumed to be in this graph)type
- a type denoting the enhanced facet desired- Returns:
- an enhanced node, cannot be
null
- Throws:
OntJenaException
- unable to construct new RDF view for whatever reasonRuntimeException
- unexpected misconfiguration (wrong inputs, personality mismatch)- See Also:
-
OntEnhGraph.findNodeAs(Node, Class)
EnhGraph.getNodeAs(Node, Class)
-
safeFindNodeAs
public <N extends org.apache.jena.rdf.model.RDFNode> N safeFindNodeAs(org.apache.jena.graph.Node node, Class<N> type) Answers an enhanced node that wraps the given node and conforms to the given interface type, taking into account possible graph recursions. For internal usage only.- Specified by:
safeFindNodeAs
in interfaceOntEnhGraph
- Type Parameters:
N
- a subtype ofRDFNode
- Parameters:
node
- a node (assumed to be in this graph)type
- a type denoting the enhanced facet desired- Returns:
- an enhanced node or
null
if no match found - Throws:
OntJenaException.Recursion
- if a graph recursion is detectedRuntimeException
- unexpected misconfiguration- See Also:
-
createObjectIntersectionOf
Creates an Intersection of Class Expressions.- Parameters:
classes
- Array ofclass expression
s withoutnull
s- Returns:
OntClass.IntersectionOf
- See Also:
-
createObjectUnionOf
Creates a Union of Class Expressions.- Parameters:
classes
- Array ofclass expression
s withoutnull
s- Returns:
OntClass.UnionOf
- See Also:
-
createObjectOneOf
Creates an Enumeration of Individuals.- Parameters:
individuals
- Array ofindividual
s withoutnull
s- Returns:
OntClass.OneOf
- See Also:
-
createDataOneOf
Creates an Enumeration of Literals.- Parameters:
values
- Array ofliteral
s, 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
, notnull
values
- Array offacet restriction
s, withoutnull
s- Returns:
OntDataRange.Restriction
- See Also:
-
createDataUnionOf
Creates a Union of Data Ranges.- Parameters:
values
-Collection
ofdata range
s, withoutnull
-elements- Returns:
OntDataRange.UnionOf
- See Also:
-
createDataIntersectionOf
Creates an Intersection of Data Ranges.- Parameters:
values
- Array ofdata range
s, withoutnull
-elements- Returns:
OntDataRange.IntersectionOf
- See Also:
-
createDisjointClasses
Creates a Disjoint Classes Axiom Resource.- Parameters:
classes
- Array ofClass Expression
s withoutnull
-elements- Returns:
OntDisjoint.Classes
- See Also:
-
createDifferentIndividuals
Creates a Different Individuals Axiom Resource.- Parameters:
individuals
- Array ofindividual
s 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 Expression
s withoutnull
-elements- Returns:
OntDisjoint.ObjectProperties
- See Also:
-
createDisjointDataProperties
Creates a Disjoint Data Properties Axiom Resource.- Parameters:
properties
- Array ofData Properties
withoutnull
-elements- Returns:
OntDisjoint.DataProperties
- See Also:
-