JSON-LD support for OWLAPI
Add JSON-LD parser and renderer (read and write) support for the OWL API.
If using Maven, edit pom.xml
to include:
<dependencies>
<dependency>
<groupId>org.clojars.stain</groupId>
<artifactId>owlapi-jsonld</artifactId>
<version>0.1.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>clojars</id>
<name>Clojars repository</name>
<url>https://clojars.org/repo</url>
</repository>
</repositories>
From the example:
Reading an JSON-LD-based ontology:
OWLOntologyManager ontologyManager = OWLManager.createOWLOntologyManager();
JsonLdParserFactory.register(); // Really just needed once
IRI vcardIri = IRI.create("http://www.w3.org/2006/vcard/ns.jsonld");
OWLOntology ontology = ontologyManager.loadOntology(vcardIri);
ontologyManager.saveOntology(ontology, new TurtleOntologyFormat(), System.out);
Writing out an ontology as JSON-LD:
OWLOntologyManager ontologyManager = OWLManager.createOWLOntologyManager();
JsonLdStorer.register(ontologyManager); // Needed once per ontologyManager
IRI oaIri = IRI.create("http://www.w3.org/ns/oa.rdf");
OWLOntology ontology = ontologyManager.loadOntology(oaIri);
ontologyManager.saveOntology(ontology, new JsonLdOntologyFormat(), System.out);
For further details about the OWL API, see OWL API documentation
Copyright © 2014 Stian Soiland-Reyes, University of Manchester.
License under the alternative of LGPL or Apache license 2.0; the same as OWL API.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close