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 RdfGraphImpldefaultGraphprivate java.util.Map<RdfResource,RdfGraphImpl>graphsprivate java.util.List<RdfNQuad>nquads
-
Constructor Summary
Constructors Modifier Constructor Description protectedRdfDatasetImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RdfDatasetadd(RdfNQuad nquad)AddN-Quadto the dataset.RdfDatasetadd(RdfTriple triple)Add a triple to default graph.RdfGraphgetDefaultGraph()java.util.Optional<RdfGraph>getGraph(RdfResource graphName)java.util.Set<RdfResource>getGraphNames()intsize()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:
getDefaultGraphin interfaceRdfDataset
-
toList
public java.util.List<RdfNQuad> toList()
- Specified by:
toListin interfaceRdfDataset
-
add
public RdfDataset add(RdfNQuad nquad)
Description copied from interface:RdfDatasetAddN-Quadto the dataset.- Specified by:
addin interfaceRdfDataset- Parameters:
nquad- to add- Returns:
- the same
RdfDatasetinstance
-
getGraphNames
public java.util.Set<RdfResource> getGraphNames()
- Specified by:
getGraphNamesin interfaceRdfDataset
-
getGraph
public java.util.Optional<RdfGraph> getGraph(RdfResource graphName)
- Specified by:
getGraphin interfaceRdfDataset
-
size
public int size()
Description copied from interface:RdfDatasetGet the size of the dataset.- Specified by:
sizein interfaceRdfDataset- Returns:
- total number of
N-Quadsin the dataset
-
add
public RdfDataset add(RdfTriple triple)
Description copied from interface:RdfDatasetAdd a triple to default graph.- Specified by:
addin interfaceRdfDataset- Parameters:
triple- to add- Returns:
- the same
RdfDatasetinstance
-
-