-
Notifications
You must be signed in to change notification settings - Fork 17
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
construct query #4
Comments
Hi Sam, Thanks for you question. With the code as it currently stands you have two choices. The most straight forward (but maybe least satisfying) is to use the the (although I'm realizing there might be problems with the return type - as the output is triples not bindings...) The other immediately available option is to use a forward-chaining rule -- which are essentially constructs with a few more (optional) bells and whistles and they are formatted as clj data so they can be more easily tested and manipulated. Take a look at There are some examples of the rules and their tests here: The rules are meant to be declarative date, and serialized in any number of actionable ways. Right now there is just this rule applier, but they could also be made into CONSTRUCTS or I have another pending request to look at outputting them in RIF. That said, it shouldn't be hard to create a function The trickier bit will probably be extending the sparqlKB protocol to have a construct function and getting the return types correct. The results of a construct query is a full graph / rdf document right? but it's not immediately materialized into the KB, right? What are the typical use-cases for the output of constructs? thanks, |
I've added API support for sparql construct queries, in both the return a set of statements form and a visitor form. I implemented a Sesame version of this. (I don't know if you are using the sesame or jena implementation) Jena shouldn't be too hard to add. If you want to test this against your use cases you can grab a copy of the current repository from github then in the top kr directory:
then use as coordinates for KR in your project the version You can see example calls here (they work just like Kevin |
I should have added like the Kevin |
I'm pushing version 1.4.9 public now. It has support for Hopefully this addresses your use case - please let me know, and I'll close this issue. Or if not we can add some more tests, or ways to interact with it. Kevin |
Hi Kevin So first thanks for your quick addition ! So i used something like that : (defn get-turtle-construct This work perfectly for me. Thanks again for your wrok and sorry for this late response. Samuel |
Ah. OK. I thought about implementing the writing to files too... as an intermediary you could use the visit pattern and set up a writer KB to add the triples to the output KB. That will get you an ntriple file. That's a little round-about but it would work fine. The example writer KB uses NTtriple by default (that's all I initially needed) but it shouldn't be hard to create a flag to change which RDF writer is used. see the Kevin (I think it's a worthwhile patch - and should be done, I might not be able to code this up in under a week though - I'm at professional meetings and other obligations this week.) |
Hi,
Is it possible to do a CONSTRUCT sparql query ?
Thanks,
Sam
The text was updated successfully, but these errors were encountered: