Interface StorageConnector
- All Superinterfaces:
Closeable
,StatementExecutor
,Wrapper
- All Known Implementing Classes:
ChangeTrackingStorageConnector
,SharedStorageConnector
,SnapshotStorageConnector
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the specified statements to the specified context in the storage.void
begin()
Begins a transaction.void
close()
Closes this resource releasing any sub-resources it holds.void
commit()
Commits the current transaction.boolean
contains
(org.apache.jena.rdf.model.Resource subject, org.apache.jena.rdf.model.Property property, org.apache.jena.rdf.model.RDFNode value, Collection<String> contexts) Checks whether the specified context (named graph) contains any statements matching the specified criteria.Collection<org.apache.jena.rdf.model.Statement>
find
(org.apache.jena.rdf.model.Resource subject, org.apache.jena.rdf.model.Property property, org.apache.jena.rdf.model.RDFNode value, Collection<String> contexts) Retrieves statements corresponding to the specified criteria from the specified named graph.Lists all contexts (named graph) in the repository (including the transactional ones).void
Removes the specified statements from the specified context in the storage.void
remove
(org.apache.jena.rdf.model.Resource subject, org.apache.jena.rdf.model.Property property, org.apache.jena.rdf.model.RDFNode object, String context) Removes statements matching the specified pattern from the specified storage context.void
Removes all property values specified by the provided argument for the specified subject(s).void
rollback()
Rolls back the current transaction.Methods inherited from interface cz.cvut.kbss.ontodriver.jena.connector.StatementExecutor
executeAskQuery, executeSelectQuery, executeUpdate
-
Method Details
-
begin
void begin()Begins a transaction. -
commit
Commits the current transaction.- Throws:
JenaDriverException
- If commit fails
-
rollback
void rollback()Rolls back the current transaction. -
find
Collection<org.apache.jena.rdf.model.Statement> find(org.apache.jena.rdf.model.Resource subject, org.apache.jena.rdf.model.Property property, org.apache.jena.rdf.model.RDFNode value, Collection<String> contexts) Retrieves statements corresponding to the specified criteria from the specified named graph.The first three parameters are optional, their absence signifies that any value in that position is acceptable.
contexts
are also optional, their absence means that the default graph should be used.- Parameters:
subject
- Statement subject, optionalproperty
- Property, optionalvalue
- Value, optionalcontexts
- Named graph IRIs, optional. If empty, the default graph will be used- Returns:
- Collection of matching statements
-
contains
boolean contains(org.apache.jena.rdf.model.Resource subject, org.apache.jena.rdf.model.Property property, org.apache.jena.rdf.model.RDFNode value, Collection<String> contexts) Checks whether the specified context (named graph) contains any statements matching the specified criteria.The first three parameters are optional, their absence signifies that any value in that position is acceptable.
context
is also optional, its absence means that the default graph should be used.- Parameters:
subject
- Subject, optionalproperty
- Property, optionalvalue
- Value, optionalcontexts
- Named graph IRIs, optional. If empty, the default graph will be used- Returns:
true
if at least one statement matches the criteria,false
otherwise
-
getContexts
Lists all contexts (named graph) in the repository (including the transactional ones).- Returns:
- List of named graph URIs
-
add
Adds the specified statements to the specified context in the storage.Requires an active transaction.
context
is optional, its absence means that the statements will be added into the the default graph.- Parameters:
statements
- Statements to addcontext
- Target context, optional
-
remove
Removes the specified statements from the specified context in the storage.Requires an active transaction.
context
is optional, its absence means that the statements will be removed from the the default graph.- Parameters:
statements
- Statements to removecontext
- Target context, optional
-
remove
void remove(org.apache.jena.rdf.model.Resource subject, org.apache.jena.rdf.model.Property property, org.apache.jena.rdf.model.RDFNode object, String context) Removes statements matching the specified pattern from the specified storage context.context
is optional, its absence means that the statements will be removed from the the default graph.- Parameters:
subject
- Statement subject, optionalproperty
- Statement property, optionalobject
- Statement object, optionalcontext
- Repository context IRI, optional
-
removePropertyValues
Removes all property values specified by the provided argument for the specified subject(s).- Parameters:
spc
- Subject-predicate-contexts tuples
-
close
Description copied from interface:Closeable
Closes this resource releasing any sub-resources it holds.After closing the resource is not usable any more and calling methods on it (except
close
andisOpen
) will result inIllegalStateException
.Calling
close
on already closed resource does nothing.- Specified by:
close
in interfaceCloseable
- Throws:
JenaDriverException
-