0

I am currently getting started with OWL. I believe that I have setted up the correct .jar for the OWL API. However, when I compile the code I get an error on the line:

OWLOntologyManager manager = OWLManager.createOWLOntologyManager();

The error says :

cannot access com.google.inject.Provider 
class file for com.google.inject.Provider not found

Any ideas on what might be causing the issue?

ssz
  • 835
  • 1
  • 6
  • 18
  • 2
    Yes, you need more jars to be able to compile and run. The documentation clearly states, and I quote with emphasis mine: "In order to use the API in your own applications, you should download the latest binary release and ensure that **all of the jar files are in the application classpath**". https://github.com/owlcs/owlapi/wiki/Documentation . – Gimby Apr 02 '19 at 08:50
  • 1
    [Check this question](https://stackoverflow.com/questions/30459428/getting-error-in-executing-owl-api) maybe it helps. I think you're missing some dependencies – kevinSpaceyIsKeyserSöze Apr 02 '19 at 08:51

1 Answers1

3

If you use pom, be sure you use correct dependency as is written here.

<dependency>
    <groupId>net.sourceforge.owlapi</groupId>
    <artifactId>owlapi-distribution</artifactId>
    <version>5.1.0</version>
</dependency>

If you use jar file, as you exactly wrote, so be sure, you added it correct as is written here

Afterwards, be sure, you imported the correct package in your Class. And also, be sure you downloaded all you need, like that

For start line in your question, you need that imports

import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.OWLOntologyManager;

And better, try to use maven as was written here

Dred
  • 1,076
  • 8
  • 24