Itql Interpreter

See Also: http://docs.mulgara.org/itqlcommands/, PlosModels?

Starting

There are two ways to run this - via tools rpm or via maven from source tree.

  • tools rpm: /usr/local/topaz/bin/runitql
  • maven: cd head/plosone/libs/runscripts; mvn -o -Prunitql install exec:java
    • To pass arguments via maven, add -Dargs="..."

Of course, you must have mulgara running. There are two ways to do this too - in production/staging or via maven.

  • production: add -Mhost:port to indicate where mulgara is running
  • maven: cd head; mvn ant-tasks:mulgara-start
    • This assumes mvn ant-tasks:mulgara-install was run at least once
    • mulgara-start recreates the database everytime unless -Dtopaz.mulgara.databaseDir=<dir> is specified

Init File

runitql will look for any startup commands in ~/.runitql. I recommend the following:

%mode = "table reduce quote"
.alias set a http:///www.w3.org/2000/10/annotation-ns#
.meta load <jar-file>

Dumping information model

NOTE: The following will work with the new version of Mulgara and not the one currently packaged.

runitql can use the otm's model -> owl capability to dump an information model. For example, to view the PLoS information model, you could do the following:

itql> # Remove any old data
itql> drop <local:///topazproject#metadata>;
itql> # Use otm to generate owl from models (represented as annotated java classes in a jar file)
itql> .meta load otm-models-0.8.jar
itql> # List all the owl classes
itql> .meta classes
itql> # Show the article class
itql> .meta show <topaz:Article>
itql> # Show help on how to use metadata
itql> .help .meta

Notes

  • Please use ".help"
  • The jar file containing relevant plosone meta-data is:

~/.m2/repository/org/plosone/otm-models/version/otm-models-version.jar

  • It has minimal readline support via jline (a pure-java readline library). It is probably missing things you're used too, but it still makes many things easier.
    • history is stored per semicolon terminated itql command, not per line
  • lines that start with ".", "%" and "#" are special. See .help