Skip to content
forked from owlcs/ont-api

ONT-API (OWL-API over Apache Jena)

Notifications You must be signed in to change notification settings

phillipross/ont-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ONT-API (ver. 3.x.x)

Maven Central Javadoc JetBrains open source

Summary

ONT-API is an RDF-centric Java library to work with OWL2.

For more info about the library see the project wiki.

Dependencies

Requirements

  • Java 11+

License

  • Apache License Version 2.0
  • GNU LGPL Version 3.0

Example

import com.github.owlcs.ontapi.OntManagers;
import com.github.owlcs.ontapi.Ontology;
import vocabulary.com.github.sszuev.jena.ontapi.OWL;
import org.apache.jena.rdf.model.Model;
import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLDataFactory;

public class Examples {
    public static void main(String... args) {
        String iri = "https://example.com";
        OWLDataFactory df = OntManagers.getDataFactory();

        Ontology owl = OntManagers.createManager().createOntology(IRI.create(iri));
        owl.addAxiom(df.getOWLDeclarationAxiom(df.getOWLClass(iri + "#Class1")));

        Model jena = owl.asGraphModel();
        jena.createResource(iri + "#Class2", OWL.Class);

        owl.axioms().forEach(System.out::println);
        jena.write(System.out, "ttl");
    }
}

About

ONT-API (OWL-API over Apache Jena)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%