Details
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"
{
"@id" : "_:b0",
"/definitions/category" : "meter",
"@context" : {
"/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.