Class GraphImpl
- java.lang.Object
-
- org.apache.commons.rdf.simple.GraphImpl
-
-
Field Summary
Fields Modifier and Type Field Description private SimpleRDF
factory
private static int
TO_STRING_MAX
private java.util.Set<Triple>
triples
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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
add(Triple triple)
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
contains(Triple triple)
Checks if graph contains triple.private java.util.stream.Stream<Triple>
getTriples(java.util.function.Predicate<Triple> filter)
private Triple
internallyMap(Triple triple)
private <T extends RDFTerm>
RDFTerminternallyMap(T object)
void
remove(BlankNodeOrIRI subject, IRI predicate, RDFTerm object)
Removes a concrete pattern of triples from the graph.void
remove(Triple triple)
Removes a concrete triple from the graph.long
size()
Number of triples contained by the graph.java.util.stream.Stream<Triple>
stream()
Gets all triples contained by the graph.java.util.stream.Stream<Triple>
stream(BlankNodeOrIRI subject, IRI predicate, RDFTerm object)
Gets all triples contained by the graph matched with the pattern.java.lang.String
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 Detail
-
TO_STRING_MAX
private static final int TO_STRING_MAX
- See Also:
- Constant Field Values
-
triples
private final java.util.Set<Triple> triples
-
factory
private final SimpleRDF factory
-
-
Constructor Detail
-
GraphImpl
GraphImpl(SimpleRDF simpleRDF)
-
-
Method Detail
-
add
public void add(BlankNodeOrIRI subject, IRI predicate, RDFTerm object)
Description copied from interface:Graph
Adds a triple to the graph, possibly mapping any of the components to those supported by this Graph.
-
add
public void add(Triple triple)
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.
-
clear
public void clear()
Description copied from interface:Graph
Clears the graph, removing all triples.
-
contains
public boolean contains(BlankNodeOrIRI subject, IRI predicate, RDFTerm object)
Description copied from interface:Graph
Checks if graph contains a pattern of triples.
-
contains
public boolean contains(Triple triple)
Description copied from interface:Graph
Checks if graph contains triple.
-
stream
public java.util.stream.Stream<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
public java.util.stream.Stream<Triple> stream(BlankNodeOrIRI subject, IRI predicate, RDFTerm object)
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
private java.util.stream.Stream<Triple> getTriples(java.util.function.Predicate<Triple> filter)
-
remove
public void remove(BlankNodeOrIRI subject, IRI predicate, RDFTerm object)
Description copied from interface:Graph
Removes a concrete pattern of triples from the graph.
-
remove
public void remove(Triple triple)
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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-