-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Triple interface for OWLAPI/Jena connection #340
Comments
We can make this more literal friendly, but the toString() on RDFTriple is not supposed to produce NTriples, just a human readable representation of the triple, for debugging purposes. On a related topic, I've seen questions on StackOverflow asking for a triple interface, for doing things like connecting Jena and OWL API without having to go through serialization/deserialization. This might be good to have, if we can get a well designed interface. Would you be able to use something like this for your purposes? If so, it'd be good if you could comment on what you'd like to have in this interface. We can then see how to fit this in the api package. |
Understood. So I misinterpreted the functionality of dumpTriples(), which uses RDFTriple.toString(). My goal was basically to serialize an RDFGraph, and I expected said triples dump to be valid w.r.t. some format (the output was valid N-triples except for literals). Getting around having to serialize and deserialize is definitely desirable. Even though this isn't a major problem for me right now, it would surely be convenient to have such interface! So in my situation I'd like to take an OWLOntology instance and serialize it in all triples formats that, e.g., Jena supports. The other use case I'll be looking into is updating a graph database with axioms (or their corresponding sets of triples) built within the OWL API. I'm testing the latter with Stardog. Both of these scenarios seem to require that unfortunate intermediate step. |
I'll make a prototype for this triple interface. |
I've been thinking quite a bit about this ; there are some big wins to Most class & property assertions are irrelevant to classification, so
|
Any update on this? |
It shouldn't be too difficult to follow the same pattern that has been implemented for Sesame Rio to stream triples into OWLAPI. For Sesame Rio the code is:
I am not familiar with Jena, but if it supplies a lazy iterator, you could stream directly through to OWLAPI in a similar fashion (once the wrapper is written). Alternatively, you could wrap Jena Triple's as Sesame Statement's and use the code above to test it out now. Even if Jena doesn't supply a lazy iterator, the main point is that you don't need to serialize to disk to push triples through the pattern above, so any Collection would work. |
Hello everyone. |
The N-triples format output by toString() is invalid when the object of a triple is a literal; in the presence of a literal node the object should be wrapped in quotes. For replicating: it suffices to use an ontology with a data property assertion axiom with some string filler. I'm using RDFTranslator to get triples out of the input ontology, and serializing via RDFGraph.dumpTriples(...).
The text was updated successfully, but these errors were encountered: