Skip to content

stain/owl2jsonld

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

owl2jsonld

Build Status doi:10.5281/zenodo.10565

Convert OWL ontology to JSON-LD context

This tool generate a JSON-LD @context for concepts (classes and properties) found in the specified OWL or RDFS ontology.

Download

The official releases contain an uberjar (standalone) JAR, which bundles all dependencies and can be used as a commandline tool.

The uberjar contains OWL API, which is distributed under the alternative of LGPL or Apache license 2.0.

Installing from source

Install dependencies:

Check out owl2jsonld (this project) and build it:

$ git clone https://github.com/stain/owl2jsonld.git
$ cd owl2jsonld
$ lein uberjar

Command line usage

Generate JSON-LD context from the given RDFS/OWL ontology URL(s):

$ java -jar owl2jsonld-*-standalone.jar [-a|-n] [-c|-p] [-P PREFIX] [-i] [-o OUTPUT] [-e] ONTOLOGY ...

To avoid making a uberjar (e.g. during development), you may alternatively run the tool using:

$ lein run -- [options] ONTOLOGY`

Options

Convert OWL ontology to JSON-LD context

Usage: owl2jsonld [options] ONTOLOGY...

Options:
  -a, --all-imports    Include all OWL-imported concepts (default: only directly referenced elements)
  -d, --only-defined   Include only concepts which are rdfs:isDefinedBy the specified ontologies
  -c, --classes        Include only classes
  -p, --properties     Include only properties
  -P, --prefix PREFIX  JSON-LD prefix to use for generated concepts (default: no prefix)
  -i, --inherit        Inherit prefixes from the source ontology
  -o, --output OUTPUT  Output file for generated JSON-LD context (default: write to STDOUT)
  -v, --verbose        Verbose output on STDERR
  -h, --help


More info: README.md or https://github.com/stain/owl2jsonld

Example

$ java -jar owl2jsonld-0.2.1-standalone.jar http://purl.org/pav/
{ "@context": {
    "authoredBy": { "@id": "http://purl.org/pav/authoredBy",
                    "@type": "@id"
                  },
    "authoredOn": { "@id": "http://purl.org/pav/authoredOn",
                    "@type" "http://www.w3.org/2001/XMLSchema#dateTime"
                  }
    }
    ...
}

Usage from Clojure

To use from Clojure with Leiningen, use the Clojar dependency owl2jsonld:

[owl2jsonld "0.2.1"]

License

Copyright © 2014 Stian Soiland-Reyes, University of Manchester.

This source code is distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

The uberjar contains OWL API, which is distributed under the alternative of LGPL or Apache license 2.0.

Cite

Cite as:

Soiland-Reyes, Stian (2014). owl2jsonld 0.2.1. ZENODO. 10.5281/zenodo.10565

(Check https://github.com/stain/owl2jsonld#cite for latest version/citation)