Interface StorageRDF
- All Known Implementing Classes:
StorageSimpleMem,StorageTuples
DatasetGraph or any of it's
derived classes and it just concerned with Triples and Quads, not
Graphs nor prefixes.
Storage is split into the triples for the default graph and quads for the named graphs.
In find(Node, Node, Node, Node) (find on the named graphs),
null for the graph slot does not match the default graph.
Concrete and Pattern Operations.
Various API operations work on "concrete" terms. For example, add. These are
marked "concrete operation" in their javadoc. They are not matching operations. A
concrete term is one of a URI, blank node or literal. It is not null,
Node.ANY nor a named variable. Any Triple or Quad must be
composed of concrete terms.
A pattern operation is one where the arguments are concrete terms or wildcard
ANY. Such an operation will match zero or more triples or quads.
Any Triple or Quad can use ANY.
Pattern operations do not match named variables.
Using Node.ANY rather than null is preferred in pattern operations but
both are acceptable.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a triple to the default graph.voidAdd to a named graph.default voidAdd a triple to the default graph.default voidAdd a quad.booleanTest whether the default graph contains the triple.booleanTest whether any named graph matches the quad.default booleanTest whether the default graph contains the triple.default booleanTest whether any named graph matches the quad.voidDelete from the default graph.voidDelete from a named graph.default voidDelete a triple from the default graph.default voidDelete a quad from the default graph.Find in the default graph.Find in named graphs: does not look in the default graph.Find in the default graph.Find in named graphs: does not look in the default graph.findUnionGraph(Node s, Node p, Node o) Find in the union graph (union of all named graphs, not the default graph).default voidDelete all triples matching afind-like pattern.default voidDelete all quads matching afind-like pattern.Find in the default graph.Find in named graphs: does not look in the default graph.Find in the default graph.Find in named graphs: does not look in the default graph.streamUnionGraph(Node s, Node p, Node o)
-
Method Details
-
add
Add a triple to the default graph.Concrete operation.
-
add
Add a quad.Concrete operation.
-
delete
Delete a triple from the default graph.Concrete operation.
-
delete
Delete a quad from the default graph. All terms are concrete, and notNode#ANY. For delete-by-pattern, seeremoveAll(Node, Node, Node, Node).Concrete operation.
-
add
Add a triple to the default graph.Concrete operation.
-
add
Add to a named graph.Concrete operation.
-
delete
Delete from the default graph.s,p,oare all concrete.Concrete operation.
See
removeAll(Node, Node, Node)for remove by pattern. -
delete
Delete from a named graph.s,p,oare all concrete.Concrete operation.
See
removeAll(Node, Node, Node, Node)for remove by pattern. -
removeAll
Delete all triples matching afind-like pattern.Pattern operation.
-
removeAll
Delete all quads matching afind-like pattern.Pattern operation.
-
findUnionGraph
Find in the union graph (union of all named graphs, not the default graph). An RDF graph is a set of triples - the union graph does not shows duplicates even if more than one named graph contains a given triple.- Implementation Note:
- The default implementation of this operation involves the use of
Stream.distinct()which is a stateful intermediate operation. Without additional internal knowledge, it is necessary to remember all triples in the stream so far to know whether the next triple is a duplicate or not. This can be a significant amount of intermediate space.An implementation may be able to exploit its internal representation to means that this operation can be implemented more efficient, for example, knowing that duplicate triples (same triple, from different graphs) will be adjacent in the stream so not requires the full cost of
distinctto remove duplicates.Pattern operation.
-
find
Find in named graphs: does not look in the default graph.Pattern operation.
-
find
Find in named graphs: does not look in the default graph.Pattern operation.
-
find
Find in the default graph.Pattern operation.
-
find
Find in the default graph.Pattern operation.
-
streamUnionGraph
-
stream
Find in named graphs: does not look in the default graph.Pattern operation.
-
stream
Find in named graphs: does not look in the default graph.Pattern operation.
-
stream
Find in the default graph.Pattern operations.
-
stream
Find in the default graph.Pattern operation.
-
contains
Test whether the default graph contains the triple.Pattern operation.
Equivalent to
find(triple).hasNext()orstream(triple).findAny().isPresent(). -
contains
Test whether the default graph contains the triple.Pattern operation.
Equivalent to
find(s,p,o).hasNext(). -
contains
Test whether any named graph matches the quad.Pattern operation.
Equivalent to
find(quad).hasNext()orstream(quad).findAny().isPresent(). -
contains
Test whether any named graph matches the quad.Pattern operation.
Equivalent to
find(g,s,p,o).hasNext().
-