eu.larkc.core.data
Class DataFactoryImpl

java.lang.Object
  extended by eu.larkc.core.data.DataFactoryImpl
All Implemented Interfaces:
DataFactory

public class DataFactoryImpl
extends java.lang.Object
implements DataFactory

This is a dummy factory to abstract ORDI creation specifics.

Author:
vassil

Field Summary
static long REFERENCE_TYPES_CACHE_TIME
           
static java.lang.String REFERENCE_TYPES_CACHE_TIME_PROP
           
 
Fields inherited from interface eu.larkc.core.data.DataFactory
INSTANCE, LARKC_NS
 
Method Summary
 AttributeValueMap createAttributeValueList(SetOfStatements rdf)
          TODO Describe the purpose of this method.
 AttributeValueMap createAttributeValueList(SetOfStatements rdf, org.openrdf.model.URI invocationID)
          ------ Methods to handle arguments as Attribute/value lists.
 RdfGraph createRdfGraph(java.lang.Iterable<org.openrdf.model.Statement> sts, org.openrdf.model.URI graph)
          Creates a RDF graph that will be passed by value.
 RdfGraph createRdfGraph(SetOfStatements rdf)
          NEW METHODS
 RdfGraph createRdfGraph(SetOfStatements rdf, org.openrdf.model.URI invocationID)
          Create RdfGraph from RDF data.
 RdfStoreConnection createRdfStoreConnection()
          Creates a connection to local storage.
 RdfGraph createRemoteRdfGraph(org.openrdf.model.URI uri)
          Creates RDF graph from a remote location.
 SPARQLEndpoint createSPARQLEndpoint(org.openrdf.model.URI uri)
          Create a connection to remote SPARQL endpoint.
 SPARQLQuery createSPARQLQuery(SetOfStatements rdf)
          Create SPARQLQuery from RDF data.
 SPARQLQuery createSPARQLQuery(SetOfStatements rdf, org.openrdf.model.URI invocationID)
          Create SPARQLQuery from RDF data.
 SPARQLQuery createSPARQLQuery(java.lang.String query)
          Create a SPARQL query from a string
 SPARQLQuery createSPARQLQuery(java.lang.String query, java.lang.String ns, org.openrdf.model.URI label)
          Creates a SPARQL query from a string to be executed against a specific labeled group.
 SPARQLQuery createSPARQLQuery(java.lang.String query, org.openrdf.model.URI label)
          Creates a SPARQL query from a string to be executed against a specific labeled group.
 VariableBinding createVariableBinding(SetOfStatements rdf)
          TODO Describe the purpose of this method.
 VariableBinding createVariableBinding(SetOfStatements rdf, org.openrdf.model.URI invocationID)
          TODO Describe the purpose of this method.
 VariableBindingBase createVariableBindingBase(SetOfStatements sts)
          TODO Gets VariableBindings for the SetOfStatements FIXME: This is using the cheating object store
static DataFactoryImpl getInstance()
           
 SetOfStatements parseGraph(java.io.File file, java.lang.String nameSpace)
          TODO Describe the purpose of this method.
 RdfGraph setNamedGraph(SetOfStatements input, org.openrdf.model.URI newName)
          Sets the name of the graph for the given SetOfStatements.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REFERENCE_TYPES_CACHE_TIME_PROP

public static java.lang.String REFERENCE_TYPES_CACHE_TIME_PROP

REFERENCE_TYPES_CACHE_TIME

public static long REFERENCE_TYPES_CACHE_TIME
Method Detail

getInstance

public static DataFactoryImpl getInstance()

createVariableBindingBase

public VariableBindingBase createVariableBindingBase(SetOfStatements sts)
TODO Gets VariableBindings for the SetOfStatements FIXME: This is using the cheating object store

Parameters:
sts -
Returns:

createRdfGraph

public RdfGraph createRdfGraph(java.lang.Iterable<org.openrdf.model.Statement> sts,
                               org.openrdf.model.URI graph)
Creates a RDF graph that will be passed by value.

Specified by:
createRdfGraph in interface DataFactory
Parameters:
graph - name (may be null)
sts - collection of the statements
Returns:
the graph

createRemoteRdfGraph

public RdfGraph createRemoteRdfGraph(org.openrdf.model.URI uri)
Creates RDF graph from a remote location. If the URI could not be resolved an exception will be generated during the construction of the graph.

Specified by:
createRemoteRdfGraph in interface DataFactory
Parameters:
uri - to be resolved
Returns:
the constructed rdf graph

createRdfStoreConnection

public RdfStoreConnection createRdfStoreConnection()
Creates a connection to local storage.

Specified by:
createRdfStoreConnection in interface DataFactory
Returns:
a connection to the local store

createSPARQLEndpoint

public SPARQLEndpoint createSPARQLEndpoint(org.openrdf.model.URI uri)
Create a connection to remote SPARQL endpoint. If the URI is not resolvable or SPARQL enabled service could not be found an exception will be generated after constructing the object.

Specified by:
createSPARQLEndpoint in interface DataFactory
Parameters:
uri -
Returns:

createSPARQLQuery

public SPARQLQuery createSPARQLQuery(java.lang.String query)
Description copied from interface: DataFactory
Create a SPARQL query from a string

Specified by:
createSPARQLQuery in interface DataFactory
Parameters:
query - to be parsed
Returns:
executable query by a SPARQL endpoint

createSPARQLQuery

public SPARQLQuery createSPARQLQuery(java.lang.String query,
                                     org.openrdf.model.URI label)
Description copied from interface: DataFactory
Creates a SPARQL query from a string to be executed against a specific labeled group. The labeled group for now could not be specified as part of the syntax like the dataset in FROM/FROM NAMED clauses.

Specified by:
createSPARQLQuery in interface DataFactory
Parameters:
query - to be parsed
label - labeled group to be used (may be null)
Returns:
executable query by a SPARQL endpoint

createSPARQLQuery

public SPARQLQuery createSPARQLQuery(java.lang.String query,
                                     java.lang.String ns,
                                     org.openrdf.model.URI label)
Description copied from interface: DataFactory
Creates a SPARQL query from a string to be executed against a specific labeled group. The labeled group for now could not be specified as part of the syntax like the dataset in FROM/FROM NAMED clauses.

Specified by:
createSPARQLQuery in interface DataFactory
Parameters:
query - to be parsed
ns - default namespace to be used in the expansion of the short qname in query
label - labeled group to be used (may be null)
Returns:
executable query by a SPARQL endpoint

createRdfGraph

public RdfGraph createRdfGraph(SetOfStatements rdf)
NEW METHODS

Specified by:
createRdfGraph in interface DataFactory
Returns:
null or the RdfGraph

createRdfGraph

public RdfGraph createRdfGraph(SetOfStatements rdf,
                               org.openrdf.model.URI invocationID)
Description copied from interface: DataFactory
Create RdfGraph from RDF data.

Specified by:
createRdfGraph in interface DataFactory
Returns:
null or the RdfGraph

createSPARQLQuery

public SPARQLQuery createSPARQLQuery(SetOfStatements rdf)
Description copied from interface: DataFactory
Create SPARQLQuery from RDF data.

Specified by:
createSPARQLQuery in interface DataFactory
Returns:
null or the SPARQLQuery

createSPARQLQuery

public SPARQLQuery createSPARQLQuery(SetOfStatements rdf,
                                     org.openrdf.model.URI invocationID)
Description copied from interface: DataFactory
Create SPARQLQuery from RDF data.

Specified by:
createSPARQLQuery in interface DataFactory
Returns:
null or the SPARQLQuery

createAttributeValueList

public AttributeValueMap createAttributeValueList(SetOfStatements rdf,
                                                  org.openrdf.model.URI invocationID)
------ Methods to handle arguments as Attribute/value lists. TODO: They are slightly evil from a KR perspective.

Specified by:
createAttributeValueList in interface DataFactory
Returns:
null or AttributeValueMap

createAttributeValueList

public AttributeValueMap createAttributeValueList(SetOfStatements rdf)
Description copied from interface: DataFactory
TODO Describe the purpose of this method.

Specified by:
createAttributeValueList in interface DataFactory
Returns:
null or AttributeValueMap

createVariableBinding

public VariableBinding createVariableBinding(SetOfStatements rdf)
Description copied from interface: DataFactory
TODO Describe the purpose of this method.

Specified by:
createVariableBinding in interface DataFactory
Returns:
null or variable binding

createVariableBinding

public VariableBinding createVariableBinding(SetOfStatements rdf,
                                             org.openrdf.model.URI invocationID)
Description copied from interface: DataFactory
TODO Describe the purpose of this method.

Specified by:
createVariableBinding in interface DataFactory
Returns:
null or variable binding

setNamedGraph

public RdfGraph setNamedGraph(SetOfStatements input,
                              org.openrdf.model.URI newName)
Description copied from interface: DataFactory
Sets the name of the graph for the given SetOfStatements. Old values are overwritten

Specified by:
setNamedGraph in interface DataFactory
Returns:
a graph with the given name and data

parseGraph

public SetOfStatements parseGraph(java.io.File file,
                                  java.lang.String nameSpace)
                           throws org.openrdf.rio.RDFParseException,
                                  org.openrdf.rio.RDFHandlerException,
                                  java.io.FileNotFoundException,
                                  java.io.IOException
Description copied from interface: DataFactory
TODO Describe the purpose of this method.

Specified by:
parseGraph in interface DataFactory
Returns:
Throws:
org.openrdf.rio.RDFParseException
org.openrdf.rio.RDFHandlerException
java.io.FileNotFoundException
java.io.IOException