Models

We have unified the disparate ways of creating a Jena Model through similar configuration files. By making a configuration file for each model it prevents minor typos and mis-coordinations from slowing adjustments that may need to be made.

Model Parameters

type - defines which type of jena model

Possible Values:

  • tdb - defines a tdb jena model
  • sdb - defines an sdb jena model
  • rdb - defines an rdb jena model
  • file - defines an rdf file to use as a model

dbDir - the directory to store a tdb model in

(only needed when type is tdb)

Example Values:

  • /absolute/path/to/dir - An absolute path to a directory on linux/unix/macosx operating systems
  • C:/absolute/path/to/dir - An absolute path to a directory on a windows operating system
  • relative/path/to/dir - A path to a directory that is relative to the folder the shell was in when this command was executed

file - the path to the file that contains rdf data

(only needed when type is file)

Example Values:

  • /absolute/path/to/rdf-data.rdf.xml - An absolute path to an rdf file on linux/unix/macosx operating systems
  • C:/absolute/path/to/rdf-data.n3 - An absolute path to an rdf file on a windows operating system
  • relative/path/to/rdf-data.ttl - A path to an rdf file that is relative to the folder the shell was in when this command was executed

rdfLang - the format of the rdf in the file

(optional, only used when type is file)

Possible Values:

  • (default) RDF/XML - rdf/xml format
  • N3 - n3 format
  • TTL - turtle/ttl format
  • N-TRIPLE - n-triple format

dbLayout - the layout to use for an sdb model

(optional, only used when type is sdb)

Possible Values:

  • (default) layout2 - layout2

dbType - the name of the database type (as specified by jena)

(only needed when type is rdb or sdb)

Examples:

  • MySQL - mysql database
  • H2 - h2 database

dbClass - the JDBC driver class to use

(only needed when type is rdb or sdb)

Examples:

  • com.mysql.jdbc.Driver - mysql database
  • org.h2.Driver - h2 database

dbUrl - the JDBC connection url

(only needed when type is rdb or sdb)

Examples:

modelName - the named model to use

(optional, uses default model if not specified, only used when type is rdb, tdb, or sdb )

Examples:

dbUser - the DB username to use

(only needed when type is rdb or sdb)

Example:

  • sa - used for h2 database (the default h2 system admin login)
  • myUser

dbPass - the DB password to use

(only needed when type is rdb or sdb)

Example:

  • - used for h2 database (the default h2 system admin login)
  • myPass

Sample tdb model

	<Param name="type">tdb</Param>
	<Param name="dbDir">data/tdb-jena-rh</Param>

Sample file model

<Config>
	<Param name="type">file</Param>
	<Param name="file">data/file-jena-rh.rdf.n3</Param>
	<Param name="rdfLang">N3</Param>
</Config>

Sample rdb model

<Config>
	<Param name="type">rdb</Param>
	<Param name="dbType">H2</Param>
	<Param name="dbClass">org.h2.Driver</Param>
	<Param name="dbUrl">jdbc:h2:data/jena-model/store</Param>
	<Param name="modelName">mySimpleModelName</Param>
	<Param name="dbUser">sa</Param>
	<Param name="dbPass"></Param>
</Config>

Sample sdb model

<Config>
	<Param name="type">sdb</Param>
	<Param name="dbLayout">layout2</Param>
	<Param name="dbType">H2</Param>
	<Param name="dbClass">org.h2.Driver</Param>
	<Param name="dbUrl">jdbc:h2:data/jena-model/store</Param>
	<Param name="modelName">mySimpleModelName</Param>
	<Param name="dbUser">sa</Param>
	<Param name="dbPass"></Param>
</Config>