Fork me on GitHub
#rdf
<
2015-08-26
>
joelkuiper10:08:04

So based on the feedback by @rickmoynihan I’ll be releasing a new version of YeSPARQL that is able to consume the ResultSet iteratively

joelkuiper10:08:37

We’re still debating some future ideas, for example doing type conversion to native Clojure data structures, but that’ll be work for another version simple_smile

rickmoynihan10:08:48

I probably won't get much time to try YeSPARQL this week

joelkuiper10:08:06

Me neither, I have some other stuff to do as well simple_smile but it’s probably good to sleep on it some more as well!

joelkuiper10:08:17

It’s fun, first Clojure library that has some attention simple_smile

joelkuiper10:08:22

(that I wrote)

rickmoynihan10:08:10

Glad you're enjoying it - its great to see some activity other Grafter in the clojure RDF space

rickmoynihan10:08:52

I definitely think we should try and work together / as much as we can -- to create a healthy eco-system

rickmoynihan10:08:37

maybe we need the ring of clojure RDF simple_smile

joelkuiper10:08:57

yeah it’s silly, I never really liked Semantic Web. But I’m working in the biomedical space, and I use of a lot ontologies (like UMLS, Human Phenotype, Cancer Ontology), mostly for annotation of database resources with OpenAnnotations … and I kinda enjoy it. There are so many things that seem to have been reinvented outside Semantic Web as well a couple of times, but the whole thing has a nice holistic feel to it

joelkuiper10:08:09

yeah, we could discuss what that would look like. Stupid thing is that there are two competing libraries (sesame and jena), with different tradeoffs

rickmoynihan10:08:11

Its a project to help enable basic interop between sesame/jena

joelkuiper10:08:22

hmm, no that sounds very useful

joelkuiper10:08:36

is it a bit mature? We might piggy back on to off that for YeSPARQL/Grafter

rickmoynihan10:08:42

I don't think they support it yet -- but I think sesame 4 and the next JENA will

joelkuiper10:08:09

awesome, Jena just released 3.0 (after a long while) … so it might take some time 😛

rickmoynihan10:08:15

well I was thinking a minimal clojure wrapper over it would be nice

rickmoynihan10:08:27

JENA 3 might support it - not sure

joelkuiper10:08:31

Over CommonsRDF?

joelkuiper10:08:51

I saw no mention in the release notes, might have missed it … although they’re not very good at documenting some times 😛

rickmoynihan10:08:00

maybe not then

rickmoynihan10:08:17

but it has both JENA and Sesame contributors working together on it

rickmoynihan10:08:53

ok going to go quiet for a while - I need to do some real work simple_smile

joelkuiper10:08:58

Right, so writing a little library that takes Common RDF representations and maps it to Clojure data structures would solve the Jena/Sesame interop nicely I think

joelkuiper10:08:01

same here 😉

rickmoynihan10:08:03

I think thats a long term thing -- right now our best hope of doing that is probably to use some common protocols across both jena/sesame core types (and also the commons-rdf ones)

rickmoynihan10:08:38

not sure on the details though -- might not achieve much in practice...

joelkuiper10:08:56

well we could re-use that library across YeSPARQL and Grafter

joelkuiper10:08:59

that’s a win I’d say

joelkuiper10:08:19

and if Jena, Sesame switch to CommonsRDF it will only make it easier I guess

jamesaoverton13:08:00

@rickmoynihan: Thanks for the link to Apache Commons RDF. First I’d heard of it.

rickmoynihan13:08:01

n/p @jamesaoverton -- not really sure how useful it is yet though - as neither sesame or jena appear to actually implement those interfaces yet ... more something for the future simple_smile

joelkuiper14:08:54

something like {:value … :lang …} ?

jamesaoverton14:08:13

… which is intentionally similar to JSON-LD.

joelkuiper14:08:38

hmm, may stick to that then

joelkuiper15:08:49

what would you prefer to return as an URI, a java.net.URI or just a string?

jamesaoverton15:08:02

I work with OWL 2 a lot, which uses IRIs. The OWLAPI has its own IRI class: http://owlapi.sourceforge.net/javadoc/org/semanticweb/owlapi/model/IRI.html

jamesaoverton15:08:45

Instead of choosing between java.net.URI and that IRI class, I just stick with strings.

jamesaoverton15:08:04

So, that’s the tradeoff I’ve chosen.

joelkuiper15:08:15

hmm, makes sense

jamesaoverton15:08:52

I’ll be interested to hear how Grafter does it.

joelkuiper17:08:51

This will sounds really stupid … but how do you get the Quads from a Jena Model? I’m iterating over Statements, but I have no idea how to get the graph names …

jamesaoverton17:08:07

I think that com.hp.hpl.jena.rdf.model.Model is just a set of triples. So you’ll also need the name of graph that the model represents to make a quad.

jamesaoverton17:08:06

To deal with multiple graphs, you use com.hp.hpl.jena.query.Dataset which contains a bunch of Models.

jamesaoverton17:08:54

And remember that Jena has two main interfaces for triples: Model and Graph. Likewise there are two main interfaces for quads: Dataset and DatasetGraph. It’s easy to convert between the pairs of interfaces. DatasetGraph explicitly has quads.

joelkuiper17:08:59

right but if I do an execConstruct on a QueryExecution I get a Model, can I get the graphs from that?

joelkuiper17:08:30

Or will it do something clever and return something else when the query has Quads? (like a Dataset?)

jamesaoverton17:08:25

I don’t see QueryExecution.execConstructDataset() in the JavaDocs...

joelkuiper17:08:41

no, funnily neither execConstructQuads

joelkuiper17:08:59

it’s weird though right, if I run execConstruct I would persume I’d be able to get quads somehow

jamesaoverton17:08:37

Do those methods run? Are they just undocumented?

joelkuiper17:08:09

hang on, I’ll try

joelkuiper17:08:22

if execConstructDataset works I assume I can get quads from that somehow

jamesaoverton17:08:05

The only thing I’ve done in the past is run UpdateProcessor.execute() on a DatasetGraph, then grab the stuff I want from the modified DatasetGraph. It works fine, but I don’t think it’s what you want.

joelkuiper18:08:52

hmm looks like they’re not in 3.0

joelkuiper18:08:56

seems like a recent addition

joelkuiper18:08:10

there’s getDataset on QueryExecution, but I’m not sure how that works

jamesaoverton18:08:36

My guess would be that it gets you back the Dataset that you specified in QueryExecutionFactory.create().

joelkuiper18:08:49

right, so that won’t work for remote SPARQL endpoints

joelkuiper18:08:10

so no way of getting quads from a SPARQL construct in Jena 3.0 😛

joelkuiper18:08:51

Initial try of getting type conversion to work in YeSPARQL

joelkuiper18:08:59

unfortunately no quads 😉

quoll18:08:20

can always just use a SELECT

joelkuiper18:08:37

sure, but that’s kinda hacky 😛

joelkuiper19:08:34

seems like it’s being worked on, just a matter of waiting I guess