- From: Niklas Lindström <lindstream@gmail.com>
- Date: Tue, 18 Feb 2020 16:23:03 +0100
- To: public-json-ld@w3.org
- Message-ID: <CADjV5jeQ3aOJHE-EA5zYoV1g0pE_0=g=zpYbRpPHnu1-BJ3pmg@mail.gmail.com>
Dear all, Is it by design, or by some limitation in the algorithm (which may still be rephrased?), that nested properties cannot have property-scoped contexts in JSON-LD 1.1? It seems that neither the JSON-LD 1.1 Playground nor Gregg's distiller supports this (i.e. the property-scoped contexts in the nest properties have no effect on the expansion): - - - 8< - - - { "@context": { "@vocab": "http://purl.org/dc/terms/", "bibo": "http://purl.org/ontology/bibo/", "@version": 1.1, "Print": "bibo:Book", "name": "http://www.w3.org/2000/01/rdf-schema#label", "instanceOf": "@nest", "contributionByRole": { "@id": "@nest", "@context": { "agent": "@nest", "aut": "creator" } }, "provisionActivityByType": { "@id": "@nest", "@context": { "Publication": { "@id": "@nest", "@context": {"date": "published", "agent": "publisher"} } } }, "identifiedByType": { "@id": "@nest", "@context": { "Isbn": {"@id": "@nest"}, "value": "bibo:isbn" } } } , "@id": "book/one", "@type": "Print", "instanceOf": { "contributionByRole": { "aut": { "agent": {"name": "Some Body"} } } }, "identifiedByType": { "Isbn": { "value": "1234567890" } }, "provisionActivityByType": { "Publication": { "date": "1999", "agent": {"name": "PubCorp"} } } } - - - >8 - - - I am attempting a "neat trick" here, by compacting BibFrame data into maps (see [2]), and then *swapping out* the context with another one mapping to DC+BIBO, as per the context snippet above, using nests with local contexts to treat the same JSON semantically differently. I'm pursuing multiple venues here, I just hoped that this "poor man's inference trick" might prove fruitful. Also, in general, it might be beneficial to consider (in the WG) whether this limitation on nests is by design or simply an oversight. I know of the feature freeze, it's just not obvious to me whether the Syntax prohibits this or if the algorithm in the API spec misses an opportunity. Best regards, Niklas PS. After a prolonged hiatus, I'm happy to have *finally* spent some quality time with the JSON-LD 1.1 spec, mainly by working on an expansion implementation for rdflib_jsonld [3] (currently passing about 80% of the toRdf specs). [1]: https://json-ld.org/playground/#startTab=tab-compacted&json-ld=%7B%22%40context%22%3A%7B%22%40vocab%22%3A%22http%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%22%2C%22bibo%22%3A%22http%3A%2F%2Fpurl.org%2Fontology%2Fbibo%2F%22%2C%22%40version%22%3A1.1%2C%22Print%22%3A%22bibo%3ABook%22%2C%22name%22%3A%22http%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23label%22%2C%22instanceOf%22%3A%22%40nest%22%2C%22contributionByRole%22%3A%7B%22%40id%22%3A%22%40nest%22%2C%22%40context%22%3A%7B%22agent%22%3A%22%40nest%22%2C%22aut%22%3A%22creator%22%7D%7D%2C%22provisionActivityByType%22%3A%7B%22%40id%22%3A%22%40nest%22%2C%22%40context%22%3A%7B%22Publication%22%3A%7B%22%40id%22%3A%22%40nest%22%2C%22%40context%22%3A%7B%22date%22%3A%22published%22%2C%22agent%22%3A%22publisher%22%7D%7D%7D%7D%2C%22identifiedByType%22%3A%7B%22%40id%22%3A%22%40nest%22%2C%22%40context%22%3A%7B%22Isbn%22%3A%7B%22%40id%22%3A%22%40nest%22%7D%2C%22value%22%3A%22bibo%3Aisbn%22%7D%7D%7D%2C%22%40id%22%3A%22book%2Fone%22%2C%22%40type%22%3A%22Print%22%2C%22instanceOf%22%3A%7B%22contributionByRole%22%3A%7B%22aut%22%3A%7B%22agent%22%3A%7B%22name%22%3A%22Some%20Body%22%7D%7D%7D%7D%2C%22identifiedByType%22%3A%7B%22Isbn%22%3A%7B%22value%22%3A%221234567890%22%7D%7D%2C%22provisionActivityByType%22%3A%7B%22Publication%22%3A%7B%22date%22%3A%221999%22%2C%22agent%22%3A%7B%22name%22%3A%22PubCorp%22%7D%7D%7D%7D&context=%7B%22%40context%22%3A%7B%22%40vocab%22%3A%22http%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%22%2C%22bibo%22%3A%22http%3A%2F%2Fpurl.org%2Fontology%2Fbibo%2F%22%2C%22name%22%3A%22http%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23label%22%7D%7D [2]: https://json-ld.org/playground/#startTab=tab-compacted&json-ld=%7B%22%40context%22%3A%7B%22%40vocab%22%3A%22http%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%22%2C%22bibo%22%3A%22http%3A%2F%2Fpurl.org%2Fontology%2Fbibo%2F%22%2C%22%40version%22%3A1.1%2C%22Print%22%3A%22bibo%3ABook%22%2C%22name%22%3A%22http%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23label%22%2C%22instanceOf%22%3A%22%40nest%22%2C%22contributionByRole%22%3A%7B%22%40id%22%3A%22%40nest%22%2C%22%40context%22%3A%7B%22agent%22%3A%22%40nest%22%2C%22aut%22%3A%22creator%22%7D%7D%2C%22provisionActivityByType%22%3A%7B%22%40id%22%3A%22%40nest%22%2C%22%40context%22%3A%7B%22Publication%22%3A%7B%22%40id%22%3A%22%40nest%22%2C%22%40context%22%3A%7B%22date%22%3A%22published%22%2C%22agent%22%3A%22publisher%22%7D%7D%7D%7D%2C%22identifiedByType%22%3A%7B%22%40id%22%3A%22%40nest%22%2C%22%40context%22%3A%7B%22Isbn%22%3A%7B%22%40id%22%3A%22%40nest%22%7D%2C%22value%22%3A%22bibo%3Aisbn%22%7D%7D%7D%2C%22%40id%22%3A%22book%2Fone%22%2C%22%40type%22%3A%22Print%22%2C%22instanceOf%22%3A%7B%22contributionByRole%22%3A%7B%22aut%22%3A%7B%22agent%22%3A%7B%22name%22%3A%22Some%20Body%22%7D%7D%7D%7D%2C%22identifiedByType%22%3A%7B%22Isbn%22%3A%7B%22value%22%3A%221234567890%22%7D%7D%2C%22provisionActivityByType%22%3A%7B%22Publication%22%3A%7B%22date%22%3A%221999%22%2C%22agent%22%3A%7B%22name%22%3A%22PubCorp%22%7D%7D%7D%7D&context=%7B%22%40context%22%3A%7B%22%40vocab%22%3A%22http%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%22%2C%22bibo%22%3A%22http%3A%2F%2Fpurl.org%2Fontology%2Fbibo%2F%22%2C%22name%22%3A%22http%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23label%22%7D%7D [3]: https://github.com/RDFLib/rdflib-jsonld/pull/74
Received on Tuesday, 18 February 2020 15:23:44 UTC