0

I am trying to use OWL api and Pellet in an OSGI bundle. The bundle builds successfully but on runtime I am getting the following error: org.osgi.framework.BundleException: Unresolved constraint in bundle smp.lighting.client.osgi [2]: package; (package=org.mindswap.pellet).

These are the dependencies as they are declared in the pom file: <dependency> <groupId>edu.stanford.protege</groupId> <artifactId>org.semanticweb.owl.owlapi</artifactId> <version>3.4.4</version> <exclusions> <exclusion> <artifactId>org.osgi.core</artifactId> <groupId>org.apache.felix</groupId> </exclusion> <exclusion> <artifactId>owlapi-apibinding</artifactId> <groupId>net.sourceforge.owlapi</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.github.ansell.pellet</groupId> <artifactId>pellet-owlapiv3</artifactId> <version>2.3.3</version> <exclusions> <exclusion> <artifactId>slf4j-api</artifactId> <groupId>org.slf4j</groupId> </exclusion> <exclusion> <artifactId>log4j</artifactId> <groupId>log4j</groupId> </exclusion> <exclusion> <artifactId>xercesImpl</artifactId> <groupId>xerces</groupId> </exclusion> </exclusions> </dependency>

Also, in the launch file of the bundle, I call: mvn:edu.stanford.protege/org.semanticweb.owl.owlapi/3.4.4

and in the next level: wrap:mvn:com.github.ansell.pellet/pellet-jena/2.3.3 wrap:mvn:com.github.ansell.pellet/pellet-owlapiv3/2.3.3

I do not know if I a missing something, any help is appreciated. Thank you in advance!

user1347280
  • 85
  • 1
  • 8
  • Are you tied to those versions? I have a Pellet fork with more recent OWLAPI dependencies and will make it work with protégé, which is am OSGi container. If you are willing to update, you might take advantage of it. The fork is available on my GitHub page. – Ignazio Nov 27 '15 at 12:25

1 Answers1

0

pellet-owlapiv3 is an adapter between Pellet and the OWL API, so it does not, itself, contain the core Pellet classes. From the error, I believe you need to wrap pellet-core as well, and possibly some others of the Pellet modules.

Ignazio
  • 10,504
  • 1
  • 14
  • 25
  • Thank you for your answer. I also wrapped pellet-core, pellet-common and pellet-modularity but I still get errors. Anything else to suggest? – user1347280 Nov 27 '15 at 10:21
  • Do you get any other error on the console? Without more info, the only way is for another person to replicate the process. This is going to take time... – Ignazio Nov 27 '15 at 12:22
  • I got java.lang.NoClassDefFoundError: Aterm, after resolving this error by adding the corresponding dependency, i got similar errors for jjtraveler, shared-objects, relaxngDatatype, org/jgrapht/DirectedGraph. – user1347280 Nov 27 '15 at 13:24
  • OK, the problem is that your wraps are not embedding any dependencies. I don't know the tool you're using, but there should be an option to include dependencies. – Ignazio Nov 27 '15 at 13:26
  • Yes, probably after adding the dependencies and using: true in the pom.xml, it is finally running. Thank you very much. – user1347280 Nov 27 '15 at 14:30