Skip to content
GenEars edited this page Oct 15, 2021 · 1 revision

Welcome to the DiTTO wiki!

DiTTO CLI usage

Converting a yEd Graffoo GraphML file can be done at CLI level through direct usage of XSL stylesheets. The shell script example below allow for such usage:

#!/usr/bin/env bash

# Define variables
XSLTPROC_PATH=`pwd`/WebContent/WEB-INF/lib
DITTO_PATH=DiTTO
SOURCE_PATH=my-awesome-model.graphml
RESULT_PATH=my-awesome-model.owl
ONTOLOGY_URI=my-awesome-model

# Call an XSLT 2.0+ processor to convert the Graffoo GraphML file to an OWL file
java -jar $XSLTPROC_PATH/saxon9he.jar \
  -ext:on \
  -xsl:$DITTO_PATH/graffoo.xsl \
  -s:$SOURCE_PATH \
  -o:$RESULT_PATH \
  use-imported-ontology-version-iri-param=true \
  generate-all-ontologies-param=false \
  default-empty-prefix-param=$ONTOLOGY_URI/ \
  default-ontology-iri-param=$ONTOLOGY_URI

As an alternative to the saxon9he.jar jarfile, the saxonb-xslt command line XSLT 2.0 processor can also be used. Install it with the sudo apt install libsaxonb-java command, then substitute java -jar $XSLTPROC_PATH/saxon9he.jar with saxonb-xslt in above example.

Clone this wiki locally