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

JSONLD property compaction bug

    XMLWordPrintableJSON

Details

    Description

      Exporting this TTL from a Model:

       <http://me.com>  <http://zam.com/ns/cheesey> "WOW" .
      #<http://me.com>  <http://zam.com/ns/cheesey>  ( "png" "jpg" "tif" "gif" ) .
      <http://notme.com> <http://zam.com/ns/cheesey>  ( "png" "jpg" "tif" "gif" ) .
      <http://www.twotowers.com/a>
              <http://shadowfax.com/ns/height>
                      "262144"^^<http://www.w3.org/2001/XMLSchema#int> ;
              <http://shadowfax.com/ns/width>
                      "262144"^^<http://www.w3.org/2001/XMLSchema#int> .
      

      Yields the expected JSONLD:

      {
        "@graph" : [ {
          "@id" : "http://me.com",
          "cheesey" : "WOW"
        }, {
          "@id" : "http://notme.com",
          "cheesey" : {
            "@list" : [ "png", "jpg", "tif", "gif" ]
          }
        }, {
          "@id" : "http://www.twotowers.com/a",
          "height" : "262144",
          "width" : "262144"
        } ],
        "@context" : {
          "rest" : {
            "@id" : "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",
            "@type" : "@id"
          },
          "first" : {
            "@id" : "http://www.w3.org/1999/02/22-rdf-syntax-ns#first"
          },
          "cheesey" : {
            "@id" : "http://zam.com/ns/cheesey"
          },
          "width" : {
            "@id" : "http://shadowfax.com/ns/width",
            "@type" : "http://www.w3.org/2001/XMLSchema#int"
          },
          "height" : {
            "@id" : "http://shadowfax.com/ns/height",
            "@type" : "http://www.w3.org/2001/XMLSchema#int"
          }
        }
      }
      

      However, removing the one comment in the TTL and adding an additional triple prevents the compaction of the property "cheesey" from being shortened:

      {
        "@graph" : [ {
          "@id" : "http://me.com",
          "http://zam.com/ns/cheesey" : [ {
            "@list" : [ "png", "jpg", "tif", "gif" ]
          }, "WOW" ]
        }, {
          "@id" : "http://notme.com",
          "http://zam.com/ns/cheesey" : {
            "@list" : [ "png", "jpg", "tif", "gif" ]
          }
        }, {
          "@id" : "http://www.twotowers.com/a",
          "height" : "262144",
          "width" : "262144"
        } ],
        "@context" : {
          "rest" : {
            "@id" : "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",
            "@type" : "@id"
          },
          "first" : {
            "@id" : "http://www.w3.org/1999/02/22-rdf-syntax-ns#first"
          },
          "cheesey" : {
            "@id" : "http://zam.com/ns/cheesey",
            "@type" : "@id"
          },
          "width" : {
            "@id" : "http://shadowfax.com/ns/width",
            "@type" : "http://www.w3.org/2001/XMLSchema#int"
          },
          "height" : {
            "@id" : "http://shadowfax.com/ns/height",
            "@type" : "http://www.w3.org/2001/XMLSchema#int"
          }
        }
      }
      

      Attachments

        Activity

          People

            andy Andy Seaborne
            ebremer Erich Bremer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: