org.d2rq.lang
Class D2RQReader

java.lang.Object
  extended by org.d2rq.lang.D2RQReader

public class D2RQReader
extends Object

Creates a Mapping from a Jena model representation of a D2RQ mapping file. TODO: Rewrite using the same logic as R2RMLReader to get better error reporting

Author:
Richard Cyganiak (richard@cyganiak.de)

Field Summary
static String IRI_CHAR_REGEX
          A regular expression that matches zero or more characters that are allowed inside IRIs
 
Constructor Summary
D2RQReader(Model mapModel, String baseURI)
          Constructs a new MapParser from a Jena model containing the RDF statements from a D2RQ mapping file.
 
Method Summary
static String absolutizeURI(String uri)
          Turns a relative URI into an absolute one, by using the current directory's file: URI as a base.
 Mapping getMapping()
          Starts the parsing process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IRI_CHAR_REGEX

public static final String IRI_CHAR_REGEX
A regular expression that matches zero or more characters that are allowed inside IRIs

See Also:
Constant Field Values
Constructor Detail

D2RQReader

public D2RQReader(Model mapModel,
                  String baseURI)
Constructs a new MapParser from a Jena model containing the RDF statements from a D2RQ mapping file.

Parameters:
mapModel - a Jena model containing the RDF statements from a D2RQ mapping file
baseURI - used for relative URI patterns
Method Detail

absolutizeURI

public static String absolutizeURI(String uri)
Turns a relative URI into an absolute one, by using the current directory's file: URI as a base. This uses the same algorithm as Jena's Model class when reading a file.

Parameters:
uri - Any URI
Returns:
An absolute URI corresponding to the input

getMapping

public Mapping getMapping()
Starts the parsing process. Must be called before results can be retrieved from the getter methods.