|
|||||||||||
how to use the adapter | |||||||||||
|
How to use the Sesame - Jena adapter
1. Setup and query a Sesame repository wrapping a Jena model from your code
To create a Sesame repository that wraps a Jena model you can follow these steps (for the sake of simplicity we omit exception handling):
2. Setup a Sesame repository wrapping a Jena model via Sesame system.conf
To use the adapter from a Sesame server, you have to copy the required libraries to your $SESAME_WEBAPP/WEB-INF/lib directory. You can configure the adapter adding your SAIL configuration parameters to the system.conf file of your Sesame server. You can use the Configure Sesame! tool. Just create a new repository, go to the details window and add: sesame_jena_adapter.sesame.sailimpl.jena_adapter.RdfSchemaRepository (or sesame_jena_adapter.sesame.sailimpl.jena_adapter.RdfSchemaSource ,or sesame_jena_adapter.sesame.sailimpl.jena_adapter.RdfSource )to the SAIL stack. You may want to add: org.openrdf.sesame.sailimpl.sync.SyncRdfSchemaRepository on top of it, too. Now add to the sesame_jena_adapter.* SAIL the following parameters: (optional) key: "ontologyLanguage" ; value: one of "RDFS" (default), "OWL", "OWL_DL", "OWL_LITE" and one of: key: "sourceFile" ; value: the path to the file containing the data to load into the Jena model (absolute path is easier to set) or key: "sourceUrl" ; value: an URL used to retrieve the data to laod into the Jena model (may refer to your locally running Sesame server!) Don't forget to set access rights, as they default to no privilege for anyone. Upload the configuration file to your Sesame server, and then you can access your Jena model as if it were a native Sesame repository, using the usual Web interface.
3. Execute RQL and SeRQL queries on a Jena model from your code (Sesame-transparent)
Almost identical to executing RDQL queries:
import sesame_jena_adapter.jena.rql.*; |
||||||||||
Updated on 08 - 05 - 2004 | |||||||||||