- From: Alexander Shubin <ajax@yandex-team.ru>
- Date: Mon, 23 Dec 2013 09:38:05 +0000
- To: Jim Klo <jim.klo@sri.com>, Markus Lanthaler <markus.lanthaler@gmx.net>
- CC: "public-vocabs@w3.org" <public-vocabs@w3.org>
- Message-ID: <11D71A5E-21CD-4646-BC9F-458E96C38FDE@yandex-team.ru>
Hi Markus, Jim, Thanks a lot for your thorough feedback! I really appreciate your help! As far as I may conclude from the thread the biggest confusion comes from @context non-resolution (which I wrote about in the first message). Of course we do parse and analyze it. But since it's not clear from validator's output we obviously should improve it. Thanks for the examples - we'll use them for reference while testing. Is it correct that the most intuitive way would be expanding property names and values with the @context, dropping @context itself along with properties not mapped to an IRI? Thanks again for checking our tool! Our primary goal is to help webmasters with using JSON-LD and prevent possible errors. So the more intuitive and correct output in validator, the better code on web pages. >> Is this any clearer? I'm more than happy to help where I can (e.g. by >> reviewing new versions of your validator). Just ping me. Absolutely! Thanks! P.S. BTW you can drop <script> now - it was too annoying :) ---- Best, Alex On Dec 18, 2013, at 10:00 PM, Jim Klo <jim.klo@sri.com> wrote: > Hi Alex, > > Glad to see a tool being created. > > +1 on the confusion on the output of the tool… > > I entered: > > <script type="application/ld+json"> > {"name":"Jims Record 1","url":"http://www.example.com/1/b","educationalAlignment":[{"alignmentType":"teaches","educationalFramework":"Common Core State Standards for English Language Arts","targetName":"CCSS.ELA-Literacy.CCRA.R.4","@type":"AlignmentObject","targetUrl":"http://corestandards.org/ELA-Literacy/CCRA/R/4"},{"alignmentType":"teaches","educationalFramework":"Common Core State Standards for English Language Arts","targetName":"CCSS.ELA-Literacy.CCRA.R.5","@type":"AlignmentObject","targetUrl":"http://corestandards.org/ELA-Literacy/CCRA/R/5"},{"alignmentType":"teaches","educationalFramework":"Common Core State Standards for English Language Arts","targetName":"CCSS.ELA-Literacy.CCRA.R.6","@type":"AlignmentObject","targetUrl":"http://corestandards.org/ELA-Literacy/CCRA/R/6"}],"@context":[{"url":{"@type":"@id"},"@vocab":"http://schema.org/"},{"lrmi":"http://lrmi.net/the-specification#","useRightsUrl":{"@id":"lrmi:useRightsUrl","@type":"@id"}}],"@id":"http://www.example.com/1/b","@type":"CreativeWork"} > </script> > > and got: > > jsonld > @id = http://www.example.com/1/b > @type = CreativeWork > name = Jims Record 1 > url = http://www.example.com/1/b > educationalAlignment > @type = AlignmentObject > alignmentType = teaches > educationalFramework = Common Core State Standards for English Language Arts > targetName = CCSS.ELA-Literacy.CCRA.R.4 > targetUrl = http://corestandards.org/ELA-Literacy/CCRA/R/4 > educationalAlignment > @type = AlignmentObject > alignmentType = teaches > educationalFramework = Common Core State Standards for English Language Arts > targetName = CCSS.ELA-Literacy.CCRA.R.5 > targetUrl = http://corestandards.org/ELA-Literacy/CCRA/R/5 > educationalAlignment > @type = AlignmentObject > alignmentType = teaches > educationalFramework = Common Core State Standards for English Language Arts > targetName = CCSS.ELA-Literacy.CCRA.R.6 > targetUrl = http://corestandards.org/ELA-Literacy/CCRA/R/6 > @context > url > @type = @id > @vocab = http://schema.org/ > @context > lrmi = http://lrmi.net/the-specification# > useRightsUrl > @id = lrmi:useRightsUrl > @type = @id > > One thing I would have hoped to see is (an ability) to see the properties (and values) get fully resolved from the context. It's unclear if this is occurring. > > The obvious things I see is that it's flattening arrays and keeping Classes still organized. The not so obvious thing is it does seem to be parsing @context as I noticed it added an @id property and value in the output based upon the url being tagged as an @id. > > The biggest problem I see is that it's not clear if it's interpreting the vocabulary from the context (if this is actually happening). > > What might make sense, using my example, is to expand property names and type values with the context: > url -> http://schema.org/url > alignmentType -> http://schema.org/alignmentType > AlignmentObject -> http://schema.org/AlignmentObject > useRightsUrl -> http://lrmi.net/the-specification#useRightsUrl > > Once the context is 'expanded', drop it from the output as it would no longer be needed. > > > Cheers, > > - Jim > > Jim Klo > Senior Software Engineer > Center for Software Engineering > SRI International > t. @nsomnac > > On Dec 18, 2013, at 4:05 AM, Markus Lanthaler <markus.lanthaler@gmx.net> > wrote: > >> Hi Alex, >> >> Sorry for the delay. >> >> On Wednesday, December 04, 2013 12:35 PM, Alexander Shubin wrote: >>>> What exactly do you mean by this? >>> >>> I mean that we don't expand terms to full IRIs or JSON objects >>> (http://www.w3.org/TR/json-ld/#dfn-expanded-term-definition) using >>> information in @context as it is done by json-ld/playground >>> (http://json-ld.org/playground/index.html), tab "Expanded". >> >> OK. To illustrate the problem. Let's assume I enter: >> >> <script type="application/ld+json"> >> { >> "@context": { >> "Something": "http://schema.org/Country" >> }, >> "@type": "Something", >> "name": "Russia" >> } >> </script> >> >> What I get out as result is >> >> jsonld >> @type = Something >> @context >> Something = http://schema.org/Country >> name = Russia >> >> I don't find this particularly helpful because it doesn't tell me at all how >> Yandex is going to interpret this markup. Is it understanding that the >> entity is of type "Country"? It just presents me the same JSON(-LD) data but >> with all curly brackets and commas removed and labels it as "jsonld". >> >> >>>> I played a bit with the validator but wasn't able to trigger a >> validation >>>> error unless I created invalid *JSON* (a missing comma for example). >>> >>> Can you elaborate more about what did you try and what output did you >>> expect? Concrete examples would help significantly! >> >> Sure. Let's modify the example above to: >> >> <script type="application/ld+json"> >> { >> "@context": { >> "@context": "http://schema.org/Country" >> }, >> "@type": "Something", >> "name": "Russia" >> } >> </script> >> >> The validator should raise an error as this isn't valid JSON-LD. You can't >> nest @context inside @context. Yet it says that everything is fine and that >> the result is >> >> jsonld >> @type = Something >> @context >> @context = http://schema.org/Country >> name = Russia >> >> >>>> It would be great if you could tweak the output a bit so that it >>>> becomes clear what kind of data you were able to extract. >> >> Well. You could for example tweak the output of the first example so that it >> shows the following data instead: >> >> jsonld >> type = http://schema.org/Country >> >> Please note that name isn't included as it wasn't mapped to an IRI and thus >> you don't know what it means. >> >> >> Is this any clearer? I'm more than happy to help where I can (e.g. by >> reviewing new versions of your validator). Just ping me. >> >> >> Cheers, >> Markus >> >> >> -- >> Markus Lanthaler >> @markuslanthaler >
Attachments
- application/pkcs7-signature attachment: smime.p7s
Received on Monday, 23 December 2013 09:40:34 UTC