JSON-LD.

Slides:



Advertisements
Similar presentations
Anatomy of a Web Page. Parts of a Web Page Title Bar Navigation Tool Bar Location Bar Header Graphic/Image Text Horizontal Rule Links.
Advertisements

Copyright © Steven W. Johnson
What are Web Services? How to use them?
Introduction to HTML & CSS
Steffen Staab 1WeST Web Science & Technologies University of Koblenz ▪ Landau, Germany Structured Data on the Web Introduction to.
XML: text format Dr Andy Evans. Text-based data formats As data space has become cheaper, people have moved away from binary data formats. Text easier.
Hyper Text Markup Language.  HTML is a language for describing web pages.  HTML stands for Hyper Text Markup Language  HTML is not a programming language,
Website Design.
RDFa Lite. RDFa 1.1 Lite is a subset of RDFa 1.1 Five simple attributes: vocab, typeof, property, resource, and prefix Completely upwards compatible RDFa.
Sematic Web Microdata, Microformat and RDF Advanced Web-based Systems | Misbhauddin.
MIS 425 Lecture 1 – HTML Basics and Web Page Design Instructor: Martin Neuhard
JSON Valery Ivanov.
The Web of data with meaning... By Michael Griffiths.
CSCI 572 Project Presentation Mohsen Taheriyan Semantic Search on FOAF profiles.
Made by: Dan Ye. Introduction Basic Last Page ☆ HTML stands for Hyper Text Markup Language; ☆ HTML is not a programming language, it is a markup language;
CM143 - Web Week 2 Basic HTML. Links and Image Tags.
Hypertext Markup Language (HTML) Created by Sarah Dooley & Amanda Foster Edited and presented by Caroline Hallam September 9, 2014.
More APIs: Web Services CMPT 281. Announcements Project milestone Lab: – Web services examples.
Semantic Web Andrejs Lesovskis. Publishing on the Web Making information available without knowing the eventual use; reuse, collaboration; reproduction.
Chris Pinski.  History  What is Ajax  Who uses Ajax  Underlying Technologies  SE Aspect  Common Problems  Conclusion.
NetTech Solutions Working with Web Elements Lesson 6.
The New Zealand Institute for Plant & Food Research Limited Matthew Laurenson Web Services: Introduction & Design Considerations.
Learning Web Design: Chapter 4. HTML  Hypertext Markup Language (HTML)  Uses tags to tell the browser the start and end of a certain kind of formatting.
Lecture 13 – XML and JSON SFDV3011 – Advanced Web Development Reference: 1.
HTML and XML Behind Web Authoring Tools. 2 Objectives Introduce HTML Learn HTML Step by step Introduce XML.
HTML5. HTML5’s overall theme The browser as a rich application platform rich, cross-device user interfaces offline operation capability hardware access.
1 HTML John Sum Institute of Technology Management National Chung Hsing University.
JSON-LD. JSON as an XML Alternative JSON is a light-weight alternative to XML for data- interchange JSON = JavaScript Object Notation – It’s really language.
ICOM 4035 – Data Structures Lecture 11 – Map ADT Manuel Rodriguez Martinez Electrical and Computer Engineering University of Puerto Rico, Mayagüez ©Manuel.
Google Data Protocol Guy Mark Lifshitz. Motivation Google’s Mission: – Organize the world’s information – Make information universally accessible – Provide.
Introduction to the Semantic Web and Linked Data Module 1 - Unit 2 The Semantic Web and Linked Data Concepts 1-1 Library of Congress BIBFRAME Pilot Training.
Introduction to Web Services
RDFa Lite. RDFa 1.1 Lite is a subset of RDFa 1.1 Five simple attributes: vocab, typeof, property, resource, and prefix Completely upwards compatible RDFa.
Representing data with XML SE-2030 Dr. Mark L. Hornick 1.
XML Technology. Emerging Importance of XML –HTML-tagging is display oriented. –XML-based content tagging has important uses: data mining role-oriented.
AJAX. Ajax  $.get  $.post  $.getJSON  $.ajax  json and xml  Looping over data results, success and error callbacks.
The Semantic Web. What is the Semantic Web? The Semantic Web is an extension of the current Web in which information is given well-defined meaning, enabling.
Semantic Web 06 T 0006 YOSHIYUKI Osawa. Problem of current web  limits of search engines Most web pages are only groups of character strings. Most web.
JSON. JSON as an XML Alternative JSON is a light-weight alternative to XML for data- interchange JSON = JavaScript Object Notation It’s really language.
HTML5 and CSS3 Illustrated Unit C: Getting Started with CSS.
Semantic Web in Depth Schema.org RDFa, JSON-LD, Microdata Professor Steffen Staab 2016, Many slides courtesy by Dr. Nick Gibbins.
Facilitating Semantic Web Search with Embedded Grammar Tags (EGTs) Gautham K.Dorai Yaser Yacoob Department of Computer Science University of Maryland –
What's New in RDF 1.1 Cambridge Semantic Web Gathering 9 April 2013
HTML Structure & syntax
The Fat-Free Alternative to XML
JSON and JSON-Schema for XML Developers
Getting Started with CSS
Stanford University, Stanford, CA, USA
The Fat-Free Alternative to XML
JSON.
Microdata and schema.org
A Lightweight Structured Data Implementation Using JSON-LD and Schema
Database Systems Week 12 by Zohaib Jan.
Consuming Java Script Object Notation (JSON) feeds
Embedding Knowledge in HTML
Zachary Cleaver Semantic Web.
XML.
JSON-LD 1.0 Yanan Zhang.
Strings and Serialization
Integrating REST API and SQL Server JSON Functions
Microdata and schema.org
Embedding Knowledge in HTML
CS 240 – Advanced Programming Concepts
RDFa: Embedding RDF Knowledge in HTML
JSON for Linked Data: a standard for serializing RDF using JSON
CSE591: Data Mining by H. Liu
The Fat-Free Alternative to XML
Gregg Kellogg – Spec Ops
JSON: JavaScript Object Notation
JSON-LD.
Presentation transcript:

JSON-LD

JSON as an XML Alternative Light-weight XML alternative for data-interchange JSON = JavaScript Object Notation It’s really language independent Most programming languages can easily read it and instantiate objects Defined in RFC 4627 Started gaining traction ~2006, now widely used http://json.org/ has more information

Example This is a JSON object with five key-value pairs {"firstName": "John", "lastName" : "Smith", "age" : 25, "address" : {"streetAdr” : "21 2nd Street", "city" : "New York", "state" : "NY", ”zip" : "10021"}, "phoneNumber": [{"type" : "home", "number": "212 555-1234"}, {"type" : "fax", "number” : "646 555-4567"}] } This is a JSON object with five key-value pairs Objects are wrapped by curly braces There are no object IDs Keys are strings Values are numbers, strings, objects or arrays Arrays are wrapped by square brackets

The BNF is simple

Evaluation JSON is simpler than XML and more compact No closing tags, but if you compress XML and JSON the difference is not so great XML parsing is hard because of its complexity JSON has a better fit for OO systems than XML, but not as extensible Preferred for simple data exchange by many MongoDB: ‘NoSQL’ database for JSON objects ElasticSearch: Lucene-based IR system using JSON to represent documents

JSON-LD JSON-LD: 2014 W3C recommendation for representing RDF data as JSON objects {"@context": { "name": "http://xmlns.com/foaf/0.1/name", "homepage": { "@id": "http://xmlns.com/foaf/0.1/workplaceHomepage", "@type": "@id" }, "Person": "http://xmlns.com/foaf/0.1/Person" "@id": "http://me.markus-lanthaler.com", "@type": "Person", "name": "Markus Lanthaler", "homepage": "http://www.tugraz.at/" }

In the beginning { "name": "Manu Sporny", "homepage": "http://manu.sporny.org/", "image": "http://manu.sporny.org/images/manu.png" }

A bit better { "http://schema.org/name": "Manu Sporny", "http://schema.org/url": { "@id": "http://manu.sporny.org/" } "http://schema.org/image": { "@id": "http://manu.sporny.org/images/manu.png" } } The '@id' keyword means 'This value is an identifier that is an IRI'

Define a context { "@context": { "name": "http://schema.org/name", % [1] "image": { "@id": "http://schema.org/image", % [2] "@type": "@id" % [3] }, "homepage": { "@id": "http://schema.org/url", % [4] "@type": "@id" % [5] } } } [1] This means that 'name' is shorthand for 'http://schema.org/name' [2] This means that 'image' is shorthand for 'http://schema.org/image' [3] This means that a string value associated with 'image' should be interpreted as an identifier that is an IRI [4] This means that 'homepage' is shorthand for 'http://schema.org/url' [5] This means that a string value associated with 'homepage' should be interpreted as an identifier that is an IRI

Reference an external context { "@context": "http://json-ld.org/contexts/person.jsonld", "name": "Manu Sporny", "homepage": "http://manu.sporny.org/", "image": "http://manu.sporny.org/images/manu.png" }

Add context inline {"@context": { "name": "http://schema.org/name", "image": { "@id": "http://schema.org/image", "@type": "@id" }, "homepage": { "@id": "http://schema.org/url", } "name": "Manu Sporny", "homepage": "http://manu.sporny.org/", "image": "http://manu.sporny.org/images/manu.png"

External Context? Fetch http://json-ld.org/contexts/person.jsonld curl http://json-ld.org/contexts/person.jsonld Returns a JSON object defining the context Fetch http://schema.org/ curl –L http://schema.org/L Returns HTML page, since its default application/type is HTML Fetch curl --header "Accept: application/ld+json" -L http://schema.org/ -L says to follow redirects

Making assertions about things { "@context": { ... "Restaurant": "http://schema.org/Restaurant", "Brewery": "http://schema.org/Brewery" } "@id": "http://example.org/places#BrewEats", "@type": [ "Restaurant", "Brewery" ],

Adding a default vocabulary { "@context": { "@vocab": "http://schema.org/" } "@id": "http://example.org/places#BrewEats", "@type": "Restaurant", "name": "Brew Eats" ...

Mixing vocabularies { "@context": "xsd": "http://www.w3.org/2001/XMLSchema#", "foaf": "http://xmlns.com/foaf/0.1/", "foaf:homepage": { "@type": "@id" }, "picture": { "@id": "foaf:depiction", "@type": "@id" } }, "@id": "http://me.markus-lanthaler.com/", "@type": "foaf:Person", "foaf:name": "Markus Lanthaler", "foaf:homepage": "http://www.markus-lanthaler.com/", "picture": "http://twitter.com/account/profile_image/markuslanthaler" }

Embedding other objects { ... "name": "Manu Sporny", "foaf:knows": "@type": "Person", "name": "Gregg Kellogg", }

Google looks for JSON-LD Google looks for and uses some JSON-LD markup (e.g., for organizations) Put a JSON-LD object in head or body of web page wrapped with script tags: <script type="application/ld+json"> {...} </script>

https://search.google.com/structured-data/testing-tool

http://json-ld.org/

JSON-LD Playground

Conclusion JSON-LD is a good solution to putting blocks of semantic data on web pages Aimed at publish linked data, not ontologies, i.e., ABOX not TBOX Tools available for extracting RDF triples Search companies look for and JSON-LD that use vocabularies they understand (i.e., schema.org)