[
https://issues.apache.org/jira/browse/JENA-1971?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andy Seaborne resolved JENA-1971.
---------------------------------
Fix Version/s: Jena 4.5.0
Assignee: Andy Seaborne
Resolution: Not A Problem
> JSONLD property compaction bug
> ------------------------------
>
> Key: JENA-1971
> URL: https://issues.apache.org/jira/browse/JENA-1971
> Project: Apache Jena
> Issue Type: Bug
> Components: JSON-LD
> Affects Versions: Jena 3.16.0
> Environment: The code and data used can be found at:
>
> https://github.com/ebremer/jenabug/blob/master/src/main/java/com/demo/JSONLDBUG.java
> Reporter: Erich Bremer
> Assignee: Andy Seaborne
> Priority: Major
> Fix For: Jena 4.5.0
>
>
> Exporting this TTL from a Model:
> {noformat}
> <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> .
> {noformat}
> Yields the expected JSONLD:
> {noformat}
> {
> "@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"
> }
> }
> }
> {noformat}
> However, removing the one comment in the TTL and adding an additional triple
> prevents the compaction of the property "cheesey" from being shortened:
> {noformat}
> {
> "@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"
> }
> }
> }
> {noformat}
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]