W3C home > Mailing lists > Public > public-linked-json@w3.org > May 2013

Restrictions on reverse term definitions

From: Niklas Lindström <lindstream@gmail.com>
Date: Sun, 19 May 2013 14:08:19 +0200
Message-ID: <CADjV5jfhuGTD46XRuugSK_jD09jvSp++i8BAfV2QNauTahghMQ@mail.gmail.com>
To: "public-linked-json@w3.org" <public-linked-json@w3.org>
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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:53:22 UTC