Galigator / openllet

Openllet is an OWL 2 reasoner in Java, build on top of Pellet.
https://www.w3.org/TR/owl2-primer/
Other
100 stars 26 forks source link
inference java jena logic owl owl-api owl2 reasoner semantic

Openllet: An Open Source OWL DL reasoner for Java

CircleCI Gitter Twitter Codacy Badge

Maven Central

Openllet is an OWL 2 DL reasoner:

Openllet can be used with Jena or OWL-API libraries. Openllet provides functionality to check consistency of ontologies, compute the classification hierarchy, explain inferences, and answer SPARQL queries.

Feel free to fork this repository and submit pull requests if you want to see changes, new features, etc. in Openllet. We need a lot more tests, send your samples if you can.

There are some code samples in the examples/ directory. Issues are on Github. Pellet community is on pellet-users mailing list.

Openllet 2.6.X:

Migration :

    <dependency>
        <groupId>com.github.galigator.openllet</groupId>
        <artifactId>openllet-owlapi</artifactId>
        <version>2.6.5</version>
    </dependency>
    <dependency>
        <groupId>com.github.galigator.openllet</groupId>
        <artifactId>openllet-jena</artifactId>
        <version>2.6.5</version>
    </dependency>

NB, the Protege plugin need a Protege that work with an 5.1.X version of the OWL-API, so the main branch of Protege isn't compatible with Openllet.

Roadmap :

Examples :

Play with the Owl-Api:

try (final OWLManagerGroup group = new OWLManagerGroup())
{
    final OWLOntologyID ontId = OWLHelper.getVersion(IRI.create("http://myOnotology"), 1.0);
    final OWLHelper owl = new OWLGenericTools(group, ontId, true);

    final OWLNamedIndividual x1 = OWL.Individual("#I1");
    final OWLNamedIndividual x2 = OWL.Individual("#I2");

    owl.addAxiom(OWL.equivalentClasses(ClsA, OWL.some(propB, OWL.restrict(XSD.STRING, OWL.facetRestriction(OWLFacet.PATTERN, OWL.constant("A.A"))))));
    owl.addAxiom(OWL.propertyAssertion(x1, propB, OWL.constant("AAA")));
    owl.addAxiom(OWL.propertyAssertion(x2, propB, OWL.constant("BBB")));
    owl.addAxiom(OWL.differentFrom(x1, x2));

    final OpenlletReasoner r = owl.getReasoner();
    assertTrue(r.isEntailed(OWL.classAssertion(x1, ClsA)));
    assertFalse(r.isEntailed(OWL.classAssertion(x2, ClsA)));
}

Play with Jena:

    final String ns = "http://www.example.org/test#";

    final OntModel model = ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC);
    model.read(_base + "uncle.owl");

    final Individual Bob = model.getIndividual(ns + "Bob");
    final Individual Sam = model.getIndividual(ns + "Sam");

    final Property uncleOf = model.getProperty(ns + "uncleOf");

    final Model uncleValues = ModelFactory.createDefaultModel();
    addStatements(uncleValues, Bob, uncleOf, Sam);
    assertPropertyValues(model, uncleOf, uncleValues);

Openllet 2.5.X:

Changes :

Migration :

Pellet 1..2.3] Licences and supports:

Thanks for using Openllet.

Others experimentals stuffs

CircleCI Build Status codecov