Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-2344

Invalid JSON-LD context generated for CONSTRUCT query

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • Jena 4.1.0, Jena 4.5.0
    • None
    • ARQ, Fuseki, JSON-LD
    • None

    Description

      For URIs having a slash / in the fragment identifier an invalid JSON-LD context is generated.

       

      Steps to reproduce:

      1. 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" .
      2. Retrieve the triple in a CONSTRUCT query, e.g., CONSTRUCT WHERE { ?s ?p ?o }
      3. Set "Accept" header in HTTP call or "Content-Type (Graph)" in Fuseki WebUI
      4. 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.

      Attachments

        Activity

          People

            andy Andy Seaborne
            stefanbis Stefan Bischof
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: