Need help using Apache Jena libraries

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Need help using Apache Jena libraries

lukasged

Hi everybody, I’m developing a plugin for Protégé and need to walk through an ontology encoded in RDF/XML string. I’m trying to use Apache Jena libraries for that purpose (should I use the OWL API instead?) but can’t get it to work. I’ve tried several methods to import the Jena libraries :

 

  • Importing the separate Jena maven dependencies  and including them in the “<Embed-Dependency>” section of pom.xml
  • Importing the jena-osgi bundle dependency from maven and including it in the “<Embed-Dependency>” section of pom.xml (both first and second options resulted in the “org.osgi.framework.BundleException: Unresolved constraint in bundle ***” error message when launching Protege)
  • Downloading all the Apache Jena dependencies in a new “lib” folder, and importing them with the “<Include-Resource>” and “<Bundle-ClassPath>” constraints, resulting in conflicts with the “log4j” library being not osgi-ready.
  • Trying to import the jena package with the “<Import-Package>org.apache.jena.rdf.model.*;resolution:=optional</Import-Package>” (for the case that any other bundle would export it) resulting in a “ClassNotFound” exception

 

Have any of you guys faced this trouble before? How could I get the Apache Jena to work for my plugin? Or should I better use the OWL API for the matter? Thank you and happy holidays!

 

Lukas.

 


_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
Reply | Threaded
Open this post in threaded view
|

Re: Need help using Apache Jena libraries

Lorenz B.

If you're working on OWL, yes. Apache Jena is great for RDF when we'reworking  about triples, graphs, etc., but for OWL ontologies the support is more convenient and complete in OWL API. So, please use OWL API. This comes for free with Protege.

Hi everybody, I’m developing a plugin for Protégé and need to walk through an ontology encoded in RDF/XML string. I’m trying to use Apache Jena libraries for that purpose (should I use the OWL API instead?) but can’t get it to work.


I’ve tried several methods to import the Jena libraries :

 

  • Importing the separate Jena maven dependencies  and including them in the “<Embed-Dependency>” section of pom.xml
  • Importing the jena-osgi bundle dependency from maven and including it in the “<Embed-Dependency>” section of pom.xml (both first and second options resulted in the “org.osgi.framework.BundleException: Unresolved constraint in bundle ***” error message when launching Protege)
  • Downloading all the Apache Jena dependencies in a new “lib” folder, and importing them with the “<Include-Resource>” and “<Bundle-ClassPath>” constraints, resulting in conflicts with the “log4j” library being not osgi-ready.
  • Trying to import the jena package with the “<Import-Package>org.apache.jena.rdf.model.*;resolution:=optional</Import-Package>” (for the case that any other bundle would export it) resulting in a “ClassNotFound” exception

 

Have any of you guys faced this trouble before? How could I get the Apache Jena to work for my plugin? Or should I better use the OWL API for the matter? Thank you and happy holidays!

 

Lukas.

 



_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center

_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
Reply | Threaded
Open this post in threaded view
|

Re: Need help using Apache Jena libraries

lukasged
Thanks for the suggestions. Finally I ended up using XML data, as I could choose between XML and RDF/XML.

Lukas.

2017-01-03 10:57 GMT+01:00 Lorenz B. <[hidden email]>:

If you're working on OWL, yes. Apache Jena is great for RDF when we'reworking  about triples, graphs, etc., but for OWL ontologies the support is more convenient and complete in OWL API. So, please use OWL API. This comes for free with Protege.

Hi everybody, I’m developing a plugin for Protégé and need to walk through an ontology encoded in RDF/XML string. I’m trying to use Apache Jena libraries for that purpose (should I use the OWL API instead?) but can’t get it to work.


I’ve tried several methods to import the Jena libraries :

 

  • Importing the separate Jena maven dependencies  and including them in the “<Embed-Dependency>” section of pom.xml
  • Importing the jena-osgi bundle dependency from maven and including it in the “<Embed-Dependency>” section of pom.xml (both first and second options resulted in the “org.osgi.framework.BundleException: Unresolved constraint in bundle ***” error message when launching Protege)
  • Downloading all the Apache Jena dependencies in a new “lib” folder, and importing them with the “<Include-Resource>” and “<Bundle-ClassPath>” constraints, resulting in conflicts with the “log4j” library being not osgi-ready.
  • Trying to import the jena package with the “<Import-Package>org.apache.jena.rdf.model.*;resolution:=optional</Import-Package>” (for the case that any other bundle would export it) resulting in a “ClassNotFound” exception

 

Have any of you guys faced this trouble before? How could I get the Apache Jena to work for my plugin? Or should I better use the OWL API for the matter? Thank you and happy holidays!

 

Lukas.

 



_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center

_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev



_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
Reply | Threaded
Open this post in threaded view
|

Re: Need help using Apache Jena libraries

Simon Spero-2
A bit late now, but... 

The protégé framework launcher will automatically install  and start bundles from the bundles and plugins directories. If your bundle imports some packages from Jena, and a Jena OSGI bundle that exports those package with compatible versions, the framework will wire up those packages for you. 

It is generally not good practice to embed dependencies inside the bundle. That doesn't mean it isn't the most common practice though. 

Protégé installs and starts the log4j-over-slf4j bundle, which exports the log4j api, so any imports for those classes from other bundles should be getting wired correctly. 

Simon

On Jan 20, 2017 1:39 PM, "Lukas Gedvilas" <[hidden email]> wrote:
Thanks for the suggestions. Finally I ended up using XML data, as I could choose between XML and RDF/XML.

Lukas.

2017-01-03 10:57 GMT+01:00 Lorenz B. <[hidden email]>:

If you're working on OWL, yes. Apache Jena is great for RDF when we'reworking  about triples, graphs, etc., but for OWL ontologies the support is more convenient and complete in OWL API. So, please use OWL API. This comes for free with Protege.

Hi everybody, I’m developing a plugin for Protégé and need to walk through an ontology encoded in RDF/XML string. I’m trying to use Apache Jena libraries for that purpose (should I use the OWL API instead?) but can’t get it to work.


I’ve tried several methods to import the Jena libraries :

 

  • Importing the separate Jena maven dependencies  and including them in the “<Embed-Dependency>” section of pom.xml
  • Importing the jena-osgi bundle dependency from maven and including it in the “<Embed-Dependency>” section of pom.xml (both first and second options resulted in the “org.osgi.framework.BundleException: Unresolved constraint in bundle ***” error message when launching Protege)
  • Downloading all the Apache Jena dependencies in a new “lib” folder, and importing them with the “<Include-Resource>” and “<Bundle-ClassPath>” constraints, resulting in conflicts with the “log4j” library being not osgi-ready.
  • Trying to import the jena package with the “<Import-Package>org.apache.jena.rdf.model.*;resolution:=optional</Import-Package>” (for the case that any other bundle would export it) resulting in a “ClassNotFound” exception

 

Have any of you guys faced this trouble before? How could I get the Apache Jena to work for my plugin? Or should I better use the OWL API for the matter? Thank you and happy holidays!

 

Lukas.

 



_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center

_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev



_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev



_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev