Command Line Interface (owcli)
The Onto Wiki Command Line Interface (owcli) is a php-based command line tool to administrate and manipulate Onto Wiki Knowledge Bases.
Installation
Install a command line php5 and pear (on debian/ubuntu: sudo apt-get install php5-cli php5-pear).
Install required pear packages (on debian/ubuntu: sudo pear install Console_Getargs Config).
Download, Install and configure the Onto Wiki Command Line Interface:
Examples
Set the variable OWMODEL (to change the default model):
export OWMODEL=http://localhost/model1#
Drop a model (delete statements, popularities, etc.):
owcli -m http://localhost/model1# --drop
Create a new Model and add tripels from a file:
owcli -m http://localhost/model1# --create --add -i model.rdf
Create a new Model and add tripels from a mapping (hint: use the variable OWMODEL so you dont need -m everytime):
export OWMODEL=http://localhost/model1#; owcli --map Mapping.n 3 | owcli --create --add
Export the default model, put it to cwm and add the inferred statements from the rule file:
owcli --export | cwm --rdf --n3 --filter=Rules.n 3 --rdf | owcli --add
Geocode all values of the foaf:based_near attribute in the default model and add it to the default model:
owcli -d --geocode http://xmlns.com/foaf/0.1/based_near | owcli --add
Subscriptions
To be able to use the update-subscriptions option you have to subscribe to at least one content resource. Content resource means any document holding information in RDF, N3, N-Triples or xhtml containing RDF. Subscribing is managed by storing information regarding this resource in a certain (or any other) model in your Onto Wiki installation.
For a simple example just download
this file and import it into your Onto Wiki:
owcli --create --add -i example.rdf -m http://ns.ontowiki.net/Subscriptions/ .
After that you can update this subscription:
owcli -us -m http://ns.ontowiki.net/Subscriptions/.
You can check the result:
owcli -l
The name of the example model http://ns.ontowiki.net/Subscriptions/exampleModel should occur in the list now.
The mandatory attributes for a subscription are:
- storeModel – where to store the subscribed information
- updateInterval – in minutes
- updateModus – new or add, while add means that any information is just added to the model and new means old information is deleted first.
The optional attribute is:
- query – where you can specify a SPARQL-CONSTRUCT-query to select certain information from the content resource to be stored into the model.
Parameters
-w --wiki=<value> – Set Onto Wiki database which should be used (default is default or the value of the environment variable OWWIKI)
-m --model=<value> – Set model which should be used (default is http://localhost/SysOnt/0.1# or the value of the environment variable OWMODEL)
-i --input=<value> – input model file (- for STDIN) (default is STDIN)
-o --output=<value> – output model file (- for STDOUT) (-)
-l --list – List models from a specific Onto Wiki database
--create – Creates a new model
--drop – Deletes the model
--export – Exports the model
--empty-cache – Empty the model cache only
--empty-popularity – Empty the model popularity only
--empty-ratings – Empty the model ratings only
--empty-namespaces – Empty the model namespaces only
--add – Adds all statements from input to the model
--geocode=<value> – Outputs a model with geocoded (address) values from a given datatype property
--map – Takes a D2RQ mapping model in N3 from input and outputs the mapped model in RDF/XML
-us --update-subscriptions – Update all subscriptions
-c --config=<value> – Set a config file (default is /.owcli or the value of the environment variable OWCONFIG)
-d --debug – Output some debug infos
-q --quiet – Do not output info messages
-h --help – Show help screen
Information
Last Modification:
2010-07-05 14:36:12 by Sebastian Dietzold