Re: Implicit and conditional statements

[forgot to send this to the list the first time- my apologies for the
duplication, Jakob)

Hmm... JSON Schema has mechanisms for this sort of conditional *structural*
change.  The "oneOf" and "dependencies" keywords in the current draft (and
soon-to-be-published Draft 06), plus the "if"/"then"/"else" keywords that
seem likely to be added in Draft 07 (which may cause us to drop
"dependencies" because it's confusing and would then be superfluous).

So a question for me is, is this a situation where a more clear integration
of JSON Schema with JSON-LD would be useful here, or is there some other
JSON-LD-related concept that is better suited for this?

thanks,
-henry

On Wed, Feb 15, 2017 at 3:24 AM, Jakob Voß <Jakob.Voss@gbv.de> wrote:

> Hi,
>
> I am trying to map an existing JSON format [1] to JSON-LD and stumbled
> upon two issues that cannot be expressed in JSON-LD. Before giving up
> on this, I'd like to know your opinion.
>
>
> First, a JSON object contains two fields "document" and "organization"
> that are connected by an RDF properties. This minimal example:
>
> {
>   "@context": { "id": "@id" },
>   "document": { "id": "a:document" },
>   "organization": { "id": "an:organization" }
> }
>
> Should result in at least one of these RDF statements:
>
> <a:document> holding:collectedBy <an:organization> .
> <an:organization> holding:collects <a:document> .
>
>
> Second, another JSON field "item" changes meaning depending on another
> field. The first example is easy to map from JSON-LD to an RDF statement:
>
> {
>   "id": "a:document",
>   "item": { "id": "an:item" }
> }
>
> <a:document> holding:examplar <an:item> .
>
>
> But if an additional subfield "part" is given, the property changes into
>
> {
>   "id": "a:document",
>   "item": { "id": "an:item", "part": "narrower" }
> }
>
> <a:document> holding:narrowerExamplar <an:item> .
>
> or into
>
> {
>   "id": "a:document",
>   "item": { "id": "an:item", "part": "broader" }
> }
>
> <a:document> holding:broaderExamplar <an:item> .
>
>
> Could these cases be handled in JSON-LD 1.1?
>
> For the first issue (which might be more common in other people's data) I
> have not found a workaround yet.
>
> A workaround for the second issue with some oss of semantic could be to
> ignore the additional field "part" and use a more fuzzy super-property of
> holding:examplar, holding:narrowerExamplar, and holding:broaderExamplar.
>
>
> Thanks!
> Jakob
>
>
> [1] If curious see http://gbv.github.io/daia/ and my current draft
> of a context document at https://github.com/gbv/daia/issues/34
>
> --
> Jakob Voß <jakob.voss@gbv.de>
> Verbundzentrale des GBV (VZG) / Common Library Network
> Platz der Goettinger Sieben 1, 37073 Göttingen, Germany
> +49 (0)551 39-10242, http://www.gbv.de/
>
>


-- 

   -

   *Henry Andrews*  |  Systems Engineer
   henry@cloudflare.com
   <https://www.cloudflare.com/>

   1 888 99 FLARE  |  www.cloudflare.com
   -

Received on Wednesday, 15 February 2017 19:07:07 UTC