Hi Nicolas, Don't forget to read the pellet faq about extracting inferences using jena: https://github.com/Complexible/pellet/wiki/FAQ#how-can-i-extract-all-inferences
About the explanations, I'm not 100% sure, but I believe the methods used to get them are from Pellet ( pelletReasoner.getKB().getExplanation() ), so, they should work with both APIs. When you download pellet zip package, there are some examples... at least one is about explanations... Most of things you do with Jena you can do with OWLAPI and also the other way around... both are quite simple to understand and a few lines of code can do many things =) I was able to implement my custom functions to use with SWRL, if you need any help, I'll be glad to help! Rodrigo C. Antonialli ====================================== Rio Claro - SP - Brasil LinkedIn: http://www.linkedin.com/in/rcantonialli Contato: [email protected] Skype: rc_antonialli On Tue, Dec 8, 2015 at 10:28 PM, Nicolas Paris <[email protected]> wrote: > Hi there, > > I am working on these things too these days. I try to do all without > owlapi, and I hope I will be able to. Thank you all for these > question/clear answers. > About my tests, as far as I can see, with jena & pellet I am able to : > - transform the data from TDB and pass the pellet rules + knowlege > base on it, in 4 lines code. > - add individuals, data/objects properties and all OWL stuff thanks to > Jena OR pellet methods > - create SPARQL with jenaARQ OR SPARQLDL with Pellet > What I will try to do in the next days will be : > - get what you called the "InferredIndividualAxiomGenerator" within > jena. -> I have some starting points > ( > http://stackoverflow.com/questions/25055263/how-to-get-only-inferred-data-from-jena-ontology-model > ) > - get the explanations of inferred axioms from pellet (the same as > Protégé shows when you hit the "?") -> any idea ?. > - create my own pellet built-in (begining with implementing some dates > related built-in). Maybe make a pull request on github then -> I have > already read an interesting post of Rodrigo about that on the Pellet > forum. > > > > 2015-12-09 0:23 GMT+01:00 Rodrigo Antonialli <[email protected]>: > > > > Short answer: yes, that's it... > > > > Long answer: > > > > I've created the ontologies using Protege, and uploaded them to Fuseki. > > When I need the ontologies in my application, Jena is used to load the > > ontologies from Fuseki. In most cases, I do things with Jena, specially > > SPARQL. > > > > But once the ontologies are stored into OntModel, they can be written to > > some OutputStream and read from OWLAPI. Using OWLAPI at certain > application > > features, I'm creating some individuals and running Pellet inference, > > including SWRL rules (which, in my case, are defined in a separated > > file/graph, which is better for maintenance). > > > > There are 'tools' from OWLAPI to extract the inferred axioms only (like > > InferredIndividualAxiomGenerator). In my case, I'm joining the inferred > > axioms with the individuals and "exporting" back to Jena... from Jena > it's > > just to upload them to Fuseki again... > > > > > > That may looks like an ugly and unnecessary overhead from some point of > > views.... but with that "architecture", I can benefit from both: Jena + > > Fuseki (storage and SPARQL) and OWLAPI + Pellet (Inferences, SWRL)... > > actually, it's a good way (or at least the one I've found) to use the > power > > of both APIs. IMHO, there are some things easier to be done with Jena and > > others easier with OWLAPI (mostly because they are focused on different > > aspects... Jena is more "RDF-centric" and OWLAPI, "OWL-centric") > > > > > > > > > > Rodrigo C. Antonialli > > ====================================== > > Rio Claro - SP - Brasil > > LinkedIn: http://www.linkedin.com/in/rcantonialli > > Contato: [email protected] > > Skype: rc_antonialli > > > > On Tue, Dec 8, 2015 at 7:17 PM, Chris Snyder <[email protected]> > wrote: > > > > > That is very helpful feedback. > > > > > > As a clarification I attempted to use the Pellet code from Maven > central > > > and that is where I ran into the package name change issue. I might try > > > getting in touch with Ignazio directly to see if I can help make the > > > updates to get Pellet working with the latest Jena. > > > > > > If you don’t mind my asking, how are you applying the SWRL rules in > > > practice? E.G. are you applying the SWRL rules using the OWLAPI + > Pellet > > > and then exporting the additional reasoned triples to your Fuseki > instance > > > so they can be queried with SPARQL? > > > > > > Thanks, > > > Chris > > > > > > > > > > > > > > > > On Dec 8, 2015, at 3:55 PM, Rodrigo Antonialli < > [email protected]> > > > wrote: > > > > > > > > Hi Chris, > > > > > > > > Maybe I'm not an expert to answer you properly, but I've being > working > > > with > > > > this kind of scenario (Ontologies, SWRL, jena, owlapi) lately and > here is > > > > what I can share: > > > > > > > > 1) Yes. As far as I know, Jena doesn't have native support for SWRL. > > > > > > > > 2) The most recent versions of pellet I've seen is the one from > Ignazio > > > > Palmisano, which you can find at Maven Central > > > > <http://search.maven.org/#search%7Cga%7C1%7Cignazio1977>. I know it > > > works > > > > with most recent versions of OWL-API, can't tell what Jena version it > > > > supports now... (I don't know if he is in this mailling list, but > you can > > > > find him in owlapi mailling list =P) > > > > > > > > 3) Can't tell for sure, once I've never used Jena Rules, but I > believe > > > the > > > > differences should be around details and most things would be made > with > > > > both. Actually, Jena Rules and SWRL are "competing" (emphasis on the > > > > quotes) with SPARQL SPIN from TopBraid, so it's difficult to find > clear > > > > documented comparisons. There are a lot of considerations around the > > > > subject... > > > > > > > > 4) The problem with other reasoners is, usually, not Jena > compatibility, > > > > but SWRL support... As far as I could look around, pellet is the only > > > > free/open-source reasoner with a good support for SWRL. I've spent > some > > > > time looking around, because the pellet performance with SWRL is a > little > > > > problematic when the ontology is complex, there are a great number of > > > > rules... Although one thing I've found to be a nice feature is the > > > ability > > > > to create custom functions for SWRL using Pellet. It was good for me > to > > > > work with geospatial data (and now I'm trying to speed things up)... > > > > > > > > 5) "What should I use" questions are like "What's the best", and the > best > > > > answer is: it depends... of a lot of things... I've being working > with > > > both > > > > APIs and by now, I chose to use Jena to work with Fusek and SPARQL > and > > > > OWLAPI to manipulate the ontology directly (build and manage axioms). > > > > Simple SPARQL queries you can change for some OWLAPI code, but the > > > > endpoint/tdb support in jena are an advantage. It's quite easy to > work > > > with > > > > both in the same application (both API read and write from various > > > formats) > > > > > > > > > > > > Rodrigo C. Antonialli > > > > ====================================== > > > > Rio Claro - SP - Brasil > > > > LinkedIn: http://www.linkedin.com/in/rcantonialli > > > > Contato: [email protected] > > > > Skype: rc_antonialli > > > > > > > > On Tue, Dec 8, 2015 at 6:18 PM, Chris Snyder <[email protected]> > > > wrote: > > > > > > > >> I have a few reasoner questions. > > > >> > > > >> 1) I’m using the latest version of Jena 3.0.0 is it true that the > only > > > way > > > >> to use SWRL rules is with an external reasoner? My concern is how I > > > would > > > >> use Protege which can handle adding SWRL rules and then processing > the > > > >> ontology with Jena. > > > >> > > > >> 2) I tried to integrate the Pellet reasoner but to get it to work > with > > > >> Jena 3.0.0 I believe I would need to fork the Pellet code and > update all > > > >> the Jena package paths in it to use the new “org.apache.jena.” > location. > > > >> Can anyone comment on that? > > > >> > > > >> 3) If I am using the built in Jena reasoner is there anything major > > > that I > > > >> can not do with the Jena rule language that I could do with SWRL? > > > >> > > > >> 4) Is there an reasoner other than Pellet that someone has used with > > > Jena > > > >> 3.0.0 successfully that will process SWRL rules? > > > >> > > > >> 5) A reasoner is obviously an important part of using an ontology. > Is > > > Jena > > > >> the appropriate way to go or should I be looking into the OWLAPI? > > > >> > > > >> Thanks in advance, > > > >> Chris > > > >> > > > >> > > > >> > > > >> > > > > > > >
