Restrictions on reverse term definitions

Hi all,

I'm wondering about the following rule in the JSON-LD Syntax, section "B.7
Context Definitions":

    If an expanded term definition has an @reverse member, @id, @type, and
@language are not allowed. If an @container member exists, its value must
be null or @index.

Why can't the definition contain "@container": "@set", to tell a compaction
mechanism to always use an array? And/or use "@type": "@id" to allow for
use of IRIs as strings.

Is it because the specified compaction doesn't make use of that (since it
only uses reverses if it's explicitly given in the expanded form)? I can
certainly understand that from the case of simplicity for that algorithm,
but another compaction mechanism (e.g. using repeated re-embedding) could
make use of @container or @type here. So I'm not sure if it's good to
disallow this syntactically...

In my example, I want to use it like:

    {
        "@context": {
            "@vocab": "http://schema.org/",
            "instances": {"@reverse": "instanceOf", "@container": "@set"}
        },
        "@id": "/work/123",
        "@type": "CreativeWork",
        "instances": [
            {
                "@id": "/instance/123/a",
                "@type": "CreativeWork"
            },
            {
                "@id": "/instance/123/b",
                "@type": "CreativeWork"
            }
        ]
    }

(And by declaration ensure that "instances" is an array even if it only
contains one object.)

Cheers,
Niklas

Received on Sunday, 19 May 2013 12:09:20 UTC