[ 
https://issues.apache.org/jira/browse/JENA-2344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17577374#comment-17577374
 ] 

Andy Seaborne commented on JENA-2344:
-------------------------------------

Hi [~stefanbis]

I can't reproduce this for Fuseki 4.5.0.

It does fail for 4.4.0 and earlier versions - writer was writing JSON-LD 1.0 
where jena uses jsonld-java but 4.5.0 switched to JSON-LD 1.1 output.

Maybe results got cached somewhere? Or it is 

 

Fuseki 4.5.0:
{noformat}
 curl -g --header 'Accept: application/ld+json' -d 'query=CONSTRUCTWHERE {?s ?p 
?o}' http://localhost:3030/ds
{noformat}
{noformat}
{
    "@id": "_:b0",
    
"https://smart-data-models.github.io/data-models/terms.jsonld#/definitions/category":
 "meter"
}
{noformat}
which is produced by Titanium-jsonld which provides JSON-LD 1.1. Similarly CLI  
{{riot --out JSON-LD D.ttl}}.

{noformat}
riot --version
Jena:       VERSION: 4.5.0
Jena:       BUILD_DATE: 2022-05-01T13:58:04Z
{noformat}


 

[The JSON-LD 1.0 playground|https://json-ld.org/playground/1.0/] says the 
{{@context}} version is legal JSON-LD 1.0.  This is not the first example we've 
had when JSON-LD 1.1 is incompatible with JSON-LD 1.0. JSON-LD 1.1 should have 
been called JSON-LD 2.0.

> Invalid JSON-LD context generated for CONSTRUCT query
> -----------------------------------------------------
>
>                 Key: JENA-2344
>                 URL: https://issues.apache.org/jira/browse/JENA-2344
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: ARQ, Fuseki, JSON-LD
>    Affects Versions: Jena 4.1.0, Jena 4.5.0
>            Reporter: Stefan Bischof
>            Priority: Major
>
> For URIs having a slash / in the fragment identifier an invalid JSON-LD 
> context is generated.
>  
> Steps to reproduce:
>  # Add a triple with with a slash in the fragment identifier to some graph, 
> e.g., "[] 
> <[https://smart-data-models.github.io/data-models/terms.jsonld#/definitions/category]>
>  "meter" .
>  # Retrieve the triple in a CONSTRUCT query, e.g., CONSTRUCT WHERE \{ ?s ?p 
> ?o }
>  # Set "Accept" header in HTTP call or "Content-Type (Graph)" in Fuseki WebUI
>  # The context at the end of the response includes the invalid key 
> "/definitions/category"
> {
>   "@id" : "_:b0",
>   "/definitions/category" : "meter",
>   "@context" : {
>     "/definitions/category" : {
>       "@id" : 
> "https://smart-data-models.github.io/data-models/terms.jsonld#/definitions/category";
>     }
>   }
> }
>  
> Although I couldn't find a formal grammar for JSON-LD, the python parser I 
> used and the parser on the JSON-LD playground 
> [https://json-ld.org/playground/] did not accept this: jsonld.SyntaxError: 
> Invalid JSON-LD syntax; term in form of IRI must expand to definition.
> I could replicate the same behaviour on the cli with ARQ 4.5.0.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to