Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a site with a lot of data, and I'm dynamically building JSON-LD data that I think is schema.org correct. I can't find a dead-on example on schema.org, and it will take forever if I have to publish the content live, then wait for Google to say there's a problem, then re-attempt it, then wait again, etc.

This is an example of what I'd like to validate:

<script type="application/ld+json">
{
    "@context": "http://schema.org",
    "@type": "TravelAction",
    "agent": {
        "type": "Person",
        "name": "John Schmuckatelly"
    }
    "fromLocation": {
        "@type": "Country",
        "name": Curacao",
        "@type": "GeoCoordinates",
        "latitude": 12.05",
        "longitude": -68.81667"
    }
    "toLocation": {
        "@type": "Country",
        "name":Aruba
    }
}
</script>
share|improve this question
    
You can execute the json locally and then copy and paste the HTML into Google's Webmaster Tools Structured data tool. No direct json method will exist since this isn't not what is displayed in the browser, the output is.. so just setup the json to output completely and then verify it,. –  bybe Dec 30 '13 at 0:35
    
I tried the web master tool using Schema.org's own example (schema.org/TravelAction), pasting the script tag in, and it's not showing any structured data. Regarding "executing the json", the json data is just data sitting in a script tag that google/whomever should be able to read. Not much else I think I need to do with it? –  radpin Dec 30 '13 at 0:47

1 Answer 1

up vote 5 down vote accepted

Tool from Yandex

The "Structured data validator" supports JSON-LD.

Alexander Shubin (working for Yandex) wrote:

Pls, take into account that in order to check JSON-LD you need to put it in tag (since this is how it should be embedded into html). E.g.,

<script type="application/ld+json">{
  "@context":"http://schema.org",
  "@type" : "CommunicateAction",
  "instrument" : {
    "@type" : "EmailMessage"
  },
  "handler" : {
    "@type" : "WebHandler",
    "url" : "http://www.example.com/send_email"
  }
}
</script>

Tool from Google

The "Email Markup Tester" supports JSON-LD, which could also be used for JSON-LD intended for web pages.

Justin Boyan (working for Google) wrote:

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).

share|improve this answer
    
The Yandex tool seemed to work out the best for me, and after an hour of tweaking->copy->paste->retweak I finally got it looking good. Thanks so much for the help. The Google tool seems to only validate certain types (events, local businesses, etc) which in my case can't really do much. –  radpin Dec 30 '13 at 15:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.