rdf

joelkuiper 2015-08-26T10:44:27.000004Z

hey 😛

2015-08-26T10:44:42.000005Z

yo

joelkuiper 2015-08-26T10:45:04.000006Z

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

2015-08-26T10:45:18.000007Z

Awesome! :simple_smile:

joelkuiper 2015-08-26T10:45:37.000008Z

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:

2015-08-26T10:45:48.000009Z

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

joelkuiper 2015-08-26T10:47:06.000010Z

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!

joelkuiper 2015-08-26T10:47:17.000011Z

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

joelkuiper 2015-08-26T10:47:22.000012Z

(that I wrote)

joelkuiper 2015-08-26T10:49:43.000013Z

https://github.com/joelkuiper/yesparql#results-processing

2015-08-26T10:50:47.000016Z

:simple_smile:

2015-08-26T10:51:10.000017Z

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

2015-08-26T10:51:52.000018Z

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

2015-08-26T10:52:37.000019Z

maybe we need the ring of clojure RDF :simple_smile:

joelkuiper 2015-08-26T10:52:57.000020Z

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

2015-08-26T10:53:37.000021Z

Have you seen this btw: http://commonsrdf.incubator.apache.org/

joelkuiper 2015-08-26T10:54:09.000022Z

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

2015-08-26T10:54:11.000023Z

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

joelkuiper 2015-08-26T10:54:22.000024Z

hmm, no that sounds very useful

joelkuiper 2015-08-26T10:54:36.000025Z

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

2015-08-26T10:54:42.000026Z

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

joelkuiper 2015-08-26T10:55:09.000027Z

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

2015-08-26T10:55:15.000028Z

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

2015-08-26T10:55:27.000029Z

JENA 3 might support it - not sure

joelkuiper 2015-08-26T10:55:31.000030Z

Over CommonsRDF?

joelkuiper 2015-08-26T10:55:51.000031Z

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

2015-08-26T10:56:00.000032Z

maybe not then

2015-08-26T10:56:17.000033Z

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

2015-08-26T10:56:28.000034Z

(I think)

2015-08-26T10:56:53.000035Z

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

joelkuiper 2015-08-26T10:56:58.000036Z

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

joelkuiper 2015-08-26T10:57:01.000037Z

same here 😉

2015-08-26T10:58:03.000038Z

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)

2015-08-26T10:58:38.000039Z

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

joelkuiper 2015-08-26T10:58:56.000040Z

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

joelkuiper 2015-08-26T10:58:59.000041Z

that’s a win I’d say

joelkuiper 2015-08-26T10:59:19.000042Z

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

joelkuiper 2015-08-26T11:04:28.000043Z

[announcement] YeSPARQL 0.1.5 https://github.com/joelkuiper/yesparql, see https://github.com/joelkuiper/yesparql#results-processing for the most notable change

jamesaoverton 2015-08-26T13:19:00.000045Z

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

2015-08-26T13:27:01.000046Z

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:

joelkuiper 2015-08-26T14:45:40.000048Z

How would grafter parse a http://www.w3.org/1999/02/22-rdf-syntax-ns#langString to a Clojure object?

joelkuiper 2015-08-26T14:45:54.000049Z

something like {:value … :lang …} ?

jamesaoverton 2015-08-26T14:50:09.000051Z

That’s the shape used in EDN-LD: https://github.com/ontodev/edn-ld/blob/master/test/edn_ld/core_test.clj#L74

jamesaoverton 2015-08-26T14:52:13.000053Z

… which is intentionally similar to JSON-LD.

joelkuiper 2015-08-26T14:58:38.000054Z

hmm, may stick to that then

joelkuiper 2015-08-26T15:00:49.000055Z

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

jamesaoverton 2015-08-26T15:02:02.000056Z

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

jamesaoverton 2015-08-26T15:02:45.000057Z

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

jamesaoverton 2015-08-26T15:03:04.000058Z

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

joelkuiper 2015-08-26T15:03:15.000059Z

hmm, makes sense

jamesaoverton 2015-08-26T15:03:52.000060Z

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

joelkuiper 2015-08-26T17:36:51.000061Z

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 …

jamesaoverton 2015-08-26T17:44:07.000062Z

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.

jamesaoverton 2015-08-26T17:46:06.000063Z

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

jamesaoverton 2015-08-26T17:48:54.000064Z

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.

joelkuiper 2015-08-26T17:51:59.000065Z

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

joelkuiper 2015-08-26T17:52:30.000066Z

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

jamesaoverton 2015-08-26T17:54:42.000067Z

Does this help? https://jena.apache.org/documentation/query/construct-quad.html

jamesaoverton 2015-08-26T17:55:25.000068Z

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

joelkuiper 2015-08-26T17:55:41.000069Z

no, funnily neither execConstructQuads

joelkuiper 2015-08-26T17:55:59.000070Z

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

jamesaoverton 2015-08-26T17:56:37.000071Z

Do those methods run? Are they just undocumented?

joelkuiper 2015-08-26T17:56:42.000072Z

unsure

joelkuiper 2015-08-26T17:57:09.000073Z

hang on, I’ll try

joelkuiper 2015-08-26T17:57:22.000074Z

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

jamesaoverton 2015-08-26T17:59:05.000075Z

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.

joelkuiper 2015-08-26T18:01:52.000076Z

hmm looks like they’re not in 3.0

joelkuiper 2015-08-26T18:01:56.000077Z

seems like a recent addition

joelkuiper 2015-08-26T18:09:10.000078Z

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

jamesaoverton 2015-08-26T18:10:36.000079Z

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

joelkuiper 2015-08-26T18:13:49.000080Z

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

joelkuiper 2015-08-26T18:14:10.000081Z

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

joelkuiper 2015-08-26T18:48:51.000085Z

Initial try of getting type conversion to work in YeSPARQL

joelkuiper 2015-08-26T18:48:59.000088Z

unfortunately no quads 😉

quoll 2015-08-26T18:53:20.000089Z

can always just use a SELECT

joelkuiper 2015-08-26T18:56:37.000090Z

sure, but that’s kinda hacky 😛

joelkuiper 2015-08-26T19:01:34.000091Z

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