Git Product home page Git Product logo

owl2jsonschema.js's Introduction

owl2jsonschema.js

WIP

Do not use for production yet. Might change or rename at anytime. Please do report bugs!

Convert OWL / RDFS / XML Schema to JSON Schema.

OWL 2 JSON SCHEMA wants to build a bridge between the semantically XML web and the semantically JSON web and is a converter from OWL as RDF/XML to JSON Schema (currently draft 4). Full XML Schema support will come soon. For now an OWL Ontology is required.

Why?
Most ontologies on the web use OWL+RDF/XML or RDF/Turtle or RDF/NTriples (which translate 1:1 to RDF/XML).
spec.:

"The primary exchange syntax for OWL 2 is RDF/XML; this is indeed the only syntax that must be supported by all OWL 2 tools."

So RDF/XML Schema is Lingua Franca. Let us create a canonical JSON representation for this.

It is planned to support several proposals for JSON Schema v5 draft which close gaps between OWL and JSON Schema. For example

So whenever the documentation refers to "JSON Schema" it means :
"JSON Schema and hyperschema - including the above mentioned inofficial proposals".

This is nightly written from scratch, might currently contain bugs and is incomplete.
Currently working on: The resolving of external URIs and Ontologies.

Supported platforms

node.js >= 0.10.0

Installation

For now

git clone https://github.com/redaktor/owl2jsonschema.js.git
cd owl2jsonschema.js
npm install

A demo is included. It will create the JSON Schemas of the dbpedia Ontology.
This will create the schema files in demo/OUTPUT:

node demo

Usage

var owl2jsonschema = require('owl2jsonschema');
var parser = new owl2jsonschema(/*[options object]*/);

and now parse url OR file OR string

// url, options, callback

parser.parse('http://mappings.dbpedia.org/server/ontology/export' /*, [callback function]*/ );

OR
// filepath, options, callback
(if filepath is relative then './' is the folder of your script)

parser.parse('./export.xml' /*, [callback function]*/);

OR
// string, options, callback

parser.parse('<?xml><rdf:RDF><owl:Ontology>...</owl:Ontology>...</rdf:RDF>' /*, [callback function]*/);

This will write JSON schema files - you can specify options - see the code for now. Several Database support is planned within the redaktor boilerplate.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

History

TODO: Write history

Credits

Once OWL/RDFS is transformed, this uses the logic of schema-org-gen by Geraint Luff.

License

TODO: Write license

owl2jsonschema.js's People

Watchers

J. Duan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.