Introduce JSON-LD

(JSON for Linking Data)

Describe a person's structure

machine understand

{
    "Name": "Wei-Chieh, Hsia", 
    "BornDate": "1993-12-13",
    "Homepage": "http://twxia.com"
}

In Normal JSON

{
    "Name": "Wei-Chieh, Hsia", 
    "BornDate": "1993-12-13",
    "Homepage": "http://twxia.com"
}

Ambiguity

{
    "Name": "User001", 
    "BornDate": "1996-12-13",
    "Homepage": "http://twxia.com"
}

Are they same?

Site A:

Site B:

Being Specific

{
    "http://www.a.com/name": "Wei-Chieh, Hsia", 
    "http://www.a.com/birth": "1996-12-13",
    "http://www.b.com/homepage": "http://twxia.com"
}

JSON-LD comes

{
  "@context": "http://www.a.com/person.jsonld",
  "name": "Wei-Chieh, Hsia",
  "born": "1996-12-13",
  "homepage": "http://twxia.com"
}

Semantic Web Layers

schema.org

IRI(Internationalized Resource Identifier)

RDFa

microdata, open graph

JSON-LD exapmle

{
  "@context": "http://schema.org/",
  "@type": "Person",
  "name": "Jane Doe",
  "jobTitle": "Professor",
  "telephone": "(425) 123-4567",
  "url": "http://www.janedoe.com"
}

Person

{
  "@context": {
    "name": "http://schema.org/name",
    "description": "http://schema.org/description",
    "image": {
      "@id": "http://schema.org/image",
      "@type": "@id"
    },
    "geo": "http://schema.org/geo",
    "latitude": {
      "@id": "http://schema.org/latitude",
      "@type": "xsd:float"
    },
    "longitude": {
      "@id": "http://schema.org/longitude",
      "@type": "xsd:float"
    },
    "xsd": "http://www.w3.org/2001/XMLSchema#"
  },
  "name": "The Empire State Building",
  "description": "The Empire State Building is a 102-story landmark in New York City.",
  "image": "http://www.civil.usherbrooke.ca/cours/gci215a/empire-state-building.jpg",
  "geo": {
    "latitude": "40.75",
    "longitude": "73.98"
  }
}

Place

Use Cases

Advanced:

Google Tag Manager 

dynamically generating JSON-LD snippet

Tools

  • JSON-LD.org Playground             (https://json-ld.org/playground/)
  • Google Structure Data Testing Tool (https://search.google.com/structured-data/testing-tool)

Resources

  • JSON-LD Specification          (https://json-ld.org/spec/latest/json-ld)

Q & A

Thanks

Introduce JSON-LD

By Xia Wei-Jie

Introduce JSON-LD

  • 340