3

I'm using Hermit Reasoner with OWL-API 5 as follows:

  OWLOntologyManager manager= OWLManager.createOWLOntologyManager(); //create the manager    
   OWLOntology ontology=manager.loadOntologyFromOntologyDocument(new File("ontologies/E1G1.owl"));

  OWLDataFactory datafact=manager.getOWLDataFactory();
  Configuration config= new Configuration();
  Reasoner reasoner= new Reasoner(config, ontology);
  reasoner.classifyClasses();
  reasoner.classifyDataProperties();
  reasoner.classifyObjectProperties();
  System.out.println(reasoner.isConsistent());  

Now I would like to execute SPARQL Query in analogous way as Protégé SPARQL Plugin over the inferred ontology. I'm experimenting JENA ARQ, but it is not clear to me how to integrate them. Any suggestions?

Discipulos
  • 423
  • 8
  • 23

1 Answers1

1

I do not think there is existing integration between Jena and HermiT. OpenPellet, a reasoner built on top of Pellet has Jena integration.

The question is whether you indeed need an external reasoner. If not you can use the OWL reasoners provided as part of Jena. See Jena OWL Reasoners.

Henriette Harmse
  • 4,167
  • 1
  • 13
  • 22
  • So, how integration between reasoner and SPARQL is reached in Protege? Maybe SPARQL only makes queries over the knowledge base inferred from an internal reasoner? – Discipulos Apr 03 '18 at 15:37
  • In order to answer to your question. I need to integrate SPARQL with a OWL-API based application that also integrates a reasoner (Hermit). – Discipulos Apr 03 '18 at 15:45
  • Protege I think uses OSGI plugin architecture using the OWL API for integrating with reasoners. Very different from Jena. – Henriette Harmse Apr 03 '18 at 15:51
  • I mean, interfacing SPARQL with reasoners. – Discipulos Apr 03 '18 at 16:18
  • 1
    The [SPARQL Protege Plugin](https://github.com/protegeproject/sparql-query-plugin) uses RDF4J, not HermiT or any reasoner. – Henriette Harmse Apr 03 '18 at 16:33
  • 3
    SPARQL _can not_ be integrated with a reasoner, since a reasoner is not data store. It is just set of rules, process, engine. An ontology is data store. If you want OWL-API and sparql together, you can use [ONT-API](https://github.com/avicomp/ont-api). This project does not contain any reasoner. Only in tests. Please note, that pure Jena does not support OWL2, – ssz Apr 03 '18 at 16:50
  • So if there is an integration of OWL API and SPARQL, I guess that I can also integrate an OWL API compatible reasoner with SPARQL, it isn't? There is somewhere an example of this? – Discipulos Apr 04 '18 at 16:35