IRI Compaction creates unintended compact IRIs

As described in https://github.com/json-ld/json-ld.org/pull/511#issuecomment-313263440, the mechanism used for constructing compact IRIs from terms considers terms that are not intended to be used for prefixes. For example, if a context defines “schema”: “http://schema.org”, and the term “sport”: {“@id”: “schema:sport”, “@type”: “@id”}, when compacting the IRI http://schema.org/sportsEvent, it will generate “sport:sEvent”. There are numerous similar examples.

This is fixed in the CG version in https://github.com/json-ld/json-ld.org/pull/511; when compacting documents in legacy mode, only simple terms (not having a complex term definitions) ending in a delimiter are considered for constructing compact IRIs. For new usage, when version is set appropriately, this can be further modified by adding a @prefix entry in a term definition.

Gregg Kellogg
gregg@greggkellogg.net

Received on Tuesday, 23 January 2018 19:33:13 UTC