java.lang.Object
org.apache.jena.enhanced.EnhGraph
org.apache.jena.rdf.model.impl.ModelCom
org.apache.jena.rdf.model.impl.InfModelImpl
- All Implemented Interfaces:
InfModel
,Model
,ModelCon
,ModelGraphInterface
,RDFReaderF
,RDFWriterF
,Lock
,PrefixMapping
Default implementation of the InfModel interface which simply wraps up
an InfGraph.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jena.shared.PrefixMapping
PrefixMapping.Factory, PrefixMapping.IllegalPrefixException, PrefixMapping.JenaLockedException
-
Field Summary
Fields inherited from interface org.apache.jena.shared.PrefixMapping
Extended, Standard
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns a derivations model.getDerivation
(Statement statement) Return the derivation of the given statement (which should be the result of some previous list operation).Return the underlying inference graph for this model.Return the raw RDF model being processed (i.e. the argument to the Reasoner.bind call that created this InfModel).Return the Reasoner which is being used to answer queries to this graph.listStatements
(Resource subject, Property predicate, RDFNode object, Model posit) Find all the statements matching a pattern.void
prepare()
Perform any initial processing and caching.void
rebind()
Cause the inference model to reconsult the underlying data to take into account changes.void
reset()
Reset any internal caches.void
setDerivationLogging
(boolean logOn) Switch on/off drivation logging.validate()
Test the consistency of the underlying data.Methods inherited from class org.apache.jena.rdf.model.impl.ModelCom
abort, adapt, add, add, add, add, add, add, add, add, add, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addNamespaces, asModel, asNode, asRDFNode, asStatement, asStatements, asStatements, asStatements, begin, calculateInTxn, clearNsPrefixMap, 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, 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, independent, 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, lock, notifyEvent, numPrefixes, qnameFor, read, read, read, read, read, read, read, register, reifiedToString, remove, remove, remove, remove, remove, remove, removeAll, removeAll, removeNsPrefix, samePrefixMappingAs, setNsPrefix, setNsPrefixes, setNsPrefixes, shortForm, size, supportsSetOperations, supportsTransactions, toString, union, unregister, withDefaultMappings, wrapAsResource, write, write, write, write, write, write
Methods inherited from class org.apache.jena.enhanced.EnhGraph
asGraph, equals, getNodeAs, hashCode, isIsomorphicWith
Methods inherited from interface org.apache.jena.shared.Lock
enterCriticalSection, leaveCriticalSection
Methods inherited from interface org.apache.jena.rdf.model.Model
abort, add, add, add, add, add, begin, calculateInTxn, clearNsPrefixMap, close, commit, contains, contains, contains, containsAll, containsAll, containsAny, containsAny, containsResource, createList, createList, createList, createLiteral, createProperty, createResource, createResource, createResource, createResource, createStatement, createTypedLiteral, createTypedLiteral, createTypedLiteral, difference, equals, executeInTxn, getLock, getProperty, getProperty, getProperty, getReader, getRequiredProperty, getRequiredProperty, getResource, getResource, getWriter, independent, intersection, isClosed, isEmpty, isIsomorphicWith, listNameSpaces, listObjects, listObjectsOfProperty, listObjectsOfProperty, listResourcesWithProperty, listResourcesWithProperty, listStatements, listStatements, listSubjects, listSubjectsWithProperty, listSubjectsWithProperty, notifyEvent, read, read, read, read, read, read, read, register, remove, remove, remove, removeAll, removeAll, removeNsPrefix, setNsPrefix, setNsPrefixes, setNsPrefixes, size, supportsSetOperations, supportsTransactions, union, unregister, withDefaultMappings, write, write, write, write, write, write
Methods inherited from interface org.apache.jena.rdf.model.ModelCon
add, add, add, add, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, 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, remove, remove, remove
Methods inherited from interface org.apache.jena.rdf.model.ModelGraphInterface
asRDFNode, asStatement, getGraph, wrapAsResource
Methods inherited from interface org.apache.jena.shared.PrefixMapping
expandPrefix, getNsPrefixMap, getNsPrefixURI, getNsURIPrefix, hasNoMappings, lock, numPrefixes, qnameFor, samePrefixMappingAs, shortForm
-
Constructor Details
-
InfModelImpl
Constructor.- Parameters:
infgraph
- the InfGraph, as generated by a reasoner.bind operation, to be packaged up.
-
-
Method Details
-
getInfGraph
Return the underlying inference graph for this model. -
getRawModel
Return the raw RDF model being processed (i.e. the argument to the Reasoner.bind call that created this InfModel).- Specified by:
getRawModel
in interfaceInfModel
-
getReasoner
Return the Reasoner which is being used to answer queries to this graph.- Specified by:
getReasoner
in interfaceInfModel
-
rebind
public void rebind()Cause 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 InfModels's back" and this forces a full reconsult of the changed data. -
prepare
public void prepare()Perform any initial processing and caching. This call is optional. Most engines either have negligable 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. -
reset
public void reset()Reset 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 rebind. -
validate
Test the consistency of the underlying data. This normally tests the validity of the bound instance data against the bound schema data. -
listStatements
public StmtIterator listStatements(Resource subject, Property predicate, RDFNode object, Model posit) Find all the statements matching a pattern.Return an iterator over all the statements in a model that match a pattern. The statements selected are those whose subject matches the
subject
argument, whose predicate matches thepredicate
argument and whose object matchestheobject
argument. If an argument isnull
it matches anything.The s/p/o 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 interfaceInfModel
- Parameters:
subject
- The subject soughtpredicate
- The predicate soughtobject
- The value sought- Returns:
- an iterator over the subjects
-
setDerivationLogging
public void setDerivationLogging(boolean logOn) Switch on/off drivation logging. If this is switched on then every time an inference is a made that fact is recorded and the resulting record can be access through a later getDerivation call. This may consume a lot of space!- Specified by:
setDerivationLogging
in interfaceInfModel
-
getDerivation
Return the derivation of the given statement (which should be the result of some previous list operation). Not all reasoneers will support derivations.- Specified by:
getDerivation
in interfaceInfModel
- Returns:
- an iterator over Derivation records or null if there is no derivation information available for this triple.
- See Also:
-
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 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 interfaceInfModel
- Returns:
- the deductions model, if relevant for this class of inference engine or null if not.
-