SlideShare a Scribd company logo
1 of 71
Download to read offline
1/71
JSON-LD
BridgingthePresentandFutureWebs
Brian Sletten (!@bsletten)
08/17/2015
Speaker Qualifications
Specialize in next-generation technologies
Author of O'Reilly Videos on Hypermedia and Linking Data
Author of 'Resource-Oriented Architecture Patterns for Webs of Data'
Teaches and speaks internationally about REST, Semantic Web, Data Science,
Security, Visualization, Architecture
Worked in Defense, Finance, Retail, Hospitality, Video Game, Health Care,
Telecommunications and Publishing Industries
International Pop Recording Artist
·
·
·
·
·
·
3/71
Agenda
Introduction
Basic JSON-LD
Expansion, Compaction, Flattened
Development
Real World Uses
·
·
·
·
·
4/71
Introduction
6/71
Turtle
<https://w3id.org/people/bsletten>
a <http://xmlns.com/foaf/0.1/Person> ;
<http://xmlns.com/foaf/0.1/birthday>
"05-26" ;
<http://xmlns.com/foaf/0.1/name>
"Brian Sletten" .
7/71
Remote Turtle
> http get http://bosatsu.net/turtle/brian.ttl
<https://w3id.org/people/bsletten>
<http://xmlns.com/foaf/0.1/depiction>
<http://bosatsu.net/images/briansletten.jpg> .
8/71
Turtle
> rdfcat --out ttl facts.ttl http://bosatsu.net/turtle/brian.ttl
<https://w3id.org/people/bsletten>
a <http://xmlns.com/foaf/0.1/Person> ;
<http://xmlns.com/foaf/0.1/birthday>
"05-26" ;
<http://xmlns.com/foaf/0.1/depiction>
<http://bosatsu.net/images/briansletten.jpg> ;
<http://xmlns.com/foaf/0.1/name>
"Brian Sletten" .
9/71
10/71
Credit: LinkedData.org License: CC-BY-SA
11/71
12/71
13/71
Basic JSON-LD
JSON-LD Goals
100% Compatible with JSON
Zero Edits Where Possible
Bring Linked Data to Web Development
No knowledge of RDF required
Interoperable with RDF
Can be stored in JSON database engines
·
·
·
·
·
·
15/71
JSON
{
"name" : "Brian Sletten",
"birthday" : "05-26"
}
16/71
JSON-LD
{
"@context" : "http://bosatsu.net/context/basic.jsonld",
"name" : "Brian Sletten",
"birthday" : "05-26"
}
17/71
Credit: danielcoy
License: CC BY-ND 2.0
JSON-LD Context
> http get http://bosatsu.net/context/basic.jsonld
HTTP/1.1 200 OK
Accept-Ranges: bytes
Access-Control-Allow-Origin: *
Content-Length: 130
Content-Type: application/ld+json
Date: Sun, 15 Feb 2015 21:08:17 GMT
ETag: "1049bf-82-50f267f82b680"
Last-Modified: Sun, 15 Feb 2015 20:41:46 GMT
Server: Apache/2.2.16 (Debian)
{
"@context": {
"birthday": "http://xmlns.com/foaf/0.1/birthday",
"name": "http://xmlns.com/foaf/0.1/name"
}
}
19/71
JSON-LD with Embedded Context
{
"@context" : {
"name" : "http://xmlns.com/foaf/0.1/name",
"birthday" : "http://xmlns.com/foaf/0.1/birthday"
},
"name" : "Brian Sletten",
"birthday" : "05-26"
}
20/71
Generating Turtle From JSON-LD
> rdfcat --out ttl http://bosatsu.net/jsonld/basic.jsonld
[
<http://xmlns.com/foaf/0.1/birthday>
"05-26" ;
<http://xmlns.com/foaf/0.1/name>
"Brian Sletten"
] .
21/71
JSON-LD with Embedded Context and Id
{
"@context" : {
"name" : "http://xmlns.com/foaf/0.1/name",
"birthday" : "http://xmlns.com/foaf/0.1/birthday"
},
"@id" : "https://w3id.org/people/bsletten",
"name" : "Brian Sletten",
"birthday" : "05-26"
}
22/71
Generating Turtle From JSON-LD
> rdfcat --out ttl http://bosatsu.net/jsonld/basic.jsonld
<https://w3id.org/people/bsletten>
<http://xmlns.com/foaf/0.1/birthday> "05-26" ;
<http://xmlns.com/foaf/0.1/name> "Brian Sletten" .
23/71
Fetching Turtle
> http get http://bosatsu.net/turtle/brian.ttl
HTTP/1.1 200 OK
Accept-Ranges: bytes
Access-Control-Allow-Origin: *
Content-Length: 124
Content-Type: text/turtle
Date: Sun, 15 Feb 2015 22:58:49 GMT
ETag: "1049e7-7c-50f27daf231c0"
Last-Modified: Sun, 15 Feb 2015 22:18:55 GMT
Server: Apache/2.2.16 (Debian)
<https://w3id.org/people/bsletten>
<http://xmlns.com/foaf/0.1/depiction>
"http://bosatsu.net/images/briansletten.jpg" .
24/71
Merging JSON-LD and Turtle
> rdfcat --out ttl http://bosatsu.net/jsonld/basic.jsonld
http://bosatsu.net/turtle/brian.ttl
<https://w3id.org/people/bsletten>
<http://xmlns.com/foaf/0.1/birthday> "05-26" ;
<http://xmlns.com/foaf/0.1/depiction>
<http://bosatsu.net/images/briansletten.jpg> ;
<http://xmlns.com/foaf/0.1/name> "Brian Sletten" .
25/71
JSON-LD with Embedded Context
{
"@context" : {
"fullname" : "http://xmlns.com/foaf/0.1/name",
"dob" : "http://xmlns.com/foaf/0.1/birthday"
},
"fullname" : "Brian Sletten",
"dob" : "05-26"
}
<https://w3id.org/people/bsletten>
<http://xmlns.com/foaf/0.1/birthday> "05-26" ;
<http://xmlns.com/foaf/0.1/name> "Brian Sletten" .
26/71
HTTP Link Header (RFC5988)
> http get http://bosatsu.net/json/brian.json
HTTP/1.1 200 OK
Accept-Ranges: bytes
Access-Control-Allow-Origin: *
Content-Length: 56
Content-Type: application/json
Date: Sun, 15 Feb 2015 23:45:10 GMT
ETag: "1049ea-38-50f29083f5f80"
Last-Modified: Sun, 15 Feb 2015 23:43:10 GMT
Server: Apache/2.2.16 (Debian)
Link: <http://bosatsu.net/context/basic.jsonld>;
rel="http://www.w3.org/ns/json-ld#context";
type="application/ld+json"
{
"birthday": "05-26",
"name": "Brian Sletten"
}
27/71
JSON-LD Features
Internationalized Resource Identifiers (IRIs) for JSON objects
Key disambiguation
Make distributed JSON object references
Support I18N
Typed literals
Ability to express directed graphs
·
·
·
·
·
·
28/71
Terms
Short-hand string identifier
Can be expanded to an IRI or a blank node identifier
Minimal naming restrictions
·
·
·
Don't start with '@'
Cannot be a keyword
·
·
29/71
Node Objects
JSON object
Zero or more properties of a node
Not part of a @context
Does not contain @value, @list or @set keywords
·
·
·
·
30/71
Value Objects
JSON object
Used to associate types or languages with values
·
·
31/71
Node @type
{
"@context" : {
"name" : "http://xmlns.com/foaf/0.1/name",
"birthday" : "http://xmlns.com/foaf/0.1/birthday"
},
"@type" : "http://xmlns.com/foaf/0.1/Person",
"name" : "Brian Sletten",
"birthday" : "05-26"
}
[
a <http://xmlns.com/foaf/0.1/Person> ;
<http://xmlns.com/foaf/0.1/birthday> "05-26" ;
<http://xmlns.com/foaf/0.1/name> "Brian Sletten"
] .
32/71
Multiple Types
{
"@context" : {
"name" : "http://xmlns.com/foaf/0.1/name",
"birthday" : "http://xmlns.com/foaf/0.1/birthday",
"Person" : "http://xmlns.com/foaf/0.1/Person",
"PhishFan" : "http://example.com/ns/PhishFan"
},
"@type" : ["Person", "PhishFan"],
"name" : "Brian Sletten",
"birthday" : "05-26"
}
[
a <http://xmlns.com/foaf/0.1/Person> ,
<http://example.com/ns/PhishFan> ;
<http://xmlns.com/foaf/0.1/birthday> "05-26" ;
<http://xmlns.com/foaf/0.1/name> "Brian Sletten"
] .
33/71
@vocab
{
"@context" : {
"@vocab" : "http://xmlns.com/foaf/0.1/"
},
"@type" : "Person",
"name" : "Brian Sletten",
"birthday" : "05-26"
}
[
a <http://xmlns.com/foaf/0.1/Person> ;
<http://xmlns.com/foaf/0.1/birthday> "05-26" ;
<http://xmlns.com/foaf/0.1/name> "Brian Sletten"
] .
34/71
Identifying Identifiers
{
"@context" : {
"@vocab" : "http://xmlns.com/foaf/0.1/"
},
"@type" : "Person",
"name" : "Brian Sletten",
"birthday" : "05-26",
"homepage" : "http://bosatsu.net/"
}
[
a <http://xmlns.com/foaf/0.1/Person> ;
<http://xmlns.com/foaf/0.1/birthday> "05-26" ;
<http://xmlns.com/foaf/0.1/homepage> "http://bosatsu.net/" ;
<http://xmlns.com/foaf/0.1/name> "Brian Sletten"
] .
35/71
Identifying Identifiers
{
"@context" : {
"@vocab" : "http://xmlns.com/foaf/0.1/",
"homepage": {
"@type" : "@id"
}
},
"@type" : "Person",
"name" : "Brian Sletten",
"birthday" : "05-26",
"homepage" : "http://bosatsu.net/"
}
[
a <http://xmlns.com/foaf/0.1/Person> ;
<http://xmlns.com/foaf/0.1/birthday> "05-26" ;
<http://xmlns.com/foaf/0.1/homepage> <http://bosatsu.net/> ;
<http://xmlns.com/foaf/0.1/name> "Brian Sletten"
] .
36/71
Value @type
{
"@context" : {
"foaf" : "http://xmlns.com/foaf/0.1/",
"name" : "foaf:name",
"birthday" : "foaf:birthday",
"xsd" : "http://www.w3.org/2001/XMLSchema#",
"ex" : "http://example.com/ns/",
"age" : { "@id" : "foaf:age", "@type" : "xsd:integer" }
},
"@type" : "ex:Dog",
"name" : "Loki of Asgard",
"birthday" : "05-30",
"age" : "3"
}
37/71
Value @type
@prefix ex: <http://example.com/ns/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
[
a ex:Dog ;
foaf:age 3 ;
foaf:birthday "05-30" ;
foaf:name "Loki of Asgard"
] .
38/71
Resolving Relative Identifiers
{
"@context" : {
"name" : "http://xmlns.com/foaf/0.1/name",
"birthday" : "http://xmlns.com/foaf/0.1/birthday"
},
"@id" : "brian",
"name" : "Brian Sletten",
"birthday" : "05-26"
}
<file:///Users/brian/src/jsonld/brian>
<http://xmlns.com/foaf/0.1/birthday> "05-26" ;
<http://xmlns.com/foaf/0.1/name> "Brian Sletten" .
39/71
@base
{
"@context" : {
"name" : "http://xmlns.com/foaf/0.1/name",
"birthday" : "http://xmlns.com/foaf/0.1/birthday",
"@base" : "http://bosatsu.net/people/"
},
"@id" : "brian",
"name" : "Brian Sletten",
"birthday" : "05-26"
}
<http://bosatsu.net/people/brian>
<http://xmlns.com/foaf/0.1/birthday> "05-26" ;
<http://xmlns.com/foaf/0.1/name> "Brian Sletten" .
40/71
Aliasing
{
"@context" : {
"name" : "http://xmlns.com/foaf/0.1/name",
"birthday" : "http://xmlns.com/foaf/0.1/birthday",
"url" : "@id"
},
"url": "http://bosatsu.net/people/brian",
"name" : "Brian Sletten",
"birthday" : "05-26"
}
<http://bosatsu.net/people/brian>
<http://xmlns.com/foaf/0.1/birthday> "05-26" ;
<http://xmlns.com/foaf/0.1/name> "Brian Sletten" .
41/71
@base + Aliasing
{
"@context" : {
"name" : "http://xmlns.com/foaf/0.1/name",
"birthday" : "http://xmlns.com/foaf/0.1/birthday",
"@base": "http://example.com/id/",
"eid" : "@id"
},
"eid": "12345",
"name" : "Brian Sletten",
"birthday" : "05-26"
}
<http://example.com/id/12345>
<http://xmlns.com/foaf/0.1/birthday> "05-26" ;
<http://xmlns.com/foaf/0.1/name> "Brian Sletten" .
42/71
Expansion, Compaction, Flattening
JSON-LD Document
{
"@context":
{
"name": "http://xmlns.com/foaf/0.1/name",
"homepage": {
"@id": "http://xmlns.com/foaf/0.1/homepage",
"@type": "@id"
}
},
"name": "Manu Sporny",
"homepage": "http://manu.sporny.org/"
}
44/71
JSON-LD Expanded Form
[
{
"http://xmlns.com/foaf/0.1/name": [
{ "@value": "Manu Sporny" }
],
"http://xmlns.com/foaf/0.1/homepage": [
{ "@id": "http://manu.sporny.org/" }
]
}
]
45/71
JSON-LD Document Compacted (Alt Context)
{
"@context":
{
"nom": "http://xmlns.com/foaf/0.1/name",
"page": {
"@id": "http://xmlns.com/foaf/0.1/homepage",
"@type": "@id"
}
},
"nom": "Manu Sporny",
"page": "http://manu.sporny.org/"
}
46/71
47/71
48/71
49/71
50/71
JSON-LD Document
{
"@context" : {
"@vocab" : "http://xmlns.com/foaf/0.1/"
},
"@id" : "https://w3id.org/people/bsletten",
"name" : "Brian Sletten",
"knows" : [
{ "@type" : "Person",
"name" : "Sean Cier" },
{ "@type" : "Person",
"name" : "Jeff Ricks" },
{ "@id" : "http://example.com/id/ironman",
"@type" : "Person",
"name" : "Malik Coates" }
]
}
51/71
JSON-LD Document Flattened
{ "@graph": [
{ "@id": "_:b0",
"@type": "http://xmlns.com/foaf/0.1/Person",
"http://xmlns.com/foaf/0.1/name": "Sean Cier" },
{ "@id": "_:b1",
"@type": "http://xmlns.com/foaf/0.1/Person",
"http://xmlns.com/foaf/0.1/name": "Jeff Ricks" },
{ "@id": "http://example.com/id/ironman",
"@type": "http://xmlns.com/foaf/0.1/Person",
"http://xmlns.com/foaf/0.1/name": "Malik Coates" },
{ "@id": "https://w3id.org/people/bsletten",
"http://xmlns.com/foaf/0.1/knows": [
{ "@id": "_:b0" },
{ "@id": "_:b1" },
{ "@id": "http://example.com/id/ironman" }
],
"http://xmlns.com/foaf/0.1/name": "Brian Sletten"
}]
}
52/71
Development
Credit: http://json-ld.org/playground/index.html
54/71
JSON-LD Tools
JavaScript : https://github.com/digitalbazaar/jsonld.js
Python
PHP
Ruby : https://github.com/ruby-rdf/json-ld/
Java : https://github.com/jsonld-java/jsonld-java
C# : https://github.com/NuGet/json-ld.net
·
·
https://github.com/digitalbazaar/pyld
https://github.com/RDFLib/rdflib-jsonld
·
·
·
https://github.com/digitalbazaar/php-json-ld
https://github.com/lanthaler/JsonLD
·
·
·
·
·
55/71
JSON-LD (Javascript)
var jsonld = require('jsonld');
var doc = {
"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.pn
};
var context = {
"name": "http://schema.org/name",
"homepage": {"@id": "http://schema.org/url", "@type": "@id"},
"image": {"@id": "http://schema.org/image", "@type": "@id"}
};
// compact a document according to a particular context
jsonld.compact(doc, context, function(err, compacted) {
console.log(JSON.stringify(compacted, null, 2));
});
56/71
JSON-LD (Java)
// Open a valid json(-ld) input file
InputStream inputStream = new FileInputStream("input.json");
// Read the file into an Object (The type of this object will be a List, Ma
// Number or null depending on the root object in the file).
Object jsonObject = JsonUtils.fromInputStream(inputStream);
// Create a context JSON map containing prefixes and definitions
Map context = new HashMap();
// Customise context...
// Create an instance of JsonLdOptions with the standard JSON-
LD options
JsonLdOptions options = new JsonLdOptions();
// Customise options...
// Call whichever JSONLD function you want! (e.g. compact)
Object compact = JsonLdProcessor.compact(jsonObject, context, options);
// Print out the result (or don't, it's your call!)
System.out.println(JsonUtils.toPrettyString(compact));
57/71
Real World Uses
Wrapping Existing APIs
// RFC 6570 URI Templates
def url = "https://maps.googleapis.com/maps/api/geocode/json?
latlng=${lat},${lon}&key=${googleConfig.geocode.apikey}"
59/71
Embedded JSON-LD
<html>
<body>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "EventReservation",
"reservationNumber": "IO12345",
"underName": {
"@type": "Person",
"name": "John Smith"
},
...
</script>
...
</html>
60/71
61/71
RSVPAction
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Event",
"name": "John's Birthday Party",
... information about the event ...
"action": {
"@type": "RsvpAction",
"actionHandler": {
"@type": "HttpActionHandler",
"url": "https://events-organizer.com/rsvp?eventId=123",
"method": "POST",
"requiredProperty": "rsvpStatus",
}
}
}
</script>
62/71
Responding...
POST /rsvp?eventId=123 HTTP/1.1
Host: events-organizer.com
Authorization: Bearer AbCdEf123456
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/1.0
(KHTML, like Gecko; Gmail Actions)
rsvpStatus=YES
63/71
64/71
<script type="application/ld+json">
[{
"@context" : "http://schema.org",
"@type" : "MusicEvent",
"name" : "Phish",
"startDate" : "2015-09-04T19:30",
"location" : {
"@type" : "Place",
"name" : "Dick's Sporting Goods Park",
"address" : "6000 Victory Way, Commerce City, CO, USA"
},
"offers" : {
"@type" : "Offer",
"url" : "http://www.altitudetickets.com/event/phish-sep-4-
3671/"
}
},
...
]
</script>
65/71
66/71
67/71
68/71
{
"@context": "https://w3id.org/identity/v1",
"id": "https://example.com/identities/bob",
"type": ["Identity", "Person"],
"name": "Bob Bobman",
"governmentId": "123-45-6789",
"birthdate": "1985-12-14",
"email": "bbob@example.com",
"mobileNumber": "12345678910",
"shippingAddress": {
"street": "372 Sumter Lane",
"city": "Blackrock",
"region": "Nevada",
"postalCode": "237842"
},
...
}
69/71
...
"credential": [{
"id": "http://ssa.us.gov/credentials/3732",
"type": "PassportCredential",
"claim": {
"id": "https://example.com/identities/bob",
"name": "Bob Bobman",
"birthdate": "1985-12-14",
"governmentId": "123-45-6789"
},
"expires": "2018-01-01",
"signature": {
"type": "GraphSignature2012",
"creator": "https://ssa.us.gov/keys/27",
"signature": "3780eyfh3q0fhhfiq3q9f8ahsidfhf29rhaish"
}
}, ... ]
}
70/71
Questions?
" brian@bosatsu.net
! @bsletten
+ http://tinyurl.com/bjs-gplus
$ bsletten

More Related Content

Viewers also liked

Drivesploit: Circumventing Both Automated AND Manual Drive-By-Download Detection
Drivesploit: Circumventing Both Automated AND Manual Drive-By-Download DetectionDrivesploit: Circumventing Both Automated AND Manual Drive-By-Download Detection
Drivesploit: Circumventing Both Automated AND Manual Drive-By-Download Detection
Wayne Huang
 
JSON Rules Language
JSON Rules LanguageJSON Rules Language
JSON Rules Language
giurca
 
Adoption De Pratiques De Test Agile Dans Un Environnement Legacy
Adoption De Pratiques De Test Agile Dans Un Environnement LegacyAdoption De Pratiques De Test Agile Dans Un Environnement Legacy
Adoption De Pratiques De Test Agile Dans Un Environnement Legacy
Xavier Warzee
 
BRMS JUG Toulouse 20100615
BRMS JUG Toulouse 20100615BRMS JUG Toulouse 20100615
BRMS JUG Toulouse 20100615
JUG Toulouse
 
Introduction BRMS Paris JUG 20101109
Introduction BRMS Paris JUG 20101109Introduction BRMS Paris JUG 20101109
Introduction BRMS Paris JUG 20101109
Emmanuel Bonnet
 

Viewers also liked (16)

Our House Rules
Our House RulesOur House Rules
Our House Rules
 
Swagger, language pour décrire des API REST
Swagger, language pour décrire des API RESTSwagger, language pour décrire des API REST
Swagger, language pour décrire des API REST
 
JSON toujours deux fois
JSON toujours deux foisJSON toujours deux fois
JSON toujours deux fois
 
Cloud commputing impacts sur la façon de pensée les SI et la DSI
Cloud commputing   impacts sur la façon de pensée les SI et la DSICloud commputing   impacts sur la façon de pensée les SI et la DSI
Cloud commputing impacts sur la façon de pensée les SI et la DSI
 
Drivesploit: Circumventing Both Automated AND Manual Drive-By-Download Detection
Drivesploit: Circumventing Both Automated AND Manual Drive-By-Download DetectionDrivesploit: Circumventing Both Automated AND Manual Drive-By-Download Detection
Drivesploit: Circumventing Both Automated AND Manual Drive-By-Download Detection
 
JSON Rules Language
JSON Rules LanguageJSON Rules Language
JSON Rules Language
 
Adoption De Pratiques De Test Agile Dans Un Environnement Legacy
Adoption De Pratiques De Test Agile Dans Un Environnement LegacyAdoption De Pratiques De Test Agile Dans Un Environnement Legacy
Adoption De Pratiques De Test Agile Dans Un Environnement Legacy
 
Drools
DroolsDrools
Drools
 
Soutenance de thèse doctorale "Méthodologie De Conception Systémique Pour Les...
Soutenance de thèse doctorale "Méthodologie De Conception Systémique Pour Les...Soutenance de thèse doctorale "Méthodologie De Conception Systémique Pour Les...
Soutenance de thèse doctorale "Méthodologie De Conception Systémique Pour Les...
 
Swagger pour documenter votre REST API - présentation en français
Swagger pour documenter votre REST API - présentation en françaisSwagger pour documenter votre REST API - présentation en français
Swagger pour documenter votre REST API - présentation en français
 
Chorégraphie distribuée à partir d’un processus d’orchestration BPMN
Chorégraphie distribuée à partir d’un processus d’orchestration BPMNChorégraphie distribuée à partir d’un processus d’orchestration BPMN
Chorégraphie distribuée à partir d’un processus d’orchestration BPMN
 
A Multi-tenant Architecture for Business Process Executions
A Multi-tenant Architecture for Business Process ExecutionsA Multi-tenant Architecture for Business Process Executions
A Multi-tenant Architecture for Business Process Executions
 
Drools et les moteurs de règles
Drools et les moteurs de règlesDrools et les moteurs de règles
Drools et les moteurs de règles
 
BRMS JUG Toulouse 20100615
BRMS JUG Toulouse 20100615BRMS JUG Toulouse 20100615
BRMS JUG Toulouse 20100615
 
Introduction BRMS Paris JUG 20101109
Introduction BRMS Paris JUG 20101109Introduction BRMS Paris JUG 20101109
Introduction BRMS Paris JUG 20101109
 
Les tendances du Marketing Digital 2014 - Ateliers webmarketing WSI - Saison 4
Les tendances du Marketing Digital 2014 - Ateliers webmarketing WSI - Saison 4Les tendances du Marketing Digital 2014 - Ateliers webmarketing WSI - Saison 4
Les tendances du Marketing Digital 2014 - Ateliers webmarketing WSI - Saison 4
 

Similar to SmartData Webinar Slides JSON-LD

[cb22] Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once ...
[cb22] Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once ...[cb22] Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once ...
[cb22] Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once ...
CODE BLUE
 
Persistent public annotation
Persistent public annotationPersistent public annotation
Persistent public annotation
alasaadi81
 
The hypermedia api
The hypermedia apiThe hypermedia api
The hypermedia api
Inviqa
 
RMLL 2013 : Build Your Personal Search Engine using Crawlzilla
RMLL 2013 : Build Your Personal Search Engine using CrawlzillaRMLL 2013 : Build Your Personal Search Engine using Crawlzilla
RMLL 2013 : Build Your Personal Search Engine using Crawlzilla
Jazz Yao-Tsung Wang
 
Building Things Fast - and getting approval
Building Things Fast - and getting approvalBuilding Things Fast - and getting approval
Building Things Fast - and getting approval
Simon Willison
 

Similar to SmartData Webinar Slides JSON-LD (20)

Opening up the Social Web - Standards that are bridging the Islands
Opening up the Social Web - Standards that are bridging the IslandsOpening up the Social Web - Standards that are bridging the Islands
Opening up the Social Web - Standards that are bridging the Islands
 
From zero to hero - Easy log centralization with Logstash and Elasticsearch
From zero to hero - Easy log centralization with Logstash and ElasticsearchFrom zero to hero - Easy log centralization with Logstash and Elasticsearch
From zero to hero - Easy log centralization with Logstash and Elasticsearch
 
From Zero to Hero - Centralized Logging with Logstash & Elasticsearch
From Zero to Hero - Centralized Logging with Logstash & ElasticsearchFrom Zero to Hero - Centralized Logging with Logstash & Elasticsearch
From Zero to Hero - Centralized Logging with Logstash & Elasticsearch
 
[cb22] Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once ...
[cb22] Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once ...[cb22] Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once ...
[cb22] Scaling the Security Researcher to Eliminate OSS Vulnerabilities Once ...
 
Recent Trends in Cyber Security
Recent Trends in Cyber SecurityRecent Trends in Cyber Security
Recent Trends in Cyber Security
 
Persistent public annotation
Persistent public annotationPersistent public annotation
Persistent public annotation
 
The hypermedia api
The hypermedia apiThe hypermedia api
The hypermedia api
 
REST teori og praksis; REST in theory and practice
REST teori og praksis; REST in theory and practiceREST teori og praksis; REST in theory and practice
REST teori og praksis; REST in theory and practice
 
Linux confau 2019: Web Security 2019
Linux confau 2019: Web Security 2019Linux confau 2019: Web Security 2019
Linux confau 2019: Web Security 2019
 
OWASP Free Training - SF2014 - Keary and Manico
OWASP Free Training - SF2014 - Keary and ManicoOWASP Free Training - SF2014 - Keary and Manico
OWASP Free Training - SF2014 - Keary and Manico
 
For each component in mule demo
For each component in mule demoFor each component in mule demo
For each component in mule demo
 
The CDO Agenda - Data Security and Encryption
The CDO Agenda - Data Security and EncryptionThe CDO Agenda - Data Security and Encryption
The CDO Agenda - Data Security and Encryption
 
OpenSSL programming (still somewhat initial version)
OpenSSL programming (still somewhat initial version)OpenSSL programming (still somewhat initial version)
OpenSSL programming (still somewhat initial version)
 
OWASP Portland - OWASP Top 10 For JavaScript Developers
OWASP Portland - OWASP Top 10 For JavaScript DevelopersOWASP Portland - OWASP Top 10 For JavaScript Developers
OWASP Portland - OWASP Top 10 For JavaScript Developers
 
Mitigate Maliciousness -- jQuery Europe 2013
Mitigate Maliciousness -- jQuery Europe 2013Mitigate Maliciousness -- jQuery Europe 2013
Mitigate Maliciousness -- jQuery Europe 2013
 
For Each Component
For Each ComponentFor Each Component
For Each Component
 
RMLL 2013 : Build Your Personal Search Engine using Crawlzilla
RMLL 2013 : Build Your Personal Search Engine using CrawlzillaRMLL 2013 : Build Your Personal Search Engine using Crawlzilla
RMLL 2013 : Build Your Personal Search Engine using Crawlzilla
 
OpenSSL Basic Function Call Flow
OpenSSL Basic Function Call FlowOpenSSL Basic Function Call Flow
OpenSSL Basic Function Call Flow
 
Building Things Fast - and getting approval
Building Things Fast - and getting approvalBuilding Things Fast - and getting approval
Building Things Fast - and getting approval
 
Network Security Data Visualization
Network Security Data VisualizationNetwork Security Data Visualization
Network Security Data Visualization
 

More from DATAVERSITY

The Data Trifecta – Privacy, Security & Governance Race from Reactivity to Re...
The Data Trifecta – Privacy, Security & Governance Race from Reactivity to Re...The Data Trifecta – Privacy, Security & Governance Race from Reactivity to Re...
The Data Trifecta – Privacy, Security & Governance Race from Reactivity to Re...
DATAVERSITY
 
Data Strategy Best Practices
Data Strategy Best PracticesData Strategy Best Practices
Data Strategy Best Practices
DATAVERSITY
 

More from DATAVERSITY (20)

Architecture, Products, and Total Cost of Ownership of the Leading Machine Le...
Architecture, Products, and Total Cost of Ownership of the Leading Machine Le...Architecture, Products, and Total Cost of Ownership of the Leading Machine Le...
Architecture, Products, and Total Cost of Ownership of the Leading Machine Le...
 
Data at the Speed of Business with Data Mastering and Governance
Data at the Speed of Business with Data Mastering and GovernanceData at the Speed of Business with Data Mastering and Governance
Data at the Speed of Business with Data Mastering and Governance
 
Exploring Levels of Data Literacy
Exploring Levels of Data LiteracyExploring Levels of Data Literacy
Exploring Levels of Data Literacy
 
Building a Data Strategy – Practical Steps for Aligning with Business Goals
Building a Data Strategy – Practical Steps for Aligning with Business GoalsBuilding a Data Strategy – Practical Steps for Aligning with Business Goals
Building a Data Strategy – Practical Steps for Aligning with Business Goals
 
Make Data Work for You
Make Data Work for YouMake Data Work for You
Make Data Work for You
 
Data Catalogs Are the Answer – What is the Question?
Data Catalogs Are the Answer – What is the Question?Data Catalogs Are the Answer – What is the Question?
Data Catalogs Are the Answer – What is the Question?
 
Data Catalogs Are the Answer – What Is the Question?
Data Catalogs Are the Answer – What Is the Question?Data Catalogs Are the Answer – What Is the Question?
Data Catalogs Are the Answer – What Is the Question?
 
Data Modeling Fundamentals
Data Modeling FundamentalsData Modeling Fundamentals
Data Modeling Fundamentals
 
Showing ROI for Your Analytic Project
Showing ROI for Your Analytic ProjectShowing ROI for Your Analytic Project
Showing ROI for Your Analytic Project
 
How a Semantic Layer Makes Data Mesh Work at Scale
How a Semantic Layer Makes  Data Mesh Work at ScaleHow a Semantic Layer Makes  Data Mesh Work at Scale
How a Semantic Layer Makes Data Mesh Work at Scale
 
Is Enterprise Data Literacy Possible?
Is Enterprise Data Literacy Possible?Is Enterprise Data Literacy Possible?
Is Enterprise Data Literacy Possible?
 
The Data Trifecta – Privacy, Security & Governance Race from Reactivity to Re...
The Data Trifecta – Privacy, Security & Governance Race from Reactivity to Re...The Data Trifecta – Privacy, Security & Governance Race from Reactivity to Re...
The Data Trifecta – Privacy, Security & Governance Race from Reactivity to Re...
 
Emerging Trends in Data Architecture – What’s the Next Big Thing?
Emerging Trends in Data Architecture – What’s the Next Big Thing?Emerging Trends in Data Architecture – What’s the Next Big Thing?
Emerging Trends in Data Architecture – What’s the Next Big Thing?
 
Data Governance Trends - A Look Backwards and Forwards
Data Governance Trends - A Look Backwards and ForwardsData Governance Trends - A Look Backwards and Forwards
Data Governance Trends - A Look Backwards and Forwards
 
Data Governance Trends and Best Practices To Implement Today
Data Governance Trends and Best Practices To Implement TodayData Governance Trends and Best Practices To Implement Today
Data Governance Trends and Best Practices To Implement Today
 
2023 Trends in Enterprise Analytics
2023 Trends in Enterprise Analytics2023 Trends in Enterprise Analytics
2023 Trends in Enterprise Analytics
 
Data Strategy Best Practices
Data Strategy Best PracticesData Strategy Best Practices
Data Strategy Best Practices
 
Who Should Own Data Governance – IT or Business?
Who Should Own Data Governance – IT or Business?Who Should Own Data Governance – IT or Business?
Who Should Own Data Governance – IT or Business?
 
Data Management Best Practices
Data Management Best PracticesData Management Best Practices
Data Management Best Practices
 
MLOps – Applying DevOps to Competitive Advantage
MLOps – Applying DevOps to Competitive AdvantageMLOps – Applying DevOps to Competitive Advantage
MLOps – Applying DevOps to Competitive Advantage
 

Recently uploaded

FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
MarinCaroMartnezBerg
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
amitlee9823
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
amitlee9823
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
JoseMangaJr1
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
amitlee9823
 

Recently uploaded (20)

Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
Predicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science ProjectPredicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science Project
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptx
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
ALSO dropshipping via API with DroFx.pptx
ALSO dropshipping via API with DroFx.pptxALSO dropshipping via API with DroFx.pptx
ALSO dropshipping via API with DroFx.pptx
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 

SmartData Webinar Slides JSON-LD

  • 3. Speaker Qualifications Specialize in next-generation technologies Author of O'Reilly Videos on Hypermedia and Linking Data Author of 'Resource-Oriented Architecture Patterns for Webs of Data' Teaches and speaks internationally about REST, Semantic Web, Data Science, Security, Visualization, Architecture Worked in Defense, Finance, Retail, Hospitality, Video Game, Health Care, Telecommunications and Publishing Industries International Pop Recording Artist · · · · · · 3/71
  • 4. Agenda Introduction Basic JSON-LD Expansion, Compaction, Flattened Development Real World Uses · · · · · 4/71
  • 8. Remote Turtle > http get http://bosatsu.net/turtle/brian.ttl <https://w3id.org/people/bsletten> <http://xmlns.com/foaf/0.1/depiction> <http://bosatsu.net/images/briansletten.jpg> . 8/71
  • 9. Turtle > rdfcat --out ttl facts.ttl http://bosatsu.net/turtle/brian.ttl <https://w3id.org/people/bsletten> a <http://xmlns.com/foaf/0.1/Person> ; <http://xmlns.com/foaf/0.1/birthday> "05-26" ; <http://xmlns.com/foaf/0.1/depiction> <http://bosatsu.net/images/briansletten.jpg> ; <http://xmlns.com/foaf/0.1/name> "Brian Sletten" . 9/71
  • 10. 10/71
  • 12. 12/71
  • 13. 13/71
  • 15. JSON-LD Goals 100% Compatible with JSON Zero Edits Where Possible Bring Linked Data to Web Development No knowledge of RDF required Interoperable with RDF Can be stored in JSON database engines · · · · · · 15/71
  • 16. JSON { "name" : "Brian Sletten", "birthday" : "05-26" } 16/71
  • 17. JSON-LD { "@context" : "http://bosatsu.net/context/basic.jsonld", "name" : "Brian Sletten", "birthday" : "05-26" } 17/71
  • 19. JSON-LD Context > http get http://bosatsu.net/context/basic.jsonld HTTP/1.1 200 OK Accept-Ranges: bytes Access-Control-Allow-Origin: * Content-Length: 130 Content-Type: application/ld+json Date: Sun, 15 Feb 2015 21:08:17 GMT ETag: "1049bf-82-50f267f82b680" Last-Modified: Sun, 15 Feb 2015 20:41:46 GMT Server: Apache/2.2.16 (Debian) { "@context": { "birthday": "http://xmlns.com/foaf/0.1/birthday", "name": "http://xmlns.com/foaf/0.1/name" } } 19/71
  • 20. JSON-LD with Embedded Context { "@context" : { "name" : "http://xmlns.com/foaf/0.1/name", "birthday" : "http://xmlns.com/foaf/0.1/birthday" }, "name" : "Brian Sletten", "birthday" : "05-26" } 20/71
  • 21. Generating Turtle From JSON-LD > rdfcat --out ttl http://bosatsu.net/jsonld/basic.jsonld [ <http://xmlns.com/foaf/0.1/birthday> "05-26" ; <http://xmlns.com/foaf/0.1/name> "Brian Sletten" ] . 21/71
  • 22. JSON-LD with Embedded Context and Id { "@context" : { "name" : "http://xmlns.com/foaf/0.1/name", "birthday" : "http://xmlns.com/foaf/0.1/birthday" }, "@id" : "https://w3id.org/people/bsletten", "name" : "Brian Sletten", "birthday" : "05-26" } 22/71
  • 23. Generating Turtle From JSON-LD > rdfcat --out ttl http://bosatsu.net/jsonld/basic.jsonld <https://w3id.org/people/bsletten> <http://xmlns.com/foaf/0.1/birthday> "05-26" ; <http://xmlns.com/foaf/0.1/name> "Brian Sletten" . 23/71
  • 24. Fetching Turtle > http get http://bosatsu.net/turtle/brian.ttl HTTP/1.1 200 OK Accept-Ranges: bytes Access-Control-Allow-Origin: * Content-Length: 124 Content-Type: text/turtle Date: Sun, 15 Feb 2015 22:58:49 GMT ETag: "1049e7-7c-50f27daf231c0" Last-Modified: Sun, 15 Feb 2015 22:18:55 GMT Server: Apache/2.2.16 (Debian) <https://w3id.org/people/bsletten> <http://xmlns.com/foaf/0.1/depiction> "http://bosatsu.net/images/briansletten.jpg" . 24/71
  • 25. Merging JSON-LD and Turtle > rdfcat --out ttl http://bosatsu.net/jsonld/basic.jsonld http://bosatsu.net/turtle/brian.ttl <https://w3id.org/people/bsletten> <http://xmlns.com/foaf/0.1/birthday> "05-26" ; <http://xmlns.com/foaf/0.1/depiction> <http://bosatsu.net/images/briansletten.jpg> ; <http://xmlns.com/foaf/0.1/name> "Brian Sletten" . 25/71
  • 26. JSON-LD with Embedded Context { "@context" : { "fullname" : "http://xmlns.com/foaf/0.1/name", "dob" : "http://xmlns.com/foaf/0.1/birthday" }, "fullname" : "Brian Sletten", "dob" : "05-26" } <https://w3id.org/people/bsletten> <http://xmlns.com/foaf/0.1/birthday> "05-26" ; <http://xmlns.com/foaf/0.1/name> "Brian Sletten" . 26/71
  • 27. HTTP Link Header (RFC5988) > http get http://bosatsu.net/json/brian.json HTTP/1.1 200 OK Accept-Ranges: bytes Access-Control-Allow-Origin: * Content-Length: 56 Content-Type: application/json Date: Sun, 15 Feb 2015 23:45:10 GMT ETag: "1049ea-38-50f29083f5f80" Last-Modified: Sun, 15 Feb 2015 23:43:10 GMT Server: Apache/2.2.16 (Debian) Link: <http://bosatsu.net/context/basic.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json" { "birthday": "05-26", "name": "Brian Sletten" } 27/71
  • 28. JSON-LD Features Internationalized Resource Identifiers (IRIs) for JSON objects Key disambiguation Make distributed JSON object references Support I18N Typed literals Ability to express directed graphs · · · · · · 28/71
  • 29. Terms Short-hand string identifier Can be expanded to an IRI or a blank node identifier Minimal naming restrictions · · · Don't start with '@' Cannot be a keyword · · 29/71
  • 30. Node Objects JSON object Zero or more properties of a node Not part of a @context Does not contain @value, @list or @set keywords · · · · 30/71
  • 31. Value Objects JSON object Used to associate types or languages with values · · 31/71
  • 32. Node @type { "@context" : { "name" : "http://xmlns.com/foaf/0.1/name", "birthday" : "http://xmlns.com/foaf/0.1/birthday" }, "@type" : "http://xmlns.com/foaf/0.1/Person", "name" : "Brian Sletten", "birthday" : "05-26" } [ a <http://xmlns.com/foaf/0.1/Person> ; <http://xmlns.com/foaf/0.1/birthday> "05-26" ; <http://xmlns.com/foaf/0.1/name> "Brian Sletten" ] . 32/71
  • 33. Multiple Types { "@context" : { "name" : "http://xmlns.com/foaf/0.1/name", "birthday" : "http://xmlns.com/foaf/0.1/birthday", "Person" : "http://xmlns.com/foaf/0.1/Person", "PhishFan" : "http://example.com/ns/PhishFan" }, "@type" : ["Person", "PhishFan"], "name" : "Brian Sletten", "birthday" : "05-26" } [ a <http://xmlns.com/foaf/0.1/Person> , <http://example.com/ns/PhishFan> ; <http://xmlns.com/foaf/0.1/birthday> "05-26" ; <http://xmlns.com/foaf/0.1/name> "Brian Sletten" ] . 33/71
  • 34. @vocab { "@context" : { "@vocab" : "http://xmlns.com/foaf/0.1/" }, "@type" : "Person", "name" : "Brian Sletten", "birthday" : "05-26" } [ a <http://xmlns.com/foaf/0.1/Person> ; <http://xmlns.com/foaf/0.1/birthday> "05-26" ; <http://xmlns.com/foaf/0.1/name> "Brian Sletten" ] . 34/71
  • 35. Identifying Identifiers { "@context" : { "@vocab" : "http://xmlns.com/foaf/0.1/" }, "@type" : "Person", "name" : "Brian Sletten", "birthday" : "05-26", "homepage" : "http://bosatsu.net/" } [ a <http://xmlns.com/foaf/0.1/Person> ; <http://xmlns.com/foaf/0.1/birthday> "05-26" ; <http://xmlns.com/foaf/0.1/homepage> "http://bosatsu.net/" ; <http://xmlns.com/foaf/0.1/name> "Brian Sletten" ] . 35/71
  • 36. Identifying Identifiers { "@context" : { "@vocab" : "http://xmlns.com/foaf/0.1/", "homepage": { "@type" : "@id" } }, "@type" : "Person", "name" : "Brian Sletten", "birthday" : "05-26", "homepage" : "http://bosatsu.net/" } [ a <http://xmlns.com/foaf/0.1/Person> ; <http://xmlns.com/foaf/0.1/birthday> "05-26" ; <http://xmlns.com/foaf/0.1/homepage> <http://bosatsu.net/> ; <http://xmlns.com/foaf/0.1/name> "Brian Sletten" ] . 36/71
  • 37. Value @type { "@context" : { "foaf" : "http://xmlns.com/foaf/0.1/", "name" : "foaf:name", "birthday" : "foaf:birthday", "xsd" : "http://www.w3.org/2001/XMLSchema#", "ex" : "http://example.com/ns/", "age" : { "@id" : "foaf:age", "@type" : "xsd:integer" } }, "@type" : "ex:Dog", "name" : "Loki of Asgard", "birthday" : "05-30", "age" : "3" } 37/71
  • 38. Value @type @prefix ex: <http://example.com/ns/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . [ a ex:Dog ; foaf:age 3 ; foaf:birthday "05-30" ; foaf:name "Loki of Asgard" ] . 38/71
  • 39. Resolving Relative Identifiers { "@context" : { "name" : "http://xmlns.com/foaf/0.1/name", "birthday" : "http://xmlns.com/foaf/0.1/birthday" }, "@id" : "brian", "name" : "Brian Sletten", "birthday" : "05-26" } <file:///Users/brian/src/jsonld/brian> <http://xmlns.com/foaf/0.1/birthday> "05-26" ; <http://xmlns.com/foaf/0.1/name> "Brian Sletten" . 39/71
  • 40. @base { "@context" : { "name" : "http://xmlns.com/foaf/0.1/name", "birthday" : "http://xmlns.com/foaf/0.1/birthday", "@base" : "http://bosatsu.net/people/" }, "@id" : "brian", "name" : "Brian Sletten", "birthday" : "05-26" } <http://bosatsu.net/people/brian> <http://xmlns.com/foaf/0.1/birthday> "05-26" ; <http://xmlns.com/foaf/0.1/name> "Brian Sletten" . 40/71
  • 41. Aliasing { "@context" : { "name" : "http://xmlns.com/foaf/0.1/name", "birthday" : "http://xmlns.com/foaf/0.1/birthday", "url" : "@id" }, "url": "http://bosatsu.net/people/brian", "name" : "Brian Sletten", "birthday" : "05-26" } <http://bosatsu.net/people/brian> <http://xmlns.com/foaf/0.1/birthday> "05-26" ; <http://xmlns.com/foaf/0.1/name> "Brian Sletten" . 41/71
  • 42. @base + Aliasing { "@context" : { "name" : "http://xmlns.com/foaf/0.1/name", "birthday" : "http://xmlns.com/foaf/0.1/birthday", "@base": "http://example.com/id/", "eid" : "@id" }, "eid": "12345", "name" : "Brian Sletten", "birthday" : "05-26" } <http://example.com/id/12345> <http://xmlns.com/foaf/0.1/birthday> "05-26" ; <http://xmlns.com/foaf/0.1/name> "Brian Sletten" . 42/71
  • 44. JSON-LD Document { "@context": { "name": "http://xmlns.com/foaf/0.1/name", "homepage": { "@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@id" } }, "name": "Manu Sporny", "homepage": "http://manu.sporny.org/" } 44/71
  • 45. JSON-LD Expanded Form [ { "http://xmlns.com/foaf/0.1/name": [ { "@value": "Manu Sporny" } ], "http://xmlns.com/foaf/0.1/homepage": [ { "@id": "http://manu.sporny.org/" } ] } ] 45/71
  • 46. JSON-LD Document Compacted (Alt Context) { "@context": { "nom": "http://xmlns.com/foaf/0.1/name", "page": { "@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@id" } }, "nom": "Manu Sporny", "page": "http://manu.sporny.org/" } 46/71
  • 47. 47/71
  • 48. 48/71
  • 49. 49/71
  • 50. 50/71
  • 51. JSON-LD Document { "@context" : { "@vocab" : "http://xmlns.com/foaf/0.1/" }, "@id" : "https://w3id.org/people/bsletten", "name" : "Brian Sletten", "knows" : [ { "@type" : "Person", "name" : "Sean Cier" }, { "@type" : "Person", "name" : "Jeff Ricks" }, { "@id" : "http://example.com/id/ironman", "@type" : "Person", "name" : "Malik Coates" } ] } 51/71
  • 52. JSON-LD Document Flattened { "@graph": [ { "@id": "_:b0", "@type": "http://xmlns.com/foaf/0.1/Person", "http://xmlns.com/foaf/0.1/name": "Sean Cier" }, { "@id": "_:b1", "@type": "http://xmlns.com/foaf/0.1/Person", "http://xmlns.com/foaf/0.1/name": "Jeff Ricks" }, { "@id": "http://example.com/id/ironman", "@type": "http://xmlns.com/foaf/0.1/Person", "http://xmlns.com/foaf/0.1/name": "Malik Coates" }, { "@id": "https://w3id.org/people/bsletten", "http://xmlns.com/foaf/0.1/knows": [ { "@id": "_:b0" }, { "@id": "_:b1" }, { "@id": "http://example.com/id/ironman" } ], "http://xmlns.com/foaf/0.1/name": "Brian Sletten" }] } 52/71
  • 55. JSON-LD Tools JavaScript : https://github.com/digitalbazaar/jsonld.js Python PHP Ruby : https://github.com/ruby-rdf/json-ld/ Java : https://github.com/jsonld-java/jsonld-java C# : https://github.com/NuGet/json-ld.net · · https://github.com/digitalbazaar/pyld https://github.com/RDFLib/rdflib-jsonld · · · https://github.com/digitalbazaar/php-json-ld https://github.com/lanthaler/JsonLD · · · · · 55/71
  • 56. JSON-LD (Javascript) var jsonld = require('jsonld'); var doc = { "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.pn }; var context = { "name": "http://schema.org/name", "homepage": {"@id": "http://schema.org/url", "@type": "@id"}, "image": {"@id": "http://schema.org/image", "@type": "@id"} }; // compact a document according to a particular context jsonld.compact(doc, context, function(err, compacted) { console.log(JSON.stringify(compacted, null, 2)); }); 56/71
  • 57. JSON-LD (Java) // Open a valid json(-ld) input file InputStream inputStream = new FileInputStream("input.json"); // Read the file into an Object (The type of this object will be a List, Ma // Number or null depending on the root object in the file). Object jsonObject = JsonUtils.fromInputStream(inputStream); // Create a context JSON map containing prefixes and definitions Map context = new HashMap(); // Customise context... // Create an instance of JsonLdOptions with the standard JSON- LD options JsonLdOptions options = new JsonLdOptions(); // Customise options... // Call whichever JSONLD function you want! (e.g. compact) Object compact = JsonLdProcessor.compact(jsonObject, context, options); // Print out the result (or don't, it's your call!) System.out.println(JsonUtils.toPrettyString(compact)); 57/71
  • 59. Wrapping Existing APIs // RFC 6570 URI Templates def url = "https://maps.googleapis.com/maps/api/geocode/json? latlng=${lat},${lon}&key=${googleConfig.geocode.apikey}" 59/71
  • 60. Embedded JSON-LD <html> <body> <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "EventReservation", "reservationNumber": "IO12345", "underName": { "@type": "Person", "name": "John Smith" }, ... </script> ... </html> 60/71
  • 61. 61/71
  • 62. RSVPAction <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "Event", "name": "John's Birthday Party", ... information about the event ... "action": { "@type": "RsvpAction", "actionHandler": { "@type": "HttpActionHandler", "url": "https://events-organizer.com/rsvp?eventId=123", "method": "POST", "requiredProperty": "rsvpStatus", } } } </script> 62/71
  • 63. Responding... POST /rsvp?eventId=123 HTTP/1.1 Host: events-organizer.com Authorization: Bearer AbCdEf123456 Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/1.0 (KHTML, like Gecko; Gmail Actions) rsvpStatus=YES 63/71
  • 64. 64/71
  • 65. <script type="application/ld+json"> [{ "@context" : "http://schema.org", "@type" : "MusicEvent", "name" : "Phish", "startDate" : "2015-09-04T19:30", "location" : { "@type" : "Place", "name" : "Dick's Sporting Goods Park", "address" : "6000 Victory Way, Commerce City, CO, USA" }, "offers" : { "@type" : "Offer", "url" : "http://www.altitudetickets.com/event/phish-sep-4- 3671/" } }, ... ] </script> 65/71
  • 66. 66/71
  • 67. 67/71
  • 68. 68/71
  • 69. { "@context": "https://w3id.org/identity/v1", "id": "https://example.com/identities/bob", "type": ["Identity", "Person"], "name": "Bob Bobman", "governmentId": "123-45-6789", "birthdate": "1985-12-14", "email": "bbob@example.com", "mobileNumber": "12345678910", "shippingAddress": { "street": "372 Sumter Lane", "city": "Blackrock", "region": "Nevada", "postalCode": "237842" }, ... } 69/71
  • 70. ... "credential": [{ "id": "http://ssa.us.gov/credentials/3732", "type": "PassportCredential", "claim": { "id": "https://example.com/identities/bob", "name": "Bob Bobman", "birthdate": "1985-12-14", "governmentId": "123-45-6789" }, "expires": "2018-01-01", "signature": { "type": "GraphSignature2012", "creator": "https://ssa.us.gov/keys/27", "signature": "3780eyfh3q0fhhfiq3q9f8ahsidfhf29rhaish" } }, ... ] } 70/71
  • 71. Questions? " brian@bosatsu.net ! @bsletten + http://tinyurl.com/bjs-gplus $ bsletten