Re: Change DESCRIBE @context

2017-10-11 Thread ajs6f
I don't think there's a per-query ability for that for the same reason as before-- JSON-LD hasn't described a way to 
signal that kind of preference via HTTP.



ajs6f

Laura Morales wrote on 10/8/17 4:58 AM:

By the way, I was looking at the examples... and I was wondering... Since Jena seems to support JSON-LD output in 
various formats ("compacted", "expanded", "flattened"), can this behavior be controlled 
from Fuseki? Either per-query, or maybe with some global setting? Or can I only change the output format if I use Jena 
with Java through the "RDFDataMgr" class?


Sent: Saturday, October 07, 2017 at 5:44 PM
From: "Andy Seaborne" 
To: users@jena.apache.org
Subject: Re: Change DESCRIBE @context
Try to get it working locally - read and write a file to get it in th
format you want.

https://jena.apache.org/documentation/io/rdf-output.html#json-ld

and the example:

https://github.com/apache/jena/blob/master/jena-arq/src-examples/arq/examples/riot/ExJsonLD.java[https://github.com/apache/jena/blob/master/jena-arq/src-examples/arq/examples/riot/ExJsonLD.java]

It is a long path through Fuseki so its hard to see which code is doing
what.

Note: the json-ld writer is from a different project. Fuseki isn't doing
anything for JSON-LD except passing it to the writer with the same
information that is available with Turtle or any other syntax.

Andy



Re: Change DESCRIBE @context

2017-10-08 Thread Andy Seaborne



On 08/10/17 09:40, Laura Morales wrote:

Note: the json-ld writer is from a different project. Fuseki isn't doing
anything for JSON-LD except passing it to the writer with the same
information that is available with Turtle or any other syntax.


Which 3rd-party library is Fuseki using to generate JSON-LD output? Maybe I can 
get in touch with them.



com.github.jsonld-java::jsonld-java

Version details of dependencies are in the POM for jena-project:

http://central.maven.org/maven2/org/apache/jena/jena-project/3.4.0/jena-project-3.4.0.pom

Andy


Re: Change DESCRIBE @context

2017-10-08 Thread Laura Morales
By the way, I was looking at the examples... and I was wondering... Since Jena 
seems to support JSON-LD output in various formats ("compacted", "expanded", 
"flattened"), can this behavior be controlled from Fuseki? Either per-query, or 
maybe with some global setting? Or can I only change the output format if I use 
Jena with Java through the "RDFDataMgr" class?


Sent: Saturday, October 07, 2017 at 5:44 PM
From: "Andy Seaborne" 
To: users@jena.apache.org
Subject: Re: Change DESCRIBE @context
Try to get it working locally - read and write a file to get it in th
format you want.

https://jena.apache.org/documentation/io/rdf-output.html#json-ld

and the example:

https://github.com/apache/jena/blob/master/jena-arq/src-examples/arq/examples/riot/ExJsonLD.java[https://github.com/apache/jena/blob/master/jena-arq/src-examples/arq/examples/riot/ExJsonLD.java]

It is a long path through Fuseki so its hard to see which code is doing
what.

Note: the json-ld writer is from a different project. Fuseki isn't doing
anything for JSON-LD except passing it to the writer with the same
information that is available with Turtle or any other syntax.

Andy


Re: Change DESCRIBE @context

2017-10-08 Thread Laura Morales
> Note: the json-ld writer is from a different project. Fuseki isn't doing
> anything for JSON-LD except passing it to the writer with the same
> information that is available with Turtle or any other syntax.

Which 3rd-party library is Fuseki using to generate JSON-LD output? Maybe I can 
get in touch with them.


Re: Change DESCRIBE @context

2017-10-07 Thread Andy Seaborne
Try to get it working locally - read and write a file to get it in th 
format you want.


https://jena.apache.org/documentation/io/rdf-output.html#json-ld

  and the example:

https://github.com/apache/jena/blob/master/jena-arq/src-examples/arq/examples/riot/ExJsonLD.java

It is a long path through Fuseki so its hard to see which code is doing 
what.


Note: the json-ld writer is from a different project. Fuseki isn't doing 
anything for JSON-LD except passing it to the writer with the same 
information that is available with Turtle or any other syntax.


Andy

On 07/10/17 16:24, Laura Morales wrote:

Not talking about proposing Fuseki a context/frame. I'm OK with a 
auto-generated context. But Fuseki is creating a new prefix for every URI (see 
previous email). Rather than creating 100s of new prefixes, it would be more 
useful if Fuseki would reuse the same PREFIXes that were already specified with 
my query. To see what I mean, send a DESCRIBE query and compare the Turtle and 
JSON-LD outputs. If my query was

 PREFIX ex: <http://example.org/vocab/>
 DESCRIBE ...
 FROM ...

Turtle will return predicates such as

  "My name"


then the data has a URI  in it.



whereas JSON-LD will return

  "My name"

because it creates a new prefix (in the context) called

 "name": "http://example.com/vocab/name";

I'm just asking that even the JSON-LD output uses the user defined PREFIXes as 
does Turtle.

Makes sense? Please let me know if I wasn't clear.




Sent: Saturday, October 07, 2017 at 4:49 PM
From: aj...@apache.org
To: users@jena.apache.org
Subject: Re: Change DESCRIBE @context
There's no way (as far as I know) right now to propose a particular context (or 
other profile information) via HTTP when
accepting JSON-LD:

https://github.com/json-ld/json-ld.org/issues/491

Or is your expectation that Jena would somehow figure out to do what you want 
unhinted? If you can define a very clear
and specific algorithm by which Jena could conservatively guess at the right 
way to build a @context, it might be
implementable.


ajs6f



Re: Change DESCRIBE @context

2017-10-07 Thread Laura Morales
Not talking about proposing Fuseki a context/frame. I'm OK with a 
auto-generated context. But Fuseki is creating a new prefix for every URI (see 
previous email). Rather than creating 100s of new prefixes, it would be more 
useful if Fuseki would reuse the same PREFIXes that were already specified with 
my query. To see what I mean, send a DESCRIBE query and compare the Turtle and 
JSON-LD outputs. If my query was

PREFIX ex: <http://example.org/vocab/>
DESCRIBE ...
FROM ...

Turtle will return predicates such as

 "My name"

whereas JSON-LD will return

 "My name"

because it creates a new prefix (in the context) called

"name": "http://example.com/vocab/name";

I'm just asking that even the JSON-LD output uses the user defined PREFIXes as 
does Turtle.

Makes sense? Please let me know if I wasn't clear.




Sent: Saturday, October 07, 2017 at 4:49 PM
From: aj...@apache.org
To: users@jena.apache.org
Subject: Re: Change DESCRIBE @context
There's no way (as far as I know) right now to propose a particular context (or 
other profile information) via HTTP when
accepting JSON-LD:

https://github.com/json-ld/json-ld.org/issues/491

Or is your expectation that Jena would somehow figure out to do what you want 
unhinted? If you can define a very clear
and specific algorithm by which Jena could conservatively guess at the right 
way to build a @context, it might be
implementable.


ajs6f


Re: Change DESCRIBE @context

2017-10-07 Thread ajs6f
There's no way (as far as I know) right now to propose a particular context (or other profile information) via HTTP when 
accepting JSON-LD:


https://github.com/json-ld/json-ld.org/issues/491

Or is your expectation that Jena would somehow figure out to do what you want unhinted? If you can define a very clear 
and specific algorithm by which Jena could conservatively guess at the right way to build a @context, it might be 
implementable.



ajs6f

Laura Morales wrote on 10/7/17 10:21 AM:

The problem is that Fuseki (when I select JSON-LD output format) creates a 
@context with as many properties as there are URIs. For example


  "@context" : {
"name" : {
  "@id" : "example.org/vocab/name",
  "@type" : ...
},
"surname" : {
  "@id" : "example.org/vocab/surname",
  "@type" : ...
},
"age" : {
  "@id" : "example.org/vocab/age",
  "@type" : ...
},
"ex": "example.org/vocab/"
  }


whereas all I want is


  "@context" : {
"ex": "example.org/vocab/"
  }




Sent: Saturday, October 07, 2017 at 12:37 PM
From: "Andy Seaborne" 
To: users@jena.apache.org
Subject: Re: Change DESCRIBE @context
The result Model from DESCRIBE has the prefixes of the data and the
query. There can be multiple prefixes for the same URI.

How that gets processed by JSON-LD is another matter and I don't know
the details.

Andy



Re: Change DESCRIBE @context

2017-10-07 Thread Laura Morales
The problem is that Fuseki (when I select JSON-LD output format) creates a 
@context with as many properties as there are URIs. For example


  "@context" : {
"name" : {
  "@id" : "example.org/vocab/name",
  "@type" : ...
},
"surname" : {
  "@id" : "example.org/vocab/surname",
  "@type" : ...
},
"age" : {
  "@id" : "example.org/vocab/age",
  "@type" : ...
},
"ex": "example.org/vocab/"
  }


whereas all I want is


  "@context" : {
    "ex": "example.org/vocab/"
  }




Sent: Saturday, October 07, 2017 at 12:37 PM
From: "Andy Seaborne" 
To: users@jena.apache.org
Subject: Re: Change DESCRIBE @context
The result Model from DESCRIBE has the prefixes of the data and the
query. There can be multiple prefixes for the same URI.

How that gets processed by JSON-LD is another matter and I don't know
the details.

Andy


Re: Change DESCRIBE @context

2017-10-07 Thread Andy Seaborne
The result Model from DESCRIBE has the prefixes of the data and the 
query.  There can be multiple prefixes for the same URI.


How that gets processed by JSON-LD is another matter and I don't know 
the details.


Andy

On 07/10/17 10:27, Laura Morales wrote:

When I query Fuseki like this "DESCRIBE <> FROM <>" and return a JSON-LD, it looks like the 
"@context" is generated automatically and it ignores any "PREFIX" declaration.
For example if I have "PREFIX foo: " it will create the property 
"Person" instead of "foo:Person".

Is there any way that I can tweak my DESCRIBE query to return properties as "foo:Person" 
instead of the automatically generated "Person"?