Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

http://127.0.0.1:1979/semantic_turkey/resources/stserver/STServer?service=metadata&request=getNSPrefixMappings

Appendix B: OWLIM specific notes

How to use a custom ruleset

OWLIM allows for loading custom rulesets (used for inferencing) instead of the precompiled ones bundled with the OWLIM distribution. In particular, their standard OWL rulesets seem to have some bugs in the axiomatic triples (probably originating from wrong definitions in the OWL RL specifications), thus it may be mandatory to load custom versions of these rulesets. Here follow instructions for loading custom rulesets.

Custom rulesets may be easily loaded by specifying the full path to their file location as a value for the OWLIM configuration parameter: “ruleset” (instead of the code name of the standard ones).

However, while this is pretty straightforward when specifying an OWLIM configuration programmatically, doing this through the Sesame2 workbench is not trivial, as the workbench only allows for pre-defined values (associated to the standard preloaded ruleset).

Here follows the instructions for changing ruleset in Sesame2 workbench

The instructions have been compiled by following the example reported in this post on the OWLIM forum:

http://answers.ontotext.com/questions/996/archive-setting-ruleset-owlim-repository-using-sesame-workbench

  • Create a new repository, but do not initialize it! (don't access it, or at least don't put data into it). When selecting the parameters for the repository, select the “Empty” ruleset.
  • Now, select the “SYSTEM” repository, and perform the following SPARQL query:

PREFIX sys:  <http://www.openrdf.org/config/repository#>    
PREFIX sail: <http://www.openrdf.org/config/repository/sail#>
PREFIX onto: <http://www.ontotext.com/trree/owlim#>
SELECT ?g ?sail ?param ?value
WHERE {
    GRAPH ?g { ?rep sys:repositoryID ?id . }
    GRAPH ?g { ?rep sys:repositoryImpl ?impl . }
    GRAPH ?g { ?impl sys:repositoryType ?type . }
    GRAPH ?g { ?impl sail:sailImpl ?sail . }
    GRAPH ?g { ?sail ?param ?value . }
    FILTER( ?id = "{OWLIM.REPOSITORY_ID}" ) .
    FILTER( ?param = onto:ruleset ) .
}

...

  • Now, perform the following SPARQL update:

PREFIX sys:  <http://www.openrdf.org/config/repository#>
PREFIX sail: <http://www.openrdf.org/config/repository/sail#>
PREFIX onto: <http://www.ontotext.com/trree/owlim#>
DELETE { GRAPH ?g {?sail ?param ?old_value } }
INSERT { GRAPH ?g {?sail ?param ?new_value } }
WHERE {
   GRAPH ?g { ?rep sys:repositoryID ?id . }
   GRAPH ?g { ?rep sys:repositoryImpl ?impl . }
   GRAPH ?g { ?impl sys:repositoryType ?type . }
   GRAPH ?g { ?impl sail:sailImpl ?sail . }
   GRAPH ?g { ?sail ?param ?old_value . }
   FILTER( ?id = "{OWLIM.REPOSITORY_ID}" ) .
   FILTER( ?param = onto:ruleset ) .
   BIND( "<directorypathtoyourcustompiefile>/builtin_owl2-rl-fixed.pie" AS ?new_value ) .
}

 

by changing the parameters of the last and the third to last rows in the following way:

  • Again, replace the value associated to ?id with the id of the repo you want to modify
  • replace the value on the BIND, with the absolute path of a custom rule set (it is possible to omit the ending .pie extension, it will be attached by default)
  • You may re-perfom the initial query to check that the substitution for the variable ?value is now the path to the custom ruleset that you defined.
  • Close and restart tomcat, as OWLIM needs to compile the new ruleset
  • Now the repository is ready for receiving data, which will be analysed and expanded into new triples through inference, by exploiting the new ruleset.