eu.larkc.core.data
Class LabelledGroupOfStatementsImpl

java.lang.Object
  extended by eu.larkc.core.data.LabelledGroupOfStatementsImpl
All Implemented Interfaces:
InformationSet, LabelledGroupOfStatements, SetOfStatements, java.io.Serializable
Direct Known Subclasses:
SetOfStatementsMerger

public class LabelledGroupOfStatementsImpl
extends java.lang.Object
implements LabelledGroupOfStatements

Author:
vassil
See Also:
Serialized Form

Constructor Summary
LabelledGroupOfStatementsImpl(RdfStoreConnection con)
          Constructor
LabelledGroupOfStatementsImpl(org.openrdf.model.URI label, RdfStoreConnection con, boolean validate)
          Constructor
 
Method Summary
 boolean equals(java.lang.Object o)
           
 boolean excludeStatement(org.openrdf.model.Resource subj, org.openrdf.model.URI pred, org.openrdf.model.Value obj, org.openrdf.model.URI graph)
          Excludes a statement from the labeled group.
 boolean excludeStatement(org.openrdf.model.Statement s)
          Excludes a statement from the labeled group.
 org.openrdf.model.URI getLabel()
          Returns the name of the group label.
 RdfStoreConnection getRdfStoreConnection()
          Gets the RDF store connection to contains the labeled group.
 CloseableIterator<org.openrdf.model.Statement> getStatements()
          Iterates the statements.
 int hashCode()
           
 boolean includeStatement(org.openrdf.model.Resource subj, org.openrdf.model.URI pred, org.openrdf.model.Value obj, org.openrdf.model.URI graph)
          Includes a new statement to the labeled group
 boolean includeStatement(org.openrdf.model.Statement s)
          Includes a statement to the labeled group.
 SetOfStatements toRDF(SetOfStatements data)
          Serializes this object to SetOfStatements.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelledGroupOfStatementsImpl

public LabelledGroupOfStatementsImpl(RdfStoreConnection con)
Constructor

Parameters:
con - connection to a local repository where the labelled group of statements is created.

LabelledGroupOfStatementsImpl

public LabelledGroupOfStatementsImpl(org.openrdf.model.URI label,
                                     RdfStoreConnection con,
                                     boolean validate)
Constructor

Parameters:
label - is explicit named of the labelled group of statements.
con - connection to a local repository
validate - if this group already exists
Method Detail

excludeStatement

public boolean excludeStatement(org.openrdf.model.Resource subj,
                                org.openrdf.model.URI pred,
                                org.openrdf.model.Value obj,
                                org.openrdf.model.URI graph)
Description copied from interface: LabelledGroupOfStatements
Excludes a statement from the labeled group.

Specified by:
excludeStatement in interface LabelledGroupOfStatements
Parameters:
subj - of the statement to be excluded (may be null for wildcards)
pred - of the statement to be excluded (may be null for wildcards)
obj - of the statement to be excluded (may be null for wildcards)
graph - of the statement to be excleded (may be null for wildcards)
Returns:
if any statements were excluded

excludeStatement

public boolean excludeStatement(org.openrdf.model.Statement s)
Description copied from interface: LabelledGroupOfStatements
Excludes a statement from the labeled group.

Specified by:
excludeStatement in interface LabelledGroupOfStatements
Parameters:
s - to be excluded
Returns:
if any statements were excluded

getLabel

public org.openrdf.model.URI getLabel()
Description copied from interface: LabelledGroupOfStatements
Returns the name of the group label.

Specified by:
getLabel in interface LabelledGroupOfStatements
Returns:
label

getRdfStoreConnection

public RdfStoreConnection getRdfStoreConnection()
Description copied from interface: LabelledGroupOfStatements
Gets the RDF store connection to contains the labeled group.

Specified by:
getRdfStoreConnection in interface LabelledGroupOfStatements
Returns:
connection to RDF store to contains the labeled group

includeStatement

public boolean includeStatement(org.openrdf.model.Resource subj,
                                org.openrdf.model.URI pred,
                                org.openrdf.model.Value obj,
                                org.openrdf.model.URI graph)
Description copied from interface: LabelledGroupOfStatements
Includes a new statement to the labeled group

Specified by:
includeStatement in interface LabelledGroupOfStatements
Parameters:
subj - of the statement to be included (may be null for wildcards)
pred - of the statement to be included (may be null for wildcards)
obj - of the statement to be included (may be null for wildcards)
graph - of the statement to be included (may be null for wildcards)
Returns:
if any statements were associated

includeStatement

public boolean includeStatement(org.openrdf.model.Statement s)
Description copied from interface: LabelledGroupOfStatements
Includes a statement to the labeled group.

Specified by:
includeStatement in interface LabelledGroupOfStatements
Parameters:
s - to be added
Returns:
if any statements were associated

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

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.