- From: Justin Boyan <jaboyan@google.com>
- Date: Wed, 18 Dec 2013 16:25:36 -0500
- To: Jim Klo <jim.klo@sri.com>
- Cc: Alexander Shubin <ajax@yandex-team.ru>, "public-vocabs@w3.org" <public-vocabs@w3.org>
- Message-ID: <CABJSzUt9O1xp5BQCZAGhvShMF=++oigqfS+QWdpuQKm7mpDynA@mail.gmail.com>
While Google's Structured Data Testing Tool doesn't support JSON-LD, we do
have an Email Markup Tester <http://g.co/EmailMarkupTester> that does --
tailored, as you might guess, to the use cases supported by
Gmail<https://developers.google.com/gmail/actions/reference/formats/json-ld>.
Still, it's possible to paste in arbitrary JSON-LD (in a script tag, as
with Yandex's tool). Comments welcome!
jb
On Wed, Dec 18, 2013 at 1: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 <http://www.example.com/1/b>*
> - *@type = CreativeWork*
> - *name = Jims Record 1*
> - *url = http://www.example.com/1/b <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
> <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
> <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
> <http://corestandards.org/ELA-Literacy/CCRA/R/6>*
> - *@context*
> - *url*
> - *@type = @id*
> - *@vocab = http://schema.org/ <http://schema.org/>*
> - *@context*
> - *lrmi = http://lrmi.net/the-specification#
> <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 KloSenior Software EngineerCenter for Software EngineeringSRI
> 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
>
>
>
Received on Wednesday, 18 December 2013 21:26:05 UTC