GithubHelp home page GithubHelp logo

sszuev / jena-owl2 Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 1.26 MB

Apache Jena OWL2 Model

Home Page: https://github.com/sszuev/jena-owl2

License: Apache License 2.0

Java 100.00%
jena ont-api owl-api owl2

jena-owl2's Introduction

Apache Jena OWL2 Model


NOTE: This library has been integrated into Apache Jena starting from version 5.1.0 (:jena-ontapi). The current repository will remain available for compatibility with Apache Jena 4.x.x.


Summary

This is enhanced Apache Jena Inference RDF Model with OWL2 support. The original code is taken from ONT-API.

Motivation

com.github.owlcs.ontapi.jena.model.OntModel covers OWL2 syntax but not inference and OWL profiles.
org.apache.jena.ontology.OntModel supports inference, but only follows OWL1 specification.

This project closes this gap by providing a fully functional ontology RDF model for working with OWL2.

Major components

  • OntModel - the main interface to work with OWL2 & OWL1 & RDFS ontologies
  • OntModelFactory - factory for creating different OntModel types
  • GraphRepository - graph store accessor
  • OntSpecification - encapsulates ReasonerFactory, OntConfig, OntPersonality
  • UnionGraph - a Graph implementation with support hierarchy
  • OntModelConfig - model configuration, defines what a model can do and what it cannot do
  • OntPersonality - a configuration class to conduct Jena's polymorphism for OntObjects

Supported specifications

  • OWL2 DL & Full: NO_INF, RULES_INF, RDFS_INF, TRANS_INF + BUILTIN_INF (default)
  • OWL2 EL: NO_INF, RULES_INF, RDFS_INF, TRANS_INF
  • OWL2 QL: NO_INF, RULES_INF, RDFS_INF, TRANS_INF
  • OWL2 RL: NO_INF, RULES_INF, RDFS_INF, TRANS_INF
  • OWL1 DL & Full: NO_INF, RULES_INF, RDFS_INF, TRANS_INF, MICRO_RULES, MINI_RULES
  • OWL1 Lite: NO_INF, RULES_INF, RDFS_INF, TRANS_INF
  • RDFS: NO_INF, RDFS_INF, TRANS_INF

Example

GraphRepository repository = GraphRepository.createGraphDocumentRepositoryMem();

OntModel m = OntModelFactory.createModel(OntSpecification.OWL2_DL_MEM_BUILTIN_INF, repository)
        .setNsPrefixes(OntModelFactory.STANDARD);

m.setID("ont").setVersionIRI("ont#v1");

OntObjectProperty p = m.createObjectProperty("p");
OntClass a = m.createOntClass("a");
OntIndividual i = a.createIndividual("i");
OntClass b = m.createOntClass("b")
        .addSuperClass(m.createObjectIntersectionOf(a, m.createObjectHasValue(p, i)));

m.ontObjects(OntClass.class).forEach(System.out::println);
m.ontObjects(OntIndividual.class).forEach(System.out::println);

m.write(System.out, "ttl");

Available via jitpack

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.github.sszuev</groupId>
        <artifactId>jena-owl2</artifactId>
        <version>{{latest-version}}</version>
    </dependency>
</dependencies>

Apache License Version 2.0

jena-owl2's People

Contributors

sszuev avatar

Stargazers

 avatar  avatar

Watchers

 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.