Coder Social home page Coder Social logo

owl2neo4j's Introduction

OWL 2 Neo4J Build Status

Convert OWL schema ontologies to labeled property graph and import into Neo4J.

Note: currently the tool only converts the class hierarchy; instances are ignored for now.

Build

Each release comes with a precompiled JAR, created automatically by Travis-CI. To build the JAR file manually follow the three steps below. The JAR file will be created in dist.

Requirements:

git clone https://github.com/flekschas/owl2neo4j && cd owl2neo4j
gradle build

Import ontology

Requirements:

A single file import is executed as follows:

java -jar ./dist/owl2neo4j.jar -o ./pizza.owl -n "Pizza Ontology" -a pizza

(To get pizza.owl run curl -O https://protege.stanford.edu/ontologies/pizza/pizza.owl.)

In order to import multiple ontologies at once create a JSON file:

{
	"server": "http://my-server:7474",
    "ontologies": [
        {
            "o": "./chebi.owl",
            "n": "Chemical Entities of Biological Interest",
            "a": "CHEBI"
        },
        {
            "o": "./cl.owl",
            "n": "Cell Ontology",
            "a": "CL",
            "i": true
        },
        {
            "o": "./efo.owl",
            "n": "Experimental Factor Ontology",
            "a": "EFO"
        }
    ]
}

a, i, n and o correspond to the CLI options. The only difference is that n, i.e. the path to the OWL file to be imported, should be relative to the JSON file. server is optional; when it's not defined, the default server url, i.e. http://127.0.0.1:7474, is used. Next you can import the everything with the following call:

$ java -jar ./dist/owl2neo4j.jar -b ./import.json

(Assuming that the file above is ./import.json.)

Command line options:

usage: java -jar owl2neo4j.jar -a <String> -b <Path> [--eqp <String>] [-h]
       [-i] [-l] -n <String> -o <Path> [-p <String>] [-s <URL>] [-u
       <String>] [-v] [--version]
Import OWL into Neo4J as a labeled property graph.

 -a,--abbreviation <String>   Ontology abbreviation (E.g. go)
 -b,--batch <Path>            Path to JSON file
    --eqp <String>            Existential quantification property (E.g.
                              http://www.co-ode.org/ontologies/pizza/pizza
                              .owl#hasTopping)
 -h,--help                    Shows this help
 -i,--incl-imports            Include import closure
 -l,--no-local                Don't scan for locally available OWL files
                              to ensure loading remote files.
 -n,--name <String>           Ontology name (E.g. Gene Ontology)
 -o,--owl <Path>              Path to OWL file
 -p,--password <String>       Neo4J user password
 -s,--server <URL>            Neo4J server root URL [Default:
                              http://localhost:7474]
 -u,--user <String>           Neo4J user name
 -v,--verbosity               Verbose output
    --version                 Show version

For detailed instructions and help regarding the different options please refer to the wiki.

Importing large ontologies:

By default the OWLAPI XML loader has a 64,000 triple limit. To increase the limit and being able to import larger ontologies start owl2neo4j.jar with DentityExpansionLimit=<LARGE_NUMBER> flag like so:

java -jar -DentityExpansionLimit=1000000 ./dist/owl2neo4j.jar -o ./extra-large-pizza.owl -n "Extra Large Pizza Ontology" -a elpo

Be sure that you have enough RAM to theoretical load 1000000 (or any other number), otherwise your system will complain.

Handshake error:

In case you see a handshake error of this form Remote host closed connection during handshake add the following parameter when calling java:

java -jar -Dhttps.protocols=TLSv1.1,TLSv1.2 ...

owl2neo4j's People

Contributors

flekschas avatar

Watchers

James Cloos 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.