Class VerySimpleRdfsBackwardsChainingConnection
java.lang.Object
org.eclipse.rdf4j.sail.helpers.SailConnectionWrapper
org.eclipse.rdf4j.sail.shacl.wrapper.data.VerySimpleRdfsBackwardsChainingConnection
- All Implemented Interfaces:
AutoCloseable, FederatedServiceResolverClient, ThreadSafetyAware, SailConnection
Very simple RDFS backwardschaining connection that supports type inference on hasStatement and getStatement. It does
not support inference for SPARQL queries.
-
Constructor Summary
ConstructorsConstructorDescriptionVerySimpleRdfsBackwardsChainingConnection(SailConnection wrappedCon, RdfsSubClassOfReasoner rdfsSubClassOfReasoner) VerySimpleRdfsBackwardsChainingConnection(SailConnection wrappedCon, RdfsSubClassOfReasoner rdfsSubClassOfReasoner, boolean includeInferredStatements) -
Method Summary
Modifier and TypeMethodDescriptionCloseableIteration<? extends Statement> getStatements(Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) Gets all statements from the specified contexts that have a specific subject, predicate and/or object.booleanhasStatement(Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) Determines if the store contains any statements from the specified contexts that have a specific subject, predicate and/or object.Methods inherited from class SailConnectionWrapper
addStatement, addStatement, begin, begin, clear, clearNamespaces, close, commit, endUpdate, evaluate, explain, flush, getComparator, getContextIDs, getFederatedServiceResolver, getNamespace, getNamespaces, getStatements, getSupportedOrders, getWrappedConnection, isActive, isOpen, prepare, prepareQuery, removeNamespace, removeStatement, removeStatements, rollback, setFederatedServiceResolver, setNamespace, setTransactionSettings, size, size, startUpdate, supportsConcurrentReadsModifier and TypeMethodDescriptionvoidaddStatement(Resource subj, IRI pred, Value obj, Resource... contexts) Adds a statement to the store.voidaddStatement(UpdateContext modify, Resource subj, IRI pred, Value obj, Resource... contexts) Adds a statement to the store.voidbegin()Begins a transaction requiringSailConnection.commit()orSailConnection.rollback()to be called to close the transaction.voidbegin(IsolationLevel level) Begins a transaction with the specifiedIsolationLevellevel, requiringSailConnection.commit()orSailConnection.rollback()to be called to close the transaction.voidRemoves all statements from the specified/all contexts.voidRemoves all namespace declarations from the repository.voidclose()Closes the connection.voidcommit()Commits any updates that have been performed since the last timeSailConnection.commit()orSailConnection.rollback()was called.voidendUpdate(UpdateContext modify) Indicates that the givenopwill not be used in any call again.CloseableIteration<? extends BindingSet> evaluate(TupleExpr tupleExpr, Dataset dataset, BindingSet bindings, boolean includeInferred) Evaluates the supplied TupleExpr on the data contained in this Sail object, using the (optional) dataset and supplied bindings as input parameters.explain(Explanation.Level level, TupleExpr tupleExpr, Dataset dataset, BindingSet bindings, boolean includeInferred, int timeoutSeconds) Explain how the TupleExpr will be (or has been) executed/evaluated by returning a TupleExpr (which may or may not be the provided TupleExpr) that has gone through zero or more of the stages prior to and also including execution as specified by the provided level.voidflush()Flushes any pending updates and notify changes to listeners as appropriate.Different underlying datastructures may have different ways of ordering statements.CloseableIteration<? extends Resource> Returns the set of all unique context identifiers that are used to store statements.Gets theFederatedServiceResolverused by this client.getNamespace(String prefix) Gets the namespace that is associated with the specified prefix, if any.CloseableIteration<? extends Namespace> Gets the namespaces relevant to the data contained in this Sail object.CloseableIteration<? extends Statement> getStatements(StatementOrder statementOrder, Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) Gets all statements from the specified contexts that have a specific subject, predicate and/or object.getSupportedOrders(Resource subj, IRI pred, Value obj, Resource... contexts) The underlying store may support some, but not all, statement orders based on the statement pattern.Gets the connection that is wrapped by this object.booleanisActive()Indicates if a transaction is currently active on the connection.booleanisOpen()Checks whether this SailConnection is open.voidprepare()Checks for an error state in the active transaction that would force the transaction to be rolled back.prepareQuery(QueryLanguage ql, Query.QueryType type, String query, String baseURI) Allows the SailConnection to bypass the standard query parser and provide its own internalTupleExprimplementation.voidremoveNamespace(String prefix) Removes a namespace declaration by removing the association between a prefix and a namespace name.voidremoveStatement(UpdateContext modify, Resource subj, IRI pred, Value obj, Resource... contexts) Removes all statements matching the specified subject, predicate and object from the repository.voidremoveStatements(Resource subj, IRI pred, Value obj, Resource... contexts) Removes all statements matching the specified subject, predicate and object from the repository.voidrollback()Rolls back the transaction, discarding any uncommitted changes that have been made in this SailConnection.voidSets theFederatedServiceResolverto use for this client.voidsetNamespace(String prefix, String name) Sets the prefix for a namespace.voidsetTransactionSettings(TransactionSetting... settings) Pass any transaction-specific settings to the SailConnection.longlongReturns the number of (explicit) statements in the store, or in specific contexts.voidstartUpdate(UpdateContext modify) Signals the start of an update operation.booleanA class may support concurrent reads from multiple threads against the same object.
-
Constructor Details
-
VerySimpleRdfsBackwardsChainingConnection
public VerySimpleRdfsBackwardsChainingConnection(SailConnection wrappedCon, RdfsSubClassOfReasoner rdfsSubClassOfReasoner) -
VerySimpleRdfsBackwardsChainingConnection
public VerySimpleRdfsBackwardsChainingConnection(SailConnection wrappedCon, RdfsSubClassOfReasoner rdfsSubClassOfReasoner, boolean includeInferredStatements)
-
-
Method Details
-
hasStatement
public boolean hasStatement(Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) throws SailException Description copied from interface:SailConnectionDetermines if the store contains any statements from the specified contexts that have a specific subject, predicate and/or object. All three parameters may be null to indicate wildcards. The includeInferred parameter can be used to control which statements are checked: all statements or only the statements that have been added explicitly.- Specified by:
hasStatementin interfaceSailConnection- Overrides:
hasStatementin classSailConnectionWrapper- Parameters:
subj- A Resource specifying the subject, or null for a wildcard.pred- An IRI specifying the predicate, or null for a wildcard.obj- A Value specifying the object, or null for a wildcard.includeInferred- if false, no inferred statements are returned; if true, inferred statements are returned if availablecontexts- The context(s) to get the data from. Note that this parameter is a vararg and as such is optional. If no contexts are specified the method operates on the entire repository. A null value can be used to match context-less statements.- Returns:
trueiff the store contains any statements matching the supplied criteria,falseotherwise.- Throws:
SailException- If the Sail object encountered an error or unexpected situation internally.
-
getStatements
public CloseableIteration<? extends Statement> getStatements(Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) throws SailException Description copied from interface:SailConnectionGets all statements from the specified contexts that have a specific subject, predicate and/or object. All three parameters may be null to indicate wildcards. The includeInferred parameter can be used to control which statements are fetched: all statements or only the statements that have been added explicitly.- Specified by:
getStatementsin interfaceSailConnection- Overrides:
getStatementsin classSailConnectionWrapper- Parameters:
subj- A Resource specifying the subject, or null for a wildcard.pred- A URI specifying the predicate, or null for a wildcard.obj- A Value specifying the object, or null for a wildcard.includeInferred- if false, no inferred statements are returned; if true, inferred statements are returned if availablecontexts- The context(s) to get the data from. Note that this parameter is a vararg and as such is optional. If no contexts are specified the method operates on the entire repository. A null value can be used to match context-less statements.- Returns:
- The statements matching the specified pattern.
- Throws:
SailException- If the Sail object encountered an error or unexpected situation internally.
-