gkellogg commented on issue #1254:
URL: https://github.com/apache/jena/issues/1254#issuecomment-1101793606

   Yes, this was intentional, as terms were used too liberally as prefixes, 
which caused unintended consequences. The note in the [Changes since 1.0 
Recommendation of 16 January 
2014](https://www.w3.org/TR/json-ld11-api/#changes-since-1-0-recommendation-of-16-january-2014)
 says the following:
   
   > In JSON-LD 1.1, terms will be used as [compact 
IRI](https://www.w3.org/TR/json-ld11/#dfn-compact-iri) prefixes when compacting 
only if a [simple term 
definition](https://www.w3.org/TR/json-ld11/#dfn-simple-term-definition) is 
used where the value ends with a URI 
[gen-delim](https://tools.ietf.org/html/rfc3986#section-2.2) character, or if 
their [expanded term 
definition](https://www.w3.org/TR/json-ld11/#dfn-expanded-term-definition) 
contains an @prefix [entry](https://infra.spec.whatwg.org/#map-entry) with the 
value true. The 1.0 algorithm has been updated to only consider terms that map 
to a value that ends with a URI 
[gen-delim](https://tools.ietf.org/html/rfc3986#section-2.2) character.
   
   The operative step is Step 10 in the [Create Term Definition 
Algorithm](https://www.w3.org/TR/json-ld11-api/#algorithm-0)
   
   > Create a new [term 
definition](https://www.w3.org/TR/json-ld11/#dfn-term-definition), definition, 
initializing [prefix 
flag](https://www.w3.org/TR/json-ld11-api/#dfn-prefix-flag) to false, 
[protected](https://www.w3.org/TR/json-ld11-api/#dfn-protected) to protected, 
and [reverse 
property](https://www.w3.org/TR/json-ld11-api/#dfn-reverse-property) to false.
   
   And step 14.2.5:
   
   > If term contains neither a colon (:) nor a slash (/), simple term is true, 
and if the [IRI](https://tools.ietf.org/html/rfc3987#section-2) mapping of 
definition is either an IRI ending with a 
[gen-delim](https://tools.ietf.org/html/rfc3986#section-2.2) character, or a 
[blank node 
identifier](https://www.w3.org/TR/rdf11-concepts/#dfn-blank-node-identifier), 
set the [prefix flag](https://www.w3.org/TR/json-ld11-api/#dfn-prefix-flag) in 
definition to true.
   
   The operative bit is that this is not a _simple term_.
   
   This can be changed by adding `"@prefix": true` to the term definition 
([playground 
link](https://json-ld.org/playground/#startTab=tab-nquads&json-ld=%7B%22%40id%22%3A%22http%3A%2F%2Fexample%2Fcollection%22%2C%22http%3A%2F%2Fexample%2Fp%22%3A%5B%22book%3AZZZ%22%5D%2C%22book%22%3A%5B%22book%3AYYY%22%5D%2C%22%40context%22%3A%7B%22book%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fonbetween.ch%2F3ms%2Fcms%23%22%2C%22%40type%22%3A%22%40id%22%2C%22%40prefix%22%3Atrue%7D%7D%7D)):
   
   ```json
   {
     "@id" : "http://example/collection";,
     "http://example/p"; : [ "book:ZZZ" ],
     "book" : [ "book:YYY" ],
     "@context" : {
       "book" : {
         "@id" : "http://onbetween.ch/3ms/cms#";,
         "@type" : "@id",
         "@prefix": true
       }
     }
   }
   ```
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to