de.fuberlin.wiwiss.d2rq.sesame
Class D2RQSource

java.lang.Object
  extended by de.fuberlin.wiwiss.d2rq.sesame.D2RQSource
All Implemented Interfaces:
org.openrdf.sesame.sail.RdfSource, org.openrdf.sesame.sail.Sail

public class D2RQSource
extends Object
implements org.openrdf.sesame.sail.RdfSource

Implementation of the Sesame RdfSource Interface for D2RQ This class wraps the D2RQGraph into an implementation of the Sesame RdfSource interface.

Author:
Oliver Maresch (oliver-maresch@gmx.de)

Constructor Summary
D2RQSource(String d2rqMapUrl, String language, String baseURI)
          Creates a new instance of D2RQSource
 
Method Summary
 org.openrdf.sesame.sail.NamespaceIterator getNamespaces()
          Returns all know namespaces within the source.
 org.openrdf.sesame.sail.StatementIterator getStatements(org.openrdf.model.Resource resource, org.openrdf.model.URI uRI, org.openrdf.model.Value value)
          Maps the call of the Sesame RdfSource.getStatement interface to the Jena Graph.find(spo) interface and returns an implemenation of the Sesame StatementIterator, which wraps the results of the Jena Graph interface.
 org.openrdf.model.ValueFactory getValueFactory()
          Rerturns the ValueFactory of the RdfSource.
 boolean hasStatement(org.openrdf.model.Resource resource, org.openrdf.model.URI uRI, org.openrdf.model.Value value)
          Returns true, if the source contains the specified statement.
 void initialize(Map configParams)
          Initialize the repository.
 org.openrdf.sesame.sail.query.Query optimizeQuery(org.openrdf.sesame.sail.query.Query query)
          Optimize queries (no opitmization in this implementation)
 void shutDown()
          Shuts down the repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

D2RQSource

public D2RQSource(String d2rqMapUrl,
                  String language,
                  String baseURI)
           throws D2RQException
Creates a new instance of D2RQSource

Parameters:
d2rqMapUrl - URL of the mapping file for D2RQ
language - Identifies the format of the rdf data in the mapping file. Should be one of the values "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value, represented by null, is "RDF/XML".
Throws:
D2RQException
Method Detail

getNamespaces

public org.openrdf.sesame.sail.NamespaceIterator getNamespaces()
Returns all know namespaces within the source.

Specified by:
getNamespaces in interface org.openrdf.sesame.sail.RdfSource
Returns:
interator over all known namespaces

getStatements

public org.openrdf.sesame.sail.StatementIterator getStatements(org.openrdf.model.Resource resource,
                                                               org.openrdf.model.URI uRI,
                                                               org.openrdf.model.Value value)
Maps the call of the Sesame RdfSource.getStatement interface to the Jena Graph.find(spo) interface and returns an implemenation of the Sesame StatementIterator, which wraps the results of the Jena Graph interface.

Specified by:
getStatements in interface org.openrdf.sesame.sail.RdfSource

getValueFactory

public org.openrdf.model.ValueFactory getValueFactory()
Rerturns the ValueFactory of the RdfSource.

Specified by:
getValueFactory in interface org.openrdf.sesame.sail.RdfSource
Returns:
the ValueFactory

hasStatement

public boolean hasStatement(org.openrdf.model.Resource resource,
                            org.openrdf.model.URI uRI,
                            org.openrdf.model.Value value)
Returns true, if the source contains the specified statement.

Specified by:
hasStatement in interface org.openrdf.sesame.sail.RdfSource
Parameters:
resource - the RDF resource of the subject
uRI - the URI of the statment property
value - the RDF resource of the object
Returns:
true, if the sourec contains the specified statement, false otherwise

initialize

public void initialize(Map configParams)
                throws org.openrdf.sesame.sail.SailInitializationException
Initialize the repository.

Specified by:
initialize in interface org.openrdf.sesame.sail.Sail
Parameters:
configParams -
Throws:
org.openrdf.sesame.sail.SailInitializationException

optimizeQuery

public org.openrdf.sesame.sail.query.Query optimizeQuery(org.openrdf.sesame.sail.query.Query query)
Optimize queries (no opitmization in this implementation)

Specified by:
optimizeQuery in interface org.openrdf.sesame.sail.RdfSource
Parameters:
query - the unoptimized query
Returns:
the optimized query

shutDown

public void shutDown()
Shuts down the repository.

Specified by:
shutDown in interface org.openrdf.sesame.sail.Sail