Class GraphImpl
- All Implemented Interfaces:
AutoCloseable
,Graph
,GraphLike<Triple>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) Adds a triple to the graph, possibly mapping any of the components to those supported by this Graph.void
Adds a triple to the graph, possibly mapping any of the components of the Triple to those supported by this Graph.void
clear()
Clears the graph, removing all triples.boolean
contains
(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) Checks if graph contains a pattern of triples.boolean
Checks if graph contains triple.getTriples
(Predicate<Triple> filter) private Triple
internallyMap
(Triple triple) internallyMap
(T object) void
remove
(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) Removes a concrete pattern of triples from the graph.void
Removes a concrete triple from the graph.long
size()
Number of triples contained by the graph.stream()
Gets all triples contained by the graph.stream
(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) Gets all triples contained by the graph matched with the pattern.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.commons.rdf.api.Graph
close, getTriples, getTriples, iterate, iterate
-
Field Details
-
TO_STRING_MAX
private static final int TO_STRING_MAX- See Also:
-
triples
-
factory
-
-
Constructor Details
-
GraphImpl
GraphImpl(SimpleRDF simpleRDF)
-
-
Method Details
-
add
Description copied from interface:Graph
Adds a triple to the graph, possibly mapping any of the components to those supported by this Graph. -
add
Description copied from interface:Graph
Adds a triple to the graph, possibly mapping any of the components of the Triple to those supported by this Graph. -
internallyMap
-
internallyMap
-
clear
public void clear()Description copied from interface:Graph
Clears the graph, removing all triples. -
contains
Description copied from interface:Graph
Checks if graph contains a pattern of triples. -
contains
Description copied from interface:Graph
Checks if graph contains triple. -
stream
Description copied from interface:Graph
Gets all triples contained by the graph.
The iteration does not contain any duplicate triples, as determined by the
Triple.equals(Object)
method for eachTriple
.The behaviour of the
Stream
is not specified ifGraph.add(Triple)
,Graph.remove(Triple)
orGraph.clear()
are called on theGraph
before it terminates.Implementations may throw
ConcurrentModificationException
from Stream methods if they detect a conflict while the Stream is active. -
stream
Description copied from interface:Graph
Gets all triples contained by the graph matched with the pattern.The iteration does not contain any duplicate triples, as determined by the
Triple.equals(Object)
method for eachTriple
.The behaviour of the
Stream
is not specified ifGraph.add(Triple)
,Graph.remove(Triple)
orGraph.clear()
are called on theGraph
before it terminates.Implementations may throw
ConcurrentModificationException
from Stream methods if they detect a conflict while the Stream is active. -
getTriples
-
remove
Description copied from interface:Graph
Removes a concrete pattern of triples from the graph. -
remove
Description copied from interface:Graph
Removes a concrete triple from the graph. -
size
public long size()Description copied from interface:Graph
Number of triples contained by the graph.The count of a set does not include duplicates, consistent with the
Triple.equals(Object)
equals method for eachTriple
. -
toString
-