- 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
FieldsFields inherited from interface org.apache.jena.shared.Lock
READ, WRITEFields inherited from interface org.apache.jena.shared.PrefixMapping
Extended, Standard -
Constructor Summary
ConstructorsConstructorDescriptionOntGraphModelImpl(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: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) ambiguousEntities(boolean withImports) Gets 'punnings', i.e. theOntEntitys which have not only a single type.org.apache.jena.rdf.model.InfModelReturns 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[]-listasONT-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[]-listasONT-list.asStatement(org.apache.jena.graph.Triple triple) Answers anOntology Statementin this model who's SPO is that of thetriple.static voidcheckFeature(OntModel m, OntModelControls setting, String featureName) static booleanconfigValue(OntModel m, OntModelControls setting) booleancontainsLocal(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, withnullallowed 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.IntersectionOfcreateDataIntersectionOf(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.OneOfcreateDataOneOf(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.RestrictioncreateDataRestriction(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.UnionOfcreateDataUnionOf(OntDataRange... values) Creates a Union of Data Ranges.createDifferentIndividuals(Collection<OntIndividual> individuals) default OntDisjoint.IndividualscreateDifferentIndividuals(OntIndividual... individuals) Creates a Different Individuals Axiom Resource.createDifferentIndividualsSWRLAtom(OntSWRL.IArg firstArg, OntSWRL.IArg secondArg) createDisjointClasses(Collection<OntClass> classes) default OntDisjoint.ClassescreateDisjointClasses(OntClass... classes) Creates a Disjoint Classes Axiom Resource.createDisjointDataProperties(Collection<OntDataProperty> properties) default OntDisjoint.DataPropertiescreateDisjointDataProperties(OntDataProperty... properties) Creates a Disjoint Data Properties Axiom Resource.createDisjointObjectProperties(Collection<OntObjectProperty> properties) default OntDisjoint.ObjectPropertiescreateDisjointObjectProperties(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.IntersectionOfcreateObjectIntersectionOf(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.OneOfcreateObjectOneOf(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.UnionOfcreateObjectUnionOf(OntClass... classes) Creates a Union of Class Expressions.<T extends OntEntity>
TcreateOntEntity(Class<T> type, String iri) Creates an owl-entity by thetypeandiri.<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 specifiedOntListincluding its annotations.<N extends org.apache.jena.rdf.model.RDFNode>
NfindNodeAs(org.apache.jena.graph.Node node, Class<N> type) Returns aRDFNodefor the given type and, if the result is present, caches it node at the model level.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.org.apache.jena.rdf.model.ModelReturns 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.InfGraphReturnsInfGraphornullif 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.PrefixMappingorg.apache.jena.rdf.model.ModelReturns the raw RDF model being processed (i.e. the argument to theReasoner.bind(Graph)call that created thisInfModel).org.apache.jena.datatypes.RDFDatatypegetRDFDatatype(String uri) org.apache.jena.reasoner.ReasonerReturns theReasonerwhich is being used to answer queries to this graph ornullif reasoner is not supported by the model.Gets the top-levelOntology Graph Model impl.ReturnsUnionGraph.booleanAnswerstrueif 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.imports(OntPersonality personality) Lists all top-level sub-models built with the givenpersonality.booleanDetermines whether this model is independent.Lists all class-asserted individuals.<E extends OntObjectImpl & OntEntity>
booleanisBuiltIn(E e) Answerstrueif 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:typeand 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 impls with the specifiedpersonalityfrom the top tier of the imports' hierarchy.org.apache.jena.util.iterator.ExtendedIterator<OntIndividual>Returns anExtendedIteratorover 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) FiltersOntIndividuals 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 Objects 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 allOntObjects 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 iteratorover all the statements in the model that match a pattern.org.apache.jena.rdf.model.StmtIteratorlistStatements(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.StmtIteratorlistStatements(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 graphfor 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 Objects.voidprepare()Performs any initial processing and caching.read(InputStream reader, String base) read(InputStream reader, String base, String lang) voidrebind()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: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.voidreset()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.voidsetDerivationLogging(boolean logOn) Switches on/off derivation logging.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 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.ValidityReportvalidate()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, add, addNamespaces, asModel, asNode, asRDFNode, asStatements, asStatements, asStatements, begin, calculateInTxn, close, commit, contains, 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, createLiteral, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createLiteralStatement, createProperty, createProperty, createResource, createResource, createResource, createResource, createResource, createSeq, createSeq, createStatement, createStatement, createStatementTerm, 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, listStatements, listSubjects, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, numPrefixes, qnameFor, reifiedToString, samePrefixMappingAs, shortForm, size, supportsSetOperations, supportsTransactions, toString, union, wrapAsResourceMethods inherited from class org.apache.jena.enhanced.EnhGraph
asGraph, equals, hashCode, isIsomorphicWithMethods inherited from interface org.apache.jena.shared.Lock
enterCriticalSection, leaveCriticalSectionMethods 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, createLiteral, createProperty, createReifier, createReifier, createResource, createResource, createResource, createResource, createStatementTerm, 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, unionMethods 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.ontapi.common.OntEnhGraph
canNodeAs, checkTypeMethods 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, propertiesMethods 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 allOntObjects for the givenOntGraphModelImpl.- Type Parameters:
M- a subtype ofEnhGraphandOntEnhGraphO- subtype ofOntObject- Parameters:
m-OntGraphModelImplthe impl to cachetype-Classthe type ofOntObject, not null- Returns:
- an
Extended IteratorofOntObjects
-
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) FiltersOntIndividuals from the specifiedExtendedIterator.- Type Parameters:
M- a subtype ofOntModelandOntEnhGraph- Parameters:
model-M, notnullreserved- aSetof forbidden URIs, that cannot be treated asOntology Classes, notnullassertions-ExtendedIteratorofTriples with therdf:typeas predicate, notnull- Returns:
ExtendedIteratorofOntIndividuals that are attached to themodel
-
checkFeature
-
configValue
-
getOntPersonality
Description copied from interface:OntEnhGraphReturns the model personality, that is unmodifiable model's configuration storage.- Specified by:
getOntPersonalityin 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:OntModelReturns 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().- Specified by:
getBaseGraphin interfaceOntModel- Returns:
Graph- See Also:
-
ModelGraphInterface.getGraph()
-
getBaseModel
public org.apache.jena.rdf.model.Model getBaseModel()Description copied from interface:OntModelReturns thestandard jena modelthat corresponds to thebase graph. Note: there is theJena Builtin Personalitywithin the returned model.- Specified by:
getBaseModelin interfaceOntModel- Returns:
Model- See Also:
-
register
- Specified by:
registerin interfaceorg.apache.jena.rdf.model.Model- Overrides:
registerin classorg.apache.jena.rdf.model.impl.ModelCom
-
unregister
- Specified by:
unregisterin interfaceorg.apache.jena.rdf.model.Model- Overrides:
unregisterin classorg.apache.jena.rdf.model.impl.ModelCom
-
notifyEvent
- Specified by:
notifyEventin interfaceorg.apache.jena.rdf.model.Model- Overrides:
notifyEventin classorg.apache.jena.rdf.model.impl.ModelCom
-
getID
Description copied from interface:OntModelGets 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. -
createIndividual
Description copied from interface:OntModelCreates individual (named or anonymous) of the specified type.- Specified by:
createIndividualin interfaceOntModel- Parameters:
uri- String, ornullfor anonymous individualtype-OntClass- Returns:
OntIndividual
-
id
Description copied from interface:OntModelFinds 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. -
setID
Description copied from interface:OntModelCreates 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. -
addImport
Description copied from interface:OntModelAdds a sub-model both to theowl:importsection and to the graph hierarchy.- Specified by:
addImportin interfaceOntModel- Parameters:
m-ont jena modelto add, notnull- Returns:
- this model to allow cascading calls
- See Also:
-
hasImport
Description copied from interface:OntModelAnswerstrueif 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 methodOntModel.hasImport(String)returnstrue, it does not mean this method also returnstrue. -
hasImport
Description copied from interface:OntModelAnswerstrueif the model has a graph with the given uri both inowl:importsand graph-hierarchy. -
removeImport
Description copied from interface:OntModelRemoves 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 (seeOntModel.hasImport(OntModel)description).- Specified by:
removeImportin interfaceOntModel- Parameters:
m-ont jena modelto remove, notnull- Returns:
- this model to allow cascading calls
- See Also:
-
removeImport
Description copied from interface:OntModelRemoves the import (bothowl:importdeclaration and the corresponding graph) by the given uri if it is found.- Specified by:
removeImportin 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:OntModelLists 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. -
imports
Lists all top-level sub-models built with the givenpersonality.- Parameters:
personality-OntPersonality, notnull- Returns:
StreamofOntModels
-
listImportModels
public final org.apache.jena.util.iterator.ExtendedIterator<OntGraphModelImpl> listImportModels(OntPersonality personality, org.apache.jena.reasoner.Reasoner reasoner) Listsmodel impls with the specifiedpersonalityfrom the top tier of the imports' hierarchy.- Parameters:
personality-OntPersonality, notnullreasoner-Reasoner, can benull- Returns:
- non-distinct
ExtendedIteratorofOntGraphModelImpls
-
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:
independentin interfaceorg.apache.jena.rdf.model.Model- Overrides:
independentin classorg.apache.jena.rdf.model.impl.ModelCom- Returns:
trueif this model is independent of others
-
isBuiltIn
Answerstrueif the given entity is built-in.- Type Parameters:
E- subtype ofOntObjectImplandOntEntity- Parameters:
e-OntEntityobject impl- Returns:
- boolean
-
ontObjects
Retrieves the stream ofOntology Objects. 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 Objects 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:OntModelLists 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.- Specified by:
ontEntitiesin interfaceOntModel- Returns:
StreamofOntEntity- See Also:
-
listOntEntities
Lists all Ontology Entities. Built-ins are not included.- Returns:
Extended IteratorofOntEntitys- See Also:
-
listLocalOntEntities
The same aslistOntEntities()but for the base graph.- Returns:
Extended IteratorofOntEntitys- See Also:
-
ambiguousEntities
Gets 'punnings', i.e. theOntEntitys which have not only a single type.- Parameters:
withImports- if it false takes into account only the base model- Returns:
StreamofOntEntitys.
-
individuals
Description copied from interface:OntModelLists 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 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:sameAsis 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: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.- Specified by:
individualsin interfaceOntModel- Returns:
StreamofOntIndividuals- See Also:
-
listIndividuals
Returns anExtendedIteratorover all individuals that participate in class assertion statementa rdf:type C.- Returns:
ExtendedIteratorofOntIndividuals
-
hierarchyRoots
Description copied from interface:OntModelAnswers aStreamover the classes in this ontology model that represent the uppermost nodes of the class hierarchy. Built-ins are not included.- Specified by:
hierarchyRootsin interfaceOntModel- Returns:
- a
Streamof the rootclassesin the local class hierarchy
-
listHierarchyRoots
-
getOntEntity
Description copied from interface:OntModelReturns 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:
getOntEntityin interfaceOntModel- Type Parameters:
E- type of OntEntity- Parameters:
type-Class, the type ofOntEntity, notnulluri- String, notnull- Returns:
OntEntityornull- See Also:
-
createOntEntity
Description copied from interface:OntModelCreates an owl-entity by thetypeandiri.- Specified by:
createOntEntityin interfaceOntModel- Type Parameters:
T- type of ont-entity- Parameters:
type-Class, the type ofOntEntity, notnulliri- 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 benullfor anonymous resource- Returns:
OntObject, new instance- Throws:
OntJenaException.Unsupported- profile mismatch
-
removeOntObject
Description copied from interface:OntModelRemoves 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.- Specified by:
removeOntObjectin interfaceOntModel- Parameters:
obj-OntObject- Returns:
- this model
- See Also:
-
removeOntStatement
Description copied from interface:OntModelRemoves the statement from the graph-model including its annotations with sub-annotations hierarchy.- Specified by:
removeOntStatementin interfaceOntModel- Parameters:
statement-OntStatement- Returns:
- this model
- See Also:
-
Model.remove(Statement)
-
statements
Description copied from interface:OntModelLists all ont-statements.- Specified by:
statementsin interfaceOntModel- Returns:
StreamofOntStatement- 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:OntModelLists all statements for the specified subject, predicate and object (SPO).- Specified by:
statementsin interfaceOntModel- Parameters:
s-Resource, the subjectp-Property, the predicateo-RDFNode, the object- Returns:
StreamofOntStatement- 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:OntModelLists all statements from thebase graphfor the specified subject, predicate and object. Effectively equivalent to themodel.statements(s, p, o).filter(OntStatement::isLocal)expression.- Specified by:
localStatementsin interfaceOntModel- Parameters:
s-Resource, the subjectp-Property, the predicateo-RDFNode, the object- Returns:
StreamofOntStatement- 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:
listStatementsin interfaceorg.apache.jena.rdf.model.Model- Overrides:
listStatementsin classorg.apache.jena.rdf.model.impl.ModelCom- Parameters:
s-Resourcethe subject sought, can benullp-Propertythe predicate sought, can benullo-RDFNodethe object sought, can benull- Returns:
StmtIteratorofOntStatements
-
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 iteratorover all the statements in the model that match a pattern. The statements selected are those whose subject matches thesargument, whose predicate matches thepargument and whose object matches theoargument. If an argument isnullit matches anything. The method is equivalent to the expressionlistStatements(s, p, o).mapWith(OntStatement.class::cast).- Parameters:
s-Resourcethe subject sought, can benullp-Propertythe predicate sought, can benullo-RDFNodethe object sought, can benull- Returns:
ExtendedIteratorofOntStatements- 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-Resourcethe subject sought, can benullp-Propertythe predicate sought, can benullo-RDFNodethe object sought, can benull- Returns:
ExtendedIteratorofOntStatements, 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:
createStatementin interfaceorg.apache.jena.rdf.model.Model- Overrides:
createStatementin classorg.apache.jena.rdf.model.impl.ModelCom
-
asStatement
Description copied from interface:OntModelAnswers anOntology Statementin this model who's SPO is that of thetriple.- Specified by:
asStatementin interfaceorg.apache.jena.rdf.model.ModelGraphInterface- Specified by:
asStatementin interfaceOntModel- Overrides:
asStatementin 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, withnullallowed to represent a wildcard match.- Parameters:
s- -Resource- the subject of the statement tested (nullas wildcard)p- -Property- the predicate of the statement tested (nullas wildcard)o- -RDFNode- the object of the statement tested (nullas 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[]-listasONT-list.- Type Parameters:
E- anyRDFNode- Parameters:
list-RDFList, notnullsubject-OntObject, notnullpredicate-Property, notnulltype- 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[]-listasONT-list.- Type Parameters:
E- anyRDFNode- Parameters:
list-RDFList, notnullsubject-OntObject, notnullpredicate-Property, notnullcheckRecursions- boolean, iftruemore careful and expensive checking for list content is performedlistType- an uri-Resource, used as an archaic RDF-type, usually this parameter should benullelementType- 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, notnullpredicate-Property, notnulltype- aClass-type for elementE, notnullelements- andIteratorofE-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, notnullpredicate-Property, notnulllistType- an uri-Resource, used as an archaic RDF-type, usually this parameter should benullelementType- aClass-type for elementE, notnullelements- andIteratorofE-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:typeand SPO.- Parameters:
t-Resourceeitherowl:Axiomorowl:Annotations-Resourcesubjectp-Propertypredicateo-RDFNodeobject- Returns:
ExtendedIteratorof annotationresources
-
deleteOntList
public OntGraphModelImpl deleteOntList(OntObject subject, org.apache.jena.rdf.model.Property predicate, OntList<?> object) Deletes the specifiedOntListincluding 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:OntModelCreates 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:
createFacetRestrictionin interfaceOntModel- Type Parameters:
T- type of ont-facet-restriction- Parameters:
view-Class, the type ofOntFacetRestriction, notnullliteral-Literal, notnull- Returns:
OntFacetRestriction- See Also:
-
OntDataRange.RestrictionCreateRanges.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:
setNsPrefixin interfaceorg.apache.jena.rdf.model.Model- Specified by:
setNsPrefixin interfaceorg.apache.jena.shared.PrefixMapping- Overrides:
setNsPrefixin classorg.apache.jena.rdf.model.impl.ModelCom
-
removeNsPrefix
- Specified by:
removeNsPrefixin interfaceorg.apache.jena.rdf.model.Model- Specified by:
removeNsPrefixin interfaceorg.apache.jena.shared.PrefixMapping- Overrides:
removeNsPrefixin classorg.apache.jena.rdf.model.impl.ModelCom
-
clearNsPrefixMap
- Specified by:
clearNsPrefixMapin interfaceorg.apache.jena.rdf.model.Model- Specified by:
clearNsPrefixMapin interfaceorg.apache.jena.shared.PrefixMapping- Overrides:
clearNsPrefixMapin classorg.apache.jena.rdf.model.impl.ModelCom
-
setNsPrefixes
- Specified by:
setNsPrefixesin interfaceorg.apache.jena.rdf.model.Model- Specified by:
setNsPrefixesin interfaceorg.apache.jena.shared.PrefixMapping- Overrides:
setNsPrefixesin classorg.apache.jena.rdf.model.impl.ModelCom
-
lock
- Specified by:
lockin interfaceorg.apache.jena.shared.PrefixMapping- Overrides:
lockin classorg.apache.jena.rdf.model.impl.ModelCom
-
add
- Specified by:
addin interfaceorg.apache.jena.rdf.model.Model- Overrides:
addin classorg.apache.jena.rdf.model.impl.ModelCom
-
remove
- Specified by:
removein interfaceorg.apache.jena.rdf.model.Model- Overrides:
removein 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:
addin interfaceorg.apache.jena.rdf.model.ModelCon- Overrides:
addin 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:
removein interfaceorg.apache.jena.rdf.model.ModelCon- Overrides:
removein classorg.apache.jena.rdf.model.impl.ModelCom
-
add
- Specified by:
addin interfaceorg.apache.jena.rdf.model.Model- Overrides:
addin classorg.apache.jena.rdf.model.impl.ModelCom
-
remove
- Specified by:
removein interfaceorg.apache.jena.rdf.model.ModelCon- Overrides:
removein classorg.apache.jena.rdf.model.impl.ModelCom
-
add
- Specified by:
addin interfaceorg.apache.jena.rdf.model.Model- Overrides:
addin classorg.apache.jena.rdf.model.impl.ModelCom
-
remove
- Specified by:
removein interfaceorg.apache.jena.rdf.model.ModelCon- Overrides:
removein classorg.apache.jena.rdf.model.impl.ModelCom
-
add
- Specified by:
addin interfaceorg.apache.jena.rdf.model.Model- Overrides:
addin classorg.apache.jena.rdf.model.impl.ModelCom
-
remove
- Specified by:
removein interfaceorg.apache.jena.rdf.model.Model- Overrides:
removein classorg.apache.jena.rdf.model.impl.ModelCom
-
add
- Specified by:
addin interfaceorg.apache.jena.rdf.model.Model- Overrides:
addin classorg.apache.jena.rdf.model.impl.ModelCom
-
remove
- Specified by:
removein interfaceorg.apache.jena.rdf.model.Model- Overrides:
removein 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:
removeAllin interfaceorg.apache.jena.rdf.model.Model- Overrides:
removeAllin classorg.apache.jena.rdf.model.impl.ModelCom
-
removeAll
- Specified by:
removeAllin interfaceorg.apache.jena.rdf.model.Model- Overrides:
removeAllin 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:
addLiteralin interfaceorg.apache.jena.rdf.model.ModelCon- Overrides:
addLiteralin 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:
addLiteralin interfaceorg.apache.jena.rdf.model.ModelCon- Overrides:
addLiteralin 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:
addLiteralin interfaceorg.apache.jena.rdf.model.ModelCon- Overrides:
addLiteralin 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:
addLiteralin interfaceorg.apache.jena.rdf.model.ModelCon- Overrides:
addLiteralin 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:
addLiteralin interfaceorg.apache.jena.rdf.model.ModelCon- Overrides:
addLiteralin 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:
addLiteralin interfaceorg.apache.jena.rdf.model.ModelCon- Overrides:
addLiteralin 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:
addLiteralin interfaceorg.apache.jena.rdf.model.ModelCon- Overrides:
addLiteralin 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:
addin interfaceorg.apache.jena.rdf.model.ModelCon- Overrides:
addin 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:
addin interfaceorg.apache.jena.rdf.model.ModelCon- Overrides:
addin 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:
addin interfaceorg.apache.jena.rdf.model.ModelCon- Overrides:
addin classorg.apache.jena.rdf.model.impl.ModelCom
-
read
- Specified by:
readin interfaceorg.apache.jena.rdf.model.Model- Overrides:
readin classorg.apache.jena.rdf.model.impl.ModelCom
-
read
- Specified by:
readin interfaceorg.apache.jena.rdf.model.Model- Overrides:
readin classorg.apache.jena.rdf.model.impl.ModelCom
-
read
- Specified by:
readin interfaceorg.apache.jena.rdf.model.Model- Overrides:
readin classorg.apache.jena.rdf.model.impl.ModelCom
-
read
- Specified by:
readin interfaceorg.apache.jena.rdf.model.Model- Overrides:
readin classorg.apache.jena.rdf.model.impl.ModelCom
-
read
- Specified by:
readin interfaceorg.apache.jena.rdf.model.Model- Overrides:
readin classorg.apache.jena.rdf.model.impl.ModelCom
-
read
- Specified by:
readin interfaceorg.apache.jena.rdf.model.Model- Overrides:
readin classorg.apache.jena.rdf.model.impl.ModelCom
-
read
- Specified by:
readin interfaceorg.apache.jena.rdf.model.Model- Overrides:
readin classorg.apache.jena.rdf.model.impl.ModelCom
-
write
- Specified by:
writein interfaceorg.apache.jena.rdf.model.Model- Overrides:
writein classorg.apache.jena.rdf.model.impl.ModelCom
-
write
- Specified by:
writein interfaceorg.apache.jena.rdf.model.Model- Overrides:
writein classorg.apache.jena.rdf.model.impl.ModelCom
-
write
- Specified by:
writein interfaceorg.apache.jena.rdf.model.Model- Overrides:
writein classorg.apache.jena.rdf.model.impl.ModelCom
-
write
- Specified by:
writein interfaceorg.apache.jena.rdf.model.Model- Overrides:
writein classorg.apache.jena.rdf.model.impl.ModelCom
-
write
- Specified by:
writein interfaceorg.apache.jena.rdf.model.Model- Overrides:
writein classorg.apache.jena.rdf.model.impl.ModelCom
-
write
- Specified by:
writein interfaceorg.apache.jena.rdf.model.Model- Overrides:
writein classorg.apache.jena.rdf.model.impl.ModelCom
-
writeAll
-
writeAll
-
writeAll
-
writeAll
-
getRDFSComment
- Specified by:
getRDFSCommentin interfaceOntModel
-
getRDFSLabel
- Specified by:
getRDFSLabelin interfaceOntModel
-
getOWLThing
- Specified by:
getOWLThingin interfaceOntModel
-
getRDFSLiteral
- Specified by:
getRDFSLiteralin interfaceOntModel
-
getOWLNothing
- Specified by:
getOWLNothingin interfaceOntModel
-
getOWLTopObjectProperty
- Specified by:
getOWLTopObjectPropertyin interfaceOntModel
-
getOWLBottomObjectProperty
- Specified by:
getOWLBottomObjectPropertyin interfaceOntModel
-
getOWLTopDataProperty
- Specified by:
getOWLTopDataPropertyin interfaceOntModel
-
getOWLBottomDataProperty
- Specified by:
getOWLBottomDataPropertyin interfaceOntModel
-
getReasoner
public org.apache.jena.reasoner.Reasoner getReasoner()Returns theReasonerwhich is being used to answer queries to this graph ornullif reasoner is not supported by the model.- Specified by:
getReasonerin 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:
setDerivationLoggingin 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:
getDerivationin interfaceorg.apache.jena.rdf.model.InfModel- Parameters:
statement-Statementto get derivation information- Returns:
- an iterator over
Derivationrecords ornullif there is no derivation information available for this triple - See Also:
-
Derivation
-
getInfGraph
public org.apache.jena.reasoner.InfGraph getInfGraph()ReturnsInfGraphornullif 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:
rebindin 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:
preparein 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:
resetin 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:
validatein interfaceorg.apache.jena.rdf.model.InfModel- Returns:
- a
ValidityReportstructure
-
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:
listStatementsin 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:OntModelReturns a view of this model that supports inference, if possible.- Specified by:
asInferenceModelin 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:
getDeductionsModelin 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:
getRawModelin 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 aRDFNodefor 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:
findNodeAsin interfaceOntEnhGraph- Type Parameters:
N- any subtype ofRDFNode- Parameters:
node-Nodetype-Class-type- Returns:
RDFNodeornull- 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:
getNodeAsin interfaceOntEnhGraph- Overrides:
getNodeAsin 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:
safeFindNodeAsin 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
nullif 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 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.- 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.- 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:
-