Any example implementation JSON-LD document on a web page

Puneet Sethi picture Puneet Sethi · Jun 7, 2014 · Viewed 12.1k times · Source

I need to look at any document that has an embedded JSON-LD object in the HTML.

I have embedded a JSON-LD object on my architecture. I have context from 2 sources schema.org and my custom set of vocab with is further negotiated with the scheam.org reference which is www.mysitename/vocab.

Here I have provided a download link with .jsonld file extension. I need to see a reference from any HTML document that has embedded a JSON-LD object in it to get an idea about it.

Below is the embedded JSON-LD object in the source-code of my HTML document:

  <script type="application/ld+json">
    {
    "@context": [
        "http://schema.org/",
        "http://puneet.ys/vocab"
    ],
    "@id": "http://puneet.ys/seahawks",
    "@type": "SportsTeam",
    "name": "Seattle Seahawks",
    "url": "http://puneet.ys/seahawks",
    "image": "/2011/12/08/35/team/222398/large.jpg",
    "interactionCount": "124 UserLikes",
    "logo": "/2011/12/08/35/team/222398/large.jpg",
    "description": "The Seattle Seahawks are […]",
    "discipline": "http://puneet.ys/sport/football",
    "subOrganizationOf": "http://puneet.ys/company/nfl",
    "location": {
        "@id": "http://puneet.ys/seattle-wa",
        "@type": "Place",
        "name": "Seattle, WA",
        "url": "http://puneet.ys/seattle-wa",
        "image": "/2011/12/08/35/city/28545/large.jpg",
        "interactionCount": "25 UserLikes",
        "photo": "/2011/12/08/35/city/28545/large.jpg",
        "sameAs": [
            "http://www.freebase.com/m/0d9jr",
            "http://en.wikipedia.org/wiki/Seattle",
            "http://www.seattle.gov/"
        ]
    },
    "claimedBy": "http://puneet.ys/fan/chris-mccoy",
    "sameAs": [
        "http://www.freebase.com/m/070xg",
        "http://www.facebook.com/Seahawks",
        "http://www.twitter.com/seahawks",
        "http://en.wikipedia.org/wiki/Seattle_Seahawks",
        "http://www.seahawks.com"
    ]
}  </script>

Answer

mb21 picture mb21 · Jun 17, 2014

In this Google Webmaster Tools Answer it says:

The data, enclosed within the <script type="application/ld+json"> ... </script> tags as shown in the examples below may be placed in either the <HEAD> or <BODY> region of the page. Either way, it won’t affect how your document appears in users’ web browsers.

I wrapped your script above in <html><header> tags and it worked with the Google Email Markup-Tester, although for some reason the Google Webmaster Structured Data Testing Tool doesn't pick up JSON-LD yet.

You can also use Google's Structured Data Markup Helper, enter some dummy URL or HTML, click "Start Tagging" (blue button), add at least one tag, then "Create HTML" (red button) and finally change the "Microdata"-dropdown to "JSON-LD".