Inspecting the Repository
A convenient way to query and inspect the repository is through an interactive shell. In Java 6 for Windows, Linux,
and Solaris, there exists a tool called jrunscript
Java 6 on one of these platforms, you can download
shell for another language, such as
JRuby. However, the syntax varies between shells.
Be sure to set the CLASSPATH environment variable correctly to include all the jars from the application.
Now start the interactive shell using the command:
Just like when writing Java code, you need to import the packages you plan on using. This is done using the following
You can also execute these in the command line by using the '-e' argument followed by the command and then '-f -' to jrunscript.
Run the following commands to open a connection to the repository:
js> factory = new SesameManagerFactory(new ElmoModule(),“devx”,“rdf”))
js> manager = factory.createElmoManager()
OpenRDF Elmo uses the newly standardized SPARQL query language.
To execute a query, run the commands from Listing 3.
Although this shell is useful for arbitrary inspection, it is difficult to get the bigger picture.
However, you can also export the data into RDF/XML (a portable format). With the repository exported you can browse
the contents more interactively in your browser.
js> manager.connection['export'](new RDFXMLWriter(new FileWriter("export.rdf")))