Package no.hasmac.rdf.impl
Class RdfDatasetImpl
- java.lang.Object
-
- no.hasmac.rdf.impl.RdfDatasetImpl
-
- All Implemented Interfaces:
RdfConsumer<RdfTriple,RdfNQuad>
,RdfDataset
final class RdfDatasetImpl extends java.lang.Object implements RdfDataset
-
-
Field Summary
Fields Modifier and Type Field Description private RdfGraphImpl
defaultGraph
private java.util.Map<RdfResource,RdfGraphImpl>
graphs
private java.util.List<RdfNQuad>
nquads
-
Constructor Summary
Constructors Modifier Constructor Description protected
RdfDatasetImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RdfDataset
add(RdfNQuad nquad)
AddN-Quad
to the dataset.RdfDataset
add(RdfTriple triple)
Add a triple to default graph.RdfGraph
getDefaultGraph()
java.util.Optional<RdfGraph>
getGraph(RdfResource graphName)
java.util.Set<RdfResource>
getGraphNames()
int
size()
Get the size of the dataset.java.util.List<RdfNQuad>
toList()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface no.hasmac.rdf.RdfDataset
handleQuad, handleTriple
-
-
-
-
Field Detail
-
graphs
private final java.util.Map<RdfResource,RdfGraphImpl> graphs
-
nquads
private final java.util.List<RdfNQuad> nquads
-
defaultGraph
private final RdfGraphImpl defaultGraph
-
-
Method Detail
-
getDefaultGraph
public RdfGraph getDefaultGraph()
- Specified by:
getDefaultGraph
in interfaceRdfDataset
-
toList
public java.util.List<RdfNQuad> toList()
- Specified by:
toList
in interfaceRdfDataset
-
add
public RdfDataset add(RdfNQuad nquad)
Description copied from interface:RdfDataset
AddN-Quad
to the dataset.- Specified by:
add
in interfaceRdfDataset
- Parameters:
nquad
- to add- Returns:
- the same
RdfDataset
instance
-
getGraphNames
public java.util.Set<RdfResource> getGraphNames()
- Specified by:
getGraphNames
in interfaceRdfDataset
-
getGraph
public java.util.Optional<RdfGraph> getGraph(RdfResource graphName)
- Specified by:
getGraph
in interfaceRdfDataset
-
size
public int size()
Description copied from interface:RdfDataset
Get the size of the dataset.- Specified by:
size
in interfaceRdfDataset
- Returns:
- total number of
N-Quads
in the dataset
-
add
public RdfDataset add(RdfTriple triple)
Description copied from interface:RdfDataset
Add a triple to default graph.- Specified by:
add
in interfaceRdfDataset
- Parameters:
triple
- to add- Returns:
- the same
RdfDataset
instance
-
-