de.fuberlin.wiwiss.d2rq
Class GraphD2RQ

java.lang.Object
  extended by com.hp.hpl.jena.graph.impl.GraphBase
      extended by de.fuberlin.wiwiss.d2rq.GraphD2RQ
All Implemented Interfaces:
com.hp.hpl.jena.graph.Graph, com.hp.hpl.jena.graph.GraphAdd, com.hp.hpl.jena.graph.impl.GraphWithPerform
Direct Known Subclasses:
CachingGraphD2RQ

public class GraphD2RQ
extends com.hp.hpl.jena.graph.impl.GraphBase
implements com.hp.hpl.jena.graph.Graph

A D2RQ virtual read-only graph backed by a non-RDF database. D2RQ is a declarative mapping language for describing mappings between ontologies and relational data models. More information about D2RQ is found at: http://www.wiwiss.fu-berlin.de/suhl/bizer/d2rq/

Version:
$Id: GraphD2RQ.java,v 1.40 2006/10/27 15:59:17 cyganiak Exp $
Author:
Chris Bizer chris@bizer.de, Richard Cyganiak (richard@cyganiak.de)

Field Summary
 
Fields inherited from class com.hp.hpl.jena.graph.impl.GraphBase
bulkHandler, closed, gem, pm, queryHandler, reifier, style
 
Fields inherited from interface com.hp.hpl.jena.graph.Graph
emptyGraph
 
Constructor Summary
GraphD2RQ(Mapping mapping)
          Creates a new D2RQ graph from a previously prepared Mapping instance.
GraphD2RQ(com.hp.hpl.jena.rdf.model.Model mapModel, String baseURIForData)
          Creates a new D2RQ graph from a Jena model containing a D2RQ mapping.
 
Method Summary
 com.hp.hpl.jena.rdf.model.Model classMapInventory(String classMapName)
           
 Collection classMapNames()
           
 Collection classMapNamesForResource(com.hp.hpl.jena.graph.Node resource)
           
 void close()
           
 void connect()
          Connects all databases.
 com.hp.hpl.jena.graph.Capabilities getCapabilities()
           
 com.hp.hpl.jena.util.iterator.ExtendedIterator graphBaseFind(com.hp.hpl.jena.graph.TripleMatch m)
           
 void initInventory(String inventoryBaseURI)
           
static boolean isUsingD2RQQueryHandler()
           
 com.hp.hpl.jena.graph.query.QueryHandler queryHandler()
          Returns a QueryHandler for this graph.
static void setUsingD2RQQueryHandler(boolean usingD2RQQueryHandler)
           
 
Methods inherited from class com.hp.hpl.jena.graph.impl.GraphBase
add, checkOpen, contains, contains, containsByFind, delete, dependsOn, find, find, forTestingOnly_graphBaseFind, getBulkUpdateHandler, getEventManager, getPrefixMapping, getReifier, getTransactionHandler, graphBaseContains, graphBaseFind, graphBaseSize, isClosed, isEmpty, isIsomorphicWith, notifyAdd, notifyDelete, performAdd, performDelete, reifierContains, reifierSize, reifierTriples, size, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.hp.hpl.jena.graph.Graph
contains, contains, delete, dependsOn, find, find, getBulkUpdateHandler, getEventManager, getPrefixMapping, getReifier, getTransactionHandler, isClosed, isEmpty, isIsomorphicWith, size
 
Methods inherited from interface com.hp.hpl.jena.graph.GraphAdd
add
 

Constructor Detail

GraphD2RQ

public GraphD2RQ(com.hp.hpl.jena.rdf.model.Model mapModel,
                 String baseURIForData)
          throws D2RQException
Creates a new D2RQ graph from a Jena model containing a D2RQ mapping.

Parameters:
mapModel - the model containing a D2RQ mapping file
baseURIForData - Base URI for turning relative URI patterns into absolute URIs; if null, then D2RQ will pick a base URI
Throws:
D2RQException - on error in the mapping model

GraphD2RQ

public GraphD2RQ(Mapping mapping)
          throws D2RQException
Creates a new D2RQ graph from a previously prepared Mapping instance.

Parameters:
mapping - A D2RQ mapping
Throws:
D2RQException - If the mapping is invalid
Method Detail

isUsingD2RQQueryHandler

public static boolean isUsingD2RQQueryHandler()

setUsingD2RQQueryHandler

public static void setUsingD2RQQueryHandler(boolean usingD2RQQueryHandler)

queryHandler

public com.hp.hpl.jena.graph.query.QueryHandler queryHandler()
Returns a QueryHandler for this graph. The query handler class can be set by the mapping. It then must have exact constructor signature QueryHandler(Graph) For some reasons, Java does not allow to call getConstructor(GraphD2RQ.class) on SimpleQueryHandler class.

Specified by:
queryHandler in interface com.hp.hpl.jena.graph.Graph
Overrides:
queryHandler in class com.hp.hpl.jena.graph.impl.GraphBase
See Also:
Graph.queryHandler()

close

public void close()
Specified by:
close in interface com.hp.hpl.jena.graph.Graph
Overrides:
close in class com.hp.hpl.jena.graph.impl.GraphBase
See Also:
Graph.close()

getCapabilities

public com.hp.hpl.jena.graph.Capabilities getCapabilities()
Specified by:
getCapabilities in interface com.hp.hpl.jena.graph.Graph
Overrides:
getCapabilities in class com.hp.hpl.jena.graph.impl.GraphBase

graphBaseFind

public com.hp.hpl.jena.util.iterator.ExtendedIterator graphBaseFind(com.hp.hpl.jena.graph.TripleMatch m)
Specified by:
graphBaseFind in class com.hp.hpl.jena.graph.impl.GraphBase

connect

public void connect()
Connects all databases. This is done automatically if needed. The method can be used to test the connections earlier.

Throws:
D2RQException - on connection failure

initInventory

public void initInventory(String inventoryBaseURI)

classMapNames

public Collection classMapNames()

classMapInventory

public com.hp.hpl.jena.rdf.model.Model classMapInventory(String classMapName)

classMapNamesForResource

public Collection classMapNamesForResource(com.hp.hpl.jena.graph.Node resource)