eu.larkc.core.data
Class DataSetImpl

java.lang.Object
  extended by eu.larkc.core.data.DataSetImpl
All Implemented Interfaces:
DataSet, InformationSet, SetOfStatements, java.io.Serializable

public class DataSetImpl
extends java.lang.Object
implements DataSet

Default implementation of a data set.

Author:
vassil
See Also:
Serialized Form

Constructor Summary
DataSetImpl(SPARQLEndpoint endpoint, java.util.Collection<org.openrdf.model.URI> defaultGraphs, java.util.Collection<org.openrdf.model.URI> namedGraphs)
          Instantiates a new data set impl.
 
Method Summary
 void addAll(DataSet ds)
          Merges the current dataset with another one
 boolean equals(java.lang.Object o)
           
 java.util.Set<RdfGraph> getDefaultGraphs()
          Gets the default graph URIs of this dataset.
 java.util.Set<RdfGraph> getNamedGraphs()
          Gets the named graph URIs of this dataset.
 SPARQLEndpoint getSPARQLEndpoint()
          Get the SPARQL endpoint responsible for this dataset.
 CloseableIterator<org.openrdf.model.Statement> getStatements()
          Iterates the statements.
 int hashCode()
           
 SetOfStatements toRDF(SetOfStatements data)
          Serializes this object to SetOfStatements.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataSetImpl

public DataSetImpl(SPARQLEndpoint endpoint,
                   java.util.Collection<org.openrdf.model.URI> defaultGraphs,
                   java.util.Collection<org.openrdf.model.URI> namedGraphs)
Instantiates a new data set impl.

Parameters:
endpoint - the endpoint
defaultGraphs - the default graphs
namedGraphs - the named graphs
Method Detail

addAll

public void addAll(DataSet ds)
Description copied from interface: DataSet
Merges the current dataset with another one

Specified by:
addAll in interface DataSet
Parameters:
ds - to be merged with

getDefaultGraphs

public java.util.Set<RdfGraph> getDefaultGraphs()
Description copied from interface: DataSet
Gets the default graph URIs of this dataset. An empty set indicates that the default graph is an empty graph.

Specified by:
getDefaultGraphs in interface DataSet
Returns:
a reference to the default graphs

getNamedGraphs

public java.util.Set<RdfGraph> getNamedGraphs()
Description copied from interface: DataSet
Gets the named graph URIs of this dataset. An empty set indicates that there are no named graphs in this dataset.

Specified by:
getNamedGraphs in interface DataSet
Returns:
a reference to the named graphs

getSPARQLEndpoint

public SPARQLEndpoint getSPARQLEndpoint()
Description copied from interface: DataSet
Get the SPARQL endpoint responsible for this dataset.

Specified by:
getSPARQLEndpoint in interface DataSet
Returns:
a SPARQL ednpoint to contains it

getStatements

public CloseableIterator<org.openrdf.model.Statement> getStatements()
Description copied from interface: SetOfStatements
Iterates the statements.

Specified by:
getStatements in interface SetOfStatements
Returns:
closeableiterator over the statements.s

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toRDF

public SetOfStatements toRDF(SetOfStatements data)
Description copied from interface: InformationSet
Serializes this object to SetOfStatements.

Specified by:
toRDF in interface InformationSet
Parameters:
data - is stream to serialize this object to.
Returns:
reference to the set of statements that contains the serialized data.