You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Adrian Gschwend <ml...@netlabs.org> on 2013/09/05 16:12:45 UTC

Re: JSON-LD as a Fuseki output format

On 21.07.13 15:38, Andy Seaborne wrote:

Hi guys,

> Joachim brings up an issue that I've seen several times now - not
> everything is table shaped - and CONSTRUCT is one way to address that.

was just running into the same issue today, I want to make the
DESCRIBE/CONSTRUCT queries available to classical web developers and
JSON-LD seems to be the way to go now.

> The only things missing are adding in the JSON_LD module and updating
> Fuseki's content negotiation.

sounds great, any progress on that one?

regards

Adrian



Re: JSON-LD as a Fuseki output format

Posted by Martynas Jusevičius <ma...@graphity.org>.
I've developed a basic XSLT 2.0 stylesheet transforming Jena's RDF/XML
into simple JSON-LD:
https://github.com/Graphity/graphity-browser/blob/master/src/main/resources/org/graphity/client/writer/rdfxml2json-ld.xsl

Graphity's JSONLDWriter can be used as a MessageBodyWriter<Model>
provider in a JAX-RS Application:

  singletons.add(new
JSONLDWriter(getSource("org/graphity/client/writer/rdfxml2json-ld.xsl"),
DataManager.get()));

This provides content negotiation for JSON-LD.


Martynas
graphityhq.com

On Thu, Sep 5, 2013 at 4:12 PM, Adrian Gschwend <ml...@netlabs.org> wrote:
> On 21.07.13 15:38, Andy Seaborne wrote:
>
> Hi guys,
>
>> Joachim brings up an issue that I've seen several times now - not
>> everything is table shaped - and CONSTRUCT is one way to address that.
>
> was just running into the same issue today, I want to make the
> DESCRIBE/CONSTRUCT queries available to classical web developers and
> JSON-LD seems to be the way to go now.
>
>> The only things missing are adding in the JSON_LD module and updating
>> Fuseki's content negotiation.
>
> sounds great, any progress on that one?
>
> regards
>
> Adrian
>
>

Re: JSON-LD as a Fuseki output format

Posted by Adrian Gschwend <ml...@netlabs.org>.
On 05.09.13 22:33, Adrian Gschwend wrote:

> IMHO json-ld is only useful if everything is "prefixed", otherwise we
> can directly work with application/rdf+json as it looks pretty much the
> same (to me at least).

ok I correct myself, you do get some kind of nesting so it's a bit more
readable for graphs.

regards

Adrian

Re: JSON-LD as a Fuseki output format

Posted by Adrian Gschwend <ml...@netlabs.org>.
On 05.09.13 22:05, Andy Seaborne wrote:

> In particular, whether the pure RDF to JSON-LD synatx produces something
> a normal web dev would relate to.

good point, I'm just trying to understand that too (will post to their
list as I don't get it yet).

IMHO json-ld is only useful if everything is "prefixed", otherwise we
can directly work with application/rdf+json as it looks pretty much the
same (to me at least).

IIRC a CONSTRUCT query in Fuseki will use PREFIXes defined and when
text/turtle is requested return a "shrinked" file, which is very
readable (by the way would that be true for DESCRIBE as well?).

So my proposal/wish would be that if no PREFIXes are defined, you get
the basic json-ld view (not sure how they call this one) for
application/ld+json and if we do have PREFIXes, we return a "compacted"
form using @context for all the prefixes.

But then again maybe I just didn't get json-ld yet :)

> We're approaching a jena release.  It is important this release happens
> soon.
> 
> At the moment, this isn't in it.  It does introduce some new
> dependencies so the legal-stuff needs doing but it *might* just be
> possible to get it in.  If feedback were forth coming ... hint hint ...

It would be great IMHO because right now it's pretty much impossible to
get directly json-ld from a triplestore. In fact I want to create a
sample output from my platform as I have to convince some webdevs in two
weeks at a conference.

regards

Adrian

Re: JSON-LD as a Fuseki output format

Posted by Andy Seaborne <an...@apache.org>.
What would be useful is feedback - I haven't heard much from anyone.

In particular, whether the pure RDF to JSON-LD synatx produces something 
a normal web dev would relate to.

(The prefixes to 'context isn't done IIRC)

We're approaching a jena release.  It is important this release happens 
soon.

At the moment, this isn't in it.  It does introduce some new 
dependencies so the legal-stuff needs doing but it *might* just be 
possible to get it in.  If feedback were forth coming ... hint hint ...

	Andy

On 05/09/13 15:50, Olivier Rossel wrote:
> sounds great indeed.
>
> fyi, i also have a n3->json converter somewhere, that works surprisingly
> well in those cases.
> (n3 is sent on the wire, and client side regenerates the corresponding
> *graph* structure as javascript objects).
>
> PS: btw, did the JSON-LD make their "graphify()" function available in
> their JS lib?
>
>
>
> On Thu, Sep 5, 2013 at 4:12 PM, Adrian Gschwend <ml...@netlabs.org> wrote:
>
>> On 21.07.13 15:38, Andy Seaborne wrote:
>>
>> Hi guys,
>>
>>> Joachim brings up an issue that I've seen several times now - not
>>> everything is table shaped - and CONSTRUCT is one way to address that.
>>
>> was just running into the same issue today, I want to make the
>> DESCRIBE/CONSTRUCT queries available to classical web developers and
>> JSON-LD seems to be the way to go now.
>>
>>> The only things missing are adding in the JSON_LD module and updating
>>> Fuseki's content negotiation.
>>
>> sounds great, any progress on that one?
>>
>> regards
>>
>> Adrian
>>
>>
>>
>


Re: JSON-LD as a Fuseki output format

Posted by Olivier Rossel <ol...@gmail.com>.
sounds great indeed.

fyi, i also have a n3->json converter somewhere, that works surprisingly
well in those cases.
(n3 is sent on the wire, and client side regenerates the corresponding
*graph* structure as javascript objects).

PS: btw, did the JSON-LD make their "graphify()" function available in
their JS lib?



On Thu, Sep 5, 2013 at 4:12 PM, Adrian Gschwend <ml...@netlabs.org> wrote:

> On 21.07.13 15:38, Andy Seaborne wrote:
>
> Hi guys,
>
> > Joachim brings up an issue that I've seen several times now - not
> > everything is table shaped - and CONSTRUCT is one way to address that.
>
> was just running into the same issue today, I want to make the
> DESCRIBE/CONSTRUCT queries available to classical web developers and
> JSON-LD seems to be the way to go now.
>
> > The only things missing are adding in the JSON_LD module and updating
> > Fuseki's content negotiation.
>
> sounds great, any progress on that one?
>
> regards
>
> Adrian
>
>
>