eu.larkc.core.data
Class RdfStoreConnectionImpl

java.lang.Object
  extended by eu.larkc.core.query.LocalStoreSPARQLService
      extended by eu.larkc.core.data.RdfStoreConnectionImpl
All Implemented Interfaces:
RdfStoreConnection, SPARQLEndpoint

public class RdfStoreConnectionImpl
extends LocalStoreSPARQLService
implements RdfStoreConnection

RdfStoreConnectionImpl is class to implement a connection to local RDF repository.

Author:
vassil

Constructor Summary
RdfStoreConnectionImpl(com.ontotext.ordi.tripleset.TConnection con)
          Constructor
 
Method Summary
 org.openrdf.model.Statement addStatement(org.openrdf.model.Resource subj, org.openrdf.model.URI pred, org.openrdf.model.Value obj, org.openrdf.model.URI graph)
          Adds a new statement.
 org.openrdf.model.Statement addStatement(org.openrdf.model.Resource subj, org.openrdf.model.URI pred, org.openrdf.model.Value obj, org.openrdf.model.URI graph, org.openrdf.model.URI... label)
          Adds a new statement and associated it with a collection of labels.
 boolean associateStatements(org.openrdf.model.Resource subj, org.openrdf.model.URI pred, org.openrdf.model.Value obj, org.openrdf.model.URI graph, org.openrdf.model.URI... labels)
          Associates a statements with a labeled group.
 boolean associateStatements(SPARQLQuery query, org.openrdf.model.URI... ts)
          Associates the statements result of SPARQL CONSTRUCT or DESCRIBE query to a labeled group.
 void close()
          Closes the connection and free all allocated resources.
 LabelledGroupOfStatements createLabelledGroupOfStatements()
          Creates a handle to a labeled group of statements with random name.
 LabelledGroupOfStatements createLabelledGroupOfStatements(org.openrdf.model.URI label)
          Creates a handle to a labeled group of statements.
 boolean deassociateStatements(org.openrdf.model.Resource subj, org.openrdf.model.URI pred, org.openrdf.model.Value obj, org.openrdf.model.URI graph, org.openrdf.model.URI label)
          Deassociates one or more statements from a labeled group.
 org.openrdf.model.ValueFactory getValueFactory()
          Get a factory to create values.
 boolean isClosed()
          Verifies if the current connection is closed.
 int removeStatement(org.openrdf.model.Resource subj, org.openrdf.model.URI pred, org.openrdf.model.Value obj, org.openrdf.model.URI graph)
          Removes statements from the RDF store.
 CloseableIterator<org.openrdf.model.Statement> search(org.openrdf.model.Resource subj, org.openrdf.model.URI pred, org.openrdf.model.Value obj, org.openrdf.model.URI graph, org.openrdf.model.URI label)
          Creates a statement iterator based on simple pattern matching .
 
Methods inherited from class eu.larkc.core.query.LocalStoreSPARQLService
createDataSet, createRdfGraph, executeAsk, executeConstruct, executeSelect
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface eu.larkc.core.data.SPARQLEndpoint
createDataSet, createRdfGraph, executeAsk, executeConstruct, executeSelect
 

Constructor Detail

RdfStoreConnectionImpl

public RdfStoreConnectionImpl(com.ontotext.ordi.tripleset.TConnection con)
Constructor

Parameters:
con - is local ORDI connection
Method Detail

addStatement

public org.openrdf.model.Statement addStatement(org.openrdf.model.Resource subj,
                                                org.openrdf.model.URI pred,
                                                org.openrdf.model.Value obj,
                                                org.openrdf.model.URI graph)
Description copied from interface: RdfStoreConnection
Adds a new statement.

Specified by:
addStatement in interface RdfStoreConnection
Returns:
the newly added statement to the store

addStatement

public org.openrdf.model.Statement addStatement(org.openrdf.model.Resource subj,
                                                org.openrdf.model.URI pred,
                                                org.openrdf.model.Value obj,
                                                org.openrdf.model.URI graph,
                                                org.openrdf.model.URI... label)
Description copied from interface: RdfStoreConnection
Adds a new statement and associated it with a collection of labels.

Specified by:
addStatement in interface RdfStoreConnection
Returns:
the newly added statement to the store

associateStatements

public boolean associateStatements(org.openrdf.model.Resource subj,
                                   org.openrdf.model.URI pred,
                                   org.openrdf.model.Value obj,
                                   org.openrdf.model.URI graph,
                                   org.openrdf.model.URI... labels)
Description copied from interface: RdfStoreConnection
Associates a statements with a labeled group.

Specified by:
associateStatements in interface RdfStoreConnection
Parameters:
subj - is subject of the statement to be associated (may be null)
pred - is predicate of the statement to be associated (may be null)
obj - is object of the statement to be associated (may be null)
graph - is graph of the statement to be associated (may be null)
labels - is label of the group to be associated to
Returns:
true if the operation associated at least one statement

associateStatements

public boolean associateStatements(SPARQLQuery query,
                                   org.openrdf.model.URI... ts)
Description copied from interface: RdfStoreConnection
Associates the statements result of SPARQL CONSTRUCT or DESCRIBE query to a labeled group.

Specified by:
associateStatements in interface RdfStoreConnection
Parameters:
query - is construct or describe SPARQL query
ts - is label of the group
Returns:
true if the operation associated at least one statement

close

public void close()
Description copied from interface: RdfStoreConnection
Closes the connection and free all allocated resources. All subsequent operations will generate exception.

Specified by:
close in interface RdfStoreConnection

isClosed

public boolean isClosed()
Description copied from interface: RdfStoreConnection
Verifies if the current connection is closed.

Specified by:
isClosed in interface RdfStoreConnection
Returns:
true or false

createLabelledGroupOfStatements

public LabelledGroupOfStatements createLabelledGroupOfStatements(org.openrdf.model.URI label)
Description copied from interface: RdfStoreConnection
Creates a handle to a labeled group of statements.

Specified by:
createLabelledGroupOfStatements in interface RdfStoreConnection
Parameters:
label - to be used as name for the new group
Returns:
labeled group of statements

createLabelledGroupOfStatements

public LabelledGroupOfStatements createLabelledGroupOfStatements()
Description copied from interface: RdfStoreConnection
Creates a handle to a labeled group of statements with random name.

Specified by:
createLabelledGroupOfStatements in interface RdfStoreConnection
Returns:
label is a group of statements

deassociateStatements

public boolean deassociateStatements(org.openrdf.model.Resource subj,
                                     org.openrdf.model.URI pred,
                                     org.openrdf.model.Value obj,
                                     org.openrdf.model.URI graph,
                                     org.openrdf.model.URI label)
Description copied from interface: RdfStoreConnection
Deassociates one or more statements from a labeled group.

Specified by:
deassociateStatements in interface RdfStoreConnection
Parameters:
subj - is subject of the statement to be deassociated (may be null)
pred - is predicate of the statement to be deassociated (may be null)
obj - is object of the statement to be deassociated (may be null)
graph - is graph of the statement to be deassociated (may be null)
label - is label of the statement to be deassociated (may be null)
Returns:
true if the operation deassociated at least one statement

getValueFactory

public org.openrdf.model.ValueFactory getValueFactory()
Description copied from interface: RdfStoreConnection
Get a factory to create values.

Specified by:
getValueFactory in interface RdfStoreConnection
Returns:
value factory.

removeStatement

public int removeStatement(org.openrdf.model.Resource subj,
                           org.openrdf.model.URI pred,
                           org.openrdf.model.Value obj,
                           org.openrdf.model.URI graph)
Description copied from interface: RdfStoreConnection
Removes statements from the RDF store.

Specified by:
removeStatement in interface RdfStoreConnection
Parameters:
subj - is subject of the statement to be removed (may be null)
pred - is predicate of the statement to be removed (may be null)
obj - is object of the statement to be removed (may be null)
graph - is graph of the statement to be removed (may be null)
Returns:
the number of removed statements

search

public CloseableIterator<org.openrdf.model.Statement> search(org.openrdf.model.Resource subj,
                                                             org.openrdf.model.URI pred,
                                                             org.openrdf.model.Value obj,
                                                             org.openrdf.model.URI graph,
                                                             org.openrdf.model.URI label)
Description copied from interface: RdfStoreConnection
Creates a statement iterator based on simple pattern matching .

Specified by:
search in interface RdfStoreConnection
Parameters:
subj - is subject of the statements to be matched (may be null)
pred - is predicate of the statements to be matched (may be null)
obj - is object of the statements to be matched (may be null)
graph - is graph of the statements to be matched (may be null)
label - is label of the statements to be matched (may be null)
Returns:
closeable statement iterator