W3C home > Mailing lists > Public > public-linked-json@w3.org > December 2021

Implementing the algorithm for Create Term Definition

From: Daniel Markus <Daniel.Markus@msab.com>
Date: Wed, 1 Dec 2021 15:30:21 +0000
To: "public-linked-json@w3.org" <public-linked-json@w3.org>
Message-ID: <HE1PR01MB303328B6111A456E33C54AD89E689@HE1PR01MB3033.eurprd01.prod.exchangelabs.com>
Hi everyone!

I'm new to JSON-LD and try to implement a JSON-LD parser according to the JSON-LD-API.

When I come to implement the algorithm for Create Term Definition then I get a bit confused.

In 4.2.2, point 10) it says:
"Create a new term definition, definition, initializing prefix flag to false, protected to protected,
and reverse property to false."

I jump to term definition to understand how to create that.

I see that the term definition must be an expanded term definition.

It says something about container mapping that may be of interest but I don't quite understand
that so I follow the link to the normative description.

In the normative description it says:
"An expanded term definition MUST be a map composed of zero or more keys from @id,
@reverse, @type, @language, @container, @context, @prefix, @propagate, or @protected."
And then it says something that confuses me:
"An expanded term definition SHOULD NOT contain any other keys."

Now, jumping back to 4.2.2, point 10), how shall I create the term definition? At first I thought I
should set @reverse to false but reading the expanded term definition it says:
"If an expanded term definition has an @reverse entry, [...], its value MUST be an IRI, a blank
node identifier, a compact IRI, or a term."

What makes it a little more confusing is that the Context Processing Algorithm has a slightly
different definition of what a term definition should contain, at least according to the
reverse property flag.

I looked at the Python implementation and saw that it does something that I'm not able to
match in the W3C pseudo code.

How shall I implement a term definition?
Any help is highly appreciated.

Best regards,

Daniel Markus
[cid:ad94088b-0c8d-4850-a4b8-87c6c15b198f] Software Engineer


Office: +46 8 739 02 70
E-mail: daniel.markus@msab.com<mailto:daniel.markus@msab.com> | Web: www.msab.com<http://www.msab.com/>


(image/png attachment: Outlook-m0ouimw0.png)

(image/png attachment: Outlook-fvwsookh.png)

(image/png attachment: Outlook-wzj4iztb.png)

Received on Wednesday, 1 December 2021 19:32:48 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 1 December 2021 19:32:51 UTC