org.d2rq
Class SystemLoader

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

public class SystemLoader
extends Object

Factory for MappingGenerators, ModelD2RQs and the like. Many of these artifacts can be configured in multiple ways (from the command line, from configuration files, etc.), and creating one may require that others are previously created and configured correctly. This class helps setting everything up correctly. TODO: D2RQReader.absolutizeURI(String) and ConfigLoader.toAbsoluteURI(String) and {WebappInitListener#absolutize} need to be consolidated and/or folded into this class

Author:
Richard Cyganiak (richard@cyganiak.de)

Field Summary
static String DEFAULT_BASE_URI
           
static String DEFAULT_JDBC_URL
           
 
Constructor Summary
SystemLoader()
           
 
Method Summary
 void close()
          Closes any created SQLConnections and any other created resources.
static CompiledMapping createMapping(Model mappingModel, String baseIRI)
           
 D2RServer getD2RServer()
           
 Graph getGraphD2RQ()
           
 JettyLauncher getJettyLauncher()
           
 CompiledMapping getMapping()
           
 MappingGenerator getMappingGenerator()
           
 Model getMappingModel()
           
 Model getModelD2RQ()
           
 int getPort()
           
 R2RMLReader getR2RMLReader()
           
 String getResourceBaseURI()
           
 ConfigLoader getServerConfig()
           
 SQLConnection getSQLConnection()
           
 String getSystemBaseURI()
           
static CompiledMapping loadMapping(String mappingFileNameOrURL, String baseIRI)
           
 void resetMappingFile()
           
 void setFastMode(boolean flag)
           
 void setFilter(Filter filter)
           
 void setGenerateW3CDirectMapping(boolean flag)
           
 void setJDBCDriverClass(String driver)
           
 void setJdbcURL(String jdbcURL)
           
 void setMappingFile(String mappingFile)
           
 void setMappingFileOrJdbcURL(String value)
           
 void setMappingModel(Model mapModel)
           
 void setPassword(String password)
           
 void setPort(int port)
           
 void setResourceStem(String value)
          By default, the base URI for resolving relative URIs in data is the same as the system base URI where the server is assumed to run.
 void setStartupSQLScript(String sqlFile)
           
 void setSystemBaseURI(String baseURI)
           
 void setUsername(String username)
           
 void setUseServerConfig(boolean flag)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_BASE_URI

public static final String DEFAULT_BASE_URI
See Also:
Constant Field Values

DEFAULT_JDBC_URL

public static final String DEFAULT_JDBC_URL
See Also:
Constant Field Values
Constructor Detail

SystemLoader

public SystemLoader()
Method Detail

loadMapping

public static CompiledMapping loadMapping(String mappingFileNameOrURL,
                                          String baseIRI)

createMapping

public static CompiledMapping createMapping(Model mappingModel,
                                            String baseIRI)

setUsername

public void setUsername(String username)

setPassword

public void setPassword(String password)

setFilter

public void setFilter(Filter filter)

setJDBCDriverClass

public void setJDBCDriverClass(String driver)

setStartupSQLScript

public void setStartupSQLScript(String sqlFile)

setGenerateW3CDirectMapping

public void setGenerateW3CDirectMapping(boolean flag)

setJdbcURL

public void setJdbcURL(String jdbcURL)

setMappingFileOrJdbcURL

public void setMappingFileOrJdbcURL(String value)

setUseServerConfig

public void setUseServerConfig(boolean flag)

setSystemBaseURI

public void setSystemBaseURI(String baseURI)

setResourceStem

public void setResourceStem(String value)
By default, the base URI for resolving relative URIs in data is the same as the system base URI where the server is assumed to run. The resource stem can be set to something like resource/ in order to put the resources into a subdirectory of the system base.

Parameters:
value - A string relative to the system base URI

getSystemBaseURI

public String getSystemBaseURI()
Returns:
Base URI where the server is assumed to run

getResourceBaseURI

public String getResourceBaseURI()
Returns:
Base URI for making relative URIs in the RDF data absolute

setPort

public void setPort(int port)

getPort

public int getPort()

setFastMode

public void setFastMode(boolean flag)

setMappingFile

public void setMappingFile(String mappingFile)

getSQLConnection

public SQLConnection getSQLConnection()

getMappingGenerator

public MappingGenerator getMappingGenerator()

setMappingModel

public void setMappingModel(Model mapModel)

getMappingModel

public Model getMappingModel()

getMapping

public CompiledMapping getMapping()

getR2RMLReader

public R2RMLReader getR2RMLReader()

getModelD2RQ

public Model getModelD2RQ()

getGraphD2RQ

public Graph getGraphD2RQ()

getJettyLauncher

public JettyLauncher getJettyLauncher()

getServerConfig

public ConfigLoader getServerConfig()

getD2RServer

public D2RServer getD2RServer()

resetMappingFile

public void resetMappingFile()

close

public void close()
Closes any created SQLConnections and any other created resources.