You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@jena.apache.org by "Stefan Bischof (Jira)" <ji...@apache.org> on 2022/08/09 08:23:00 UTC
[jira] [Updated] (JENA-2344) Invalid JSON-LD context generated for CONSTRUCT query
[ https://issues.apache.org/jira/browse/JENA-2344?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stefan Bischof updated JENA-2344:
---------------------------------
Component/s: ARQ
Affects Version/s: Jena 4.5.0
Description:
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"
{
"@graph" : [ ],
"@context" : {
"/definitions/category" :
{ "@id" : "https://smart-data-models.github.io/data-models/terms.jsonld#/definitions/category" }
}
}
{color:#24292f}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: {color}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.
was:
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"
{
"@graph" : [ ],
"@context" : {
"/definitions/category" : {
"@id" : "https://smart-data-models.github.io/data-models/terms.jsonld#/definitions/category"
}
}
}
{color:#24292f}{color:#24292f}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: {color}{color}jsonld.SyntaxError: Invalid JSON-LD syntax; term in form of IRI must expand to definition.
{color:#24292f} {color}
> 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"
>
> {
> "@graph" : [ ],
> "@context" : {
> "/definitions/category" :
> { "@id" : "https://smart-data-models.github.io/data-models/terms.jsonld#/definitions/category" }
> }
> }
>
> {color:#24292f}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: {color}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: jira-unsubscribe@jena.apache.org
For additional commands, e-mail: jira-help@jena.apache.org