Wiki

Clone wiki

Sparna / HowTo-RunXls2SkosCommandLine

How to run Xls2Skos from the command line ?

SKOS Play includes a converter to generate SKOS files from Excel. This converter can also be run from the command-line. This allows easy integration of the converter for automated generation of SKOS files.

Instructions

  1. Download the file xls2skos-x.y.z-onejar.jar from the download section;
  2. Make sure you have Java >= 8 installed and available;
  3. Open a terminal/prompt where you downloaded the command-line application, and run :

#!bash
java -jar xls2skos-x.y.z-onejar.jar
You should see the help message given below, with all the options documented.

  1. Create an Excel file from the formatting instructions in the documentation.
  2. Run a command similar to this one to generate a SKOS file from the Excel file
#!bash
java -jar xls2skos-x.y.z-onejar.jar convert -i path_to_excel_file.xlsx -o output_rdf.ttl -l en 
  1. Adjust the parameters as appropriate (you can output multiple files in a directory for example).

Parameters documentation

#!text
Usage: <main class> [options] [command] [command options]
  Options:
    -h, --help
       Prints the help message
       Default: false
    -l, --log
       Reference to a log4j configuration file
  Commands:
    convert      Usage: convert [options]
        Options:
          -def, --definitions
             XLify definitions
             Default: false
          -d, --directory
             Consider output like a directory, and generate separate files in it
             for each graph.
             Default: false
          -f, --format
             Output RDF format mime type.
          -g, --generateGraphs
             Generate Virtuoso graph files
             Default: false
        * -i, --input
             Input Excel file
        * -l, --lang
             Default language to use.
        * -o, --output
             Output RDF or ZIP file name
          -xl, --skosxl
             XLify labels
             Default: false

Updated