- From: Roberto Polli <robipolli@gmail.com>
- Date: Wed, 5 Oct 2022 00:02:31 +0200
- To: Gregg Kellogg <gregg@greggkellogg.net>
- Cc: public-json-ld-wg@w3.org
- Message-ID: <CAP9qbHU_-f5U3vBnD_AQYyuYQCux02uGySrdnvX86yKumgk_3g@mail.gmail.com>
Thanks, this should do the job, then https://tinyurl.com/pb7stvzt That's worth an FAQ ;) I'll let you know how it goes. Thanks again! R. On Tue, 4 Oct 2022 at 23:45, Gregg Kellogg <gregg@greggkellogg.net> wrote: > Check out section 2.1.4 Matching on Values [1]. > > You can use a wild-card in a value object and fix @language, like so [1]: > > { > "@explicit": true, > "@context": { > "label_it": { > "@id": "skos:prefLabel", > "@language": "it" > }, > "label_fr": { > "@id": "skos:prefLabel", > "@language": "fr" > } > }, > "skos:prefLabel": { > "@value": {}, > "@language": "it" > } > } > > Gregg Kellogg > gregg@greggkellogg.net > > [1] https://www.w3.org/TR/json-ld11-framing/#matching-on-values > [2] https://tinyurl.com/yfr3bvxe > > > On Oct 4, 2022, at 2:05 PM, Roberto Polli <robipolli@gmail.com> wrote: > > Hi Gregg, > > thanks for your reply! I didn't know the playground was able to > communicate the frame: cool. > The proposed solution shows even further entries that I don't want to > show, eg. the @lang: en one. > > https://tinyurl.com/yjk3dr76 > > If this is the correct behavior, IIUC the selection algorithm works at the > predicate level > instead of at the triple level (eg. all of the skos:prefLabel is selected, > and not only the triples matching each possible language)... > > Can you point me to the framing specification algorithm that selects the > nodes to show? > > Thanks++, > R. > > > On Tue, 4 Oct 2022 at 22:30, Gregg Kellogg <gregg@greggkellogg.net> wrote: > >> You’re running afoul some frame selection logic, which ends up selecting >> just selects one of the values. What happens is that the frame gets >> expanded, and you show two values for the single property “skos:prefLabel”. >> You probably want to either have an empty frame, or wild-card >> “skos:prefLabel”. >> >> These things are best communicated using links to the playground, such as >> https://tinyurl.com/yfr3bvxe, which uses the following frame: >> >> { >> "@context": { >> "label_it": {"@id": "skos:prefLabel","@language": "it" }, >> "label_fr": {"@id": "skos:prefLabel","@language": "fr" } >> }, >> "skos:prefLabel": {} >> } >> >> Gregg Kellogg >> gregg@greggkellogg.net >> >> On Oct 4, 2022, at 10:10 AM, Roberto Polli <robipolli@gmail.com> wrote: >> >> Dear folks, >> >> I am struggling with framing. The result is the same with both pyld and >> the playground. >> >> Given a multi-language JSON-LD I want to pick two skos:prefLabels, like >> that >> >> { >> "label_it": {"@language": "it", "@value": {}}, >> "label_fr": {"@language": "fr", "@value": {}}, >> "@context": { >> "label_it": {"@id": "skos:prefLabel","@language": "it" }, >> "label_fr": {"@id": "skos:prefLabel","@language": "fr" }, >> } >> } >> >> Full gist here >> - https://gist.github.com/ioggstream/e9c4748208728c5abca34a7c6e309284 >> >> but the framing mechanism only shows the last field (e.g. label_fr), eg. >> >> { label_fr: France } # No Italy here! >> >> Instead, if I don't filter, like below, the framing mechanism dumps all >> unmentioned languages in >> "skos:prefLabel" field, even if "skos:prefLabel" is not mentioned between >> the "@explicit" fields. >> >> { >> "label_it": {}, >> "label_fr": {}, >> "@context": { >> "label_it": {"@id": "skos:prefLabel","@language": "it" }, >> "label_fr": {"@id": "skos:prefLabel","@language": "fr" }, >> } >> } >> Is there a standard way to tell "framing" to strip off specific/unwanted >> fields like "skos:prefLabel"? >> >> Thanks ++, >> R. >> >> >> >> >
Received on Tuesday, 4 October 2022 22:02:55 UTC