json-ld - sti innsbruck · rdf hard to read and write (general opinion) lots of overhead for most...
TRANSCRIPT
JSON-LDBenjamin Hiltpolt
Content● Introduction● Motivation● Syntax● Examples and usage● Conclusions
JSON (briefly)easy to read and write
based on JS
● Data is in name/value pairs {"name": "value"}
● Data is separated by commas {"name1":"value1","name2": "value2"}
● Curly braces hold objects {"object1":"values","object2": [1,2,3]}
● Square brackets hold arrays [{ "data": "value"},2,"a string"]
RDFhard to read and write (general opinion)
lots of overhead for most webapplications
way more powerful (e.g. global identifiers, link to external sources, ontologies)
triple based, graph based:
@prefix benni: <http://www.w3.org/People/EM/contact#> .@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .@prefix contact: <http://www.w3.org/2000/10/swap/pim/contact#> .
benni:me contact:fullName "Benjamin Hiltpolt" .benni:me contact:mailbox <mailto:benjamin.hiltpolt(at)gmail.com> .
MotivationRDF is complicated and hard to use
JSON is widely used (basically everywhere)
JSON lacks some functionalities to allow features like:
● schemas that are globally valid● linking between different data sources
RDF got those features...
Motivationhttp://www.w3.org/TR/json-ld/
JSON-LD unifies RDF and JSON
It aims at hiding the “complicated” RDF stuff
JSON-LD is valid JSON
JSON-LD can be serialized as RDF
@context{ "@context": { "name": "http://schema.org/name", "image": { "@id": "http://schema.org/image", "@type": "@id" }, "homepage": { "@id": "http://schema.org/url", "@type": "@id" }}}
“person.jsonld”
@context{ "@context": "http://json-ld.org/contexts/person.jsonld", "name": "Benjamin Hiltpolt", "homepage": "http://bhiltpolt.com, "image": "http://bhiltpolt.com/image"}
(also inline definition of @context allowed)
@language{ "@context": { ... "occupation": { "@id": "ex:occupation", "@container": "@language" } }, "name": "Dieter Fensel", "occupation": { "de": "Professor", "en": "professor", "ja": "教授" }}
Syntax (referencing)[ { "@id": "#homer", "http://example.com/vocab#name": "Homer" }, { "@id": "#bart", "http://example.com/vocab#name": "Bart", "http://example.com/vocab#parent": { "@id": "#homer" } }, { "@id": "#lisa", "http://example.com/vocab#name": "Lisa", "http://example.com/vocab#parent": { "@id": "#homer" } }]
@list{ "@id": "http://example.org/people#joebob", "nick": [ "joe", "bob", "JB" ],}
"@context": { "nick": { "@id": "http://xmlns.com/foaf/0.1/nick", "@container": "@list" } }, "@id": "http://example.org/people#joebob", "nick": [ "joe", "bob", "jaybee" ],}
Representations{ "@context": "http://schema.org/", "@type": "Person", "name": "Dieter Fensel", "jobTitle": "Professor", "url": "http://www.fensel.com/"}
compacted Form
Representations[ { "@type": [ "http://schema.org/Person" ], "http://schema.org/jobTitle": [ { "@value": "Professor" } ], "http://schema.org/name": [ { "@value": "Dieter Fensel" } ], "http://schema.org/url": [ { "@id": "http://www.fensel.com/" } ] }]
extended From
Representations_:b0 <http://schema.org/jobTitle> "Professor" ._:b0 <http://schema.org/name> "Dieter Fensel" ._:b0 <http://schema.org/url> <http://www.fensel.com/> ._:b0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> .
RDF
Examples{ "@context": "http://schema.org", "@type": "WebSite", "url": "http://blog.innsbruck.info/", "name": "blog.innsbruck DE", "potentialAction": { "@type": "SearchAction", "target": "http://blog.innsbruck.info/?s={search_term}", "query-input": "required name=search_term" }}
stats
August 2015
62500
112500
Conclusion● Better then RDF?● A step forward for the Semantic Web?● Performance / tool support
Showcasehttp://gmail-actions.appspot.com/
References● articles:
○ http://manu.sporny.org/2014/json-ld-origins-2/○ http://www.seoskeptic.com/json-ld-google-knowledge-graph-schema-org-seo/○ http://www.seoskeptic.com/what-is-json-ld/○ http://milicicvuk.com/blog/2014/08/26/can-json-and-rdf-be-friends/○ http://www.seoskeptic.com/json-ld-big-day-at-google/
● specification:○ http://www.w3.org/TR/json-ld/#the-context
● programming:○ https://www.npmjs.com/package/jsonld○ https://github.com/ruby-rdf/json-ld/
References● examples:
○ http://www.parsely.com/resources/telegraph/○ https://developers.google.com/gmail/markup/getting-started
● showcase:○ http://gmail-actions.appspot.com/○ http://blog.innsbruck.info/○ http://json-ld.org/playground/
● statistics:○ http://trends.builtwith.com/docinfo/JSON-LD