SlideShare uma empresa Scribd logo
1 de 67
Baixar para ler offline
Creating Web APIs
with JSON-LD and RDF
About Me
Donald Smith
Sr. Software Engineer at Argo
Creating Web APIs
with JSON-LD and RDF
Why RESTful isn’t
enough…
Media Types
Atom

JSON

Collection+JSON

HAL

SIREN
Or…
Whatever I want!
These media types
are OK, but…
They don’t describe
my data
What is data?
Nothing without
applied meaning
Out of band
knowledge required
We want Information
not data
But JSON has won on
the web!
But, it’s not good
enough
A programmer adds
meaning to data
What if a machine could
understand information
instead?
RDF
What is RDF?
Resource Description
Framework
RDF is a standard model
for data interchange on
the Web
What does it do?
• Data merging even if underlying schemas differ
• Supports the evolution of schemas over time
without requiring consumers to change
• Eliminates data silos between your applications
• Allows you to ask questions of your data in a
standard way
The Basics
The Triple
Think of a sentence
written by a first grader
Donald owns a dog.

His name is Barley.
Yes, I like beer
a lot
Triple Composition
• Made up of three parts (hence Triple)
• The Subject
• The Predicate
• The Object
Sentence To Triple
Donald owns a dog.
subject predicate object
<Donald> <owns> <Barley>
subject predicate object
Um, this doesn’t look
better than JSON
Universal Uniqueness
• Triples use IRIs to uniquely identify Things in the Universe.
• IRIs allow us to use terms that are specific and universal
• IRIs are URIs, but internationalized
Expressed as a graph
Donald Barley
subject predicate object
owns
As JSON
{
"id": "people/Donald",
"type": "Person",
"name": "Donald",
"owns": {
"id": "animal/Barley",
"type": "Dog",
"name": "Barley"
}
}
As RDF
<http://example.com/people/Donald> <http://www.w3.org/
1999/02/22-rdf-syntax-ns#type> <http://schema.org/
Person> .

<http://example.com/people/Donald> <http://schema.org/
givenName> "Donald"^^xsd:string .

<http://example.com/people/Donald> <http://schema.org/
owns> <http://example.com/animals/Rover> .

<http://example.com/animals/Barley> <http://www.w3.org/
1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/
ontology/Dog> .

<http://example.com/animals/Barley> <http://schema.org/
givenName> "Barley"^^xsd:string .
Whoa, I thought you said
it was better than JSON?
That’s unreadable!
It even repeats itself!
GTFO!
Ok, ok. You’re right.
RDF was created for
machines. Not humans.
There is a solution.
Turtle!
Example in Turtle
@base <http://example.com/> .

@prefix schema: <http://schema.org/> .

@prefix db: <http://dbpedia.org/ontology/> .

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .



<people/Donald> a schema:Person ;

schema:givenName "Donald"^^xsd:string ;

schema:owns <animals/Barley> .



<animals/Barley> a db:Dog ;

schema:givenName "Barley"^^xsd:string .
Cool stuff?
• RDF is just a way of making statements about
Things.
• There is no order in RDF unlike JSON objects.
• To assert information about a given subject, you
don’t have to know where in the hierarchy that it
exists. We just use the subjects IRI.
RDF allows us to say
anything about any Thing
in the Universe.
Whatever man, this stuff
looks confusing and
stupid. I’ll stick to JSON.
That’s ok. That’s cool.
Some smart guys thought
you’d say that.
JSON-LD
• The goal was to require as little effort as possible
from developers
• There are a ton of web APIs out there. Changing to
a new format would break a lot of stuff
• JSON-LD lets us add semantic meaning without
breaking.
JSON-LD Context
{
"@context": {
"id": "@id",
"type": "@type",
"@base": "http://example.com/",
"Dog": "http://dbpedia.org/ontology/Dog",
"Person": "http://schema.org/Person",
"name": "http://schema.org/givenName",
"owns": "http://schema.org/owns"
},
"id": "people/Donald",
"type": "Person",
"name": "Donald",
"owns": {
"id": "animal/Barley",
"type": "Dog",
"name": "Barley"
}
}
The JSON object is
preserved. Existing
applications won’t break.
Let’s take a look…
Questions?
Media Types
• JSON-LD: application/ld+json
• Turtle: text/turtle
• N-Triples: application/n-triples
• N-Quads: application/n-quads
• RDF/XML: application/rdf+xml (Don’t use this one)
No need for another media
type
• The media type isn’t that relevant anymore
• Any schema or data model can be described with
RDF.
• Think of it as a language that everyone speaks.
JSON Web APIs
• Existing Web APIs can leverage JSON-LD to
promote data exchange between Applications
• Existing Web APIs that don’t or won’t support
JSON-LD is ok too. You can inject an @context into
a JSON fragment using out-of-band knowledge
and still use it as RDF
• JSON-LD supports both expansion and
compaction
JSON-LD Expansion &
Compaction
Merging data sources
My website Mike’s website
{
"@context": {
"id": "@id",
"type": "@type",
"@base": "http://donald.com/",
"Dog": "http://dbpedia.org/ontology/Dog",
"Person": "http://schema.org/Person",
"name": "http://schema.org/givenName",
"owns": "http://schema.org/owns"
},
"id": "people/Donald",
"type": "Person",
"name": "Donald",
"owns": {
"id": "animal/Barley",
"type": "Dog",
"name": "Barley"
}
}
{
"@context": {
"identifier": "@id",
"objectType": "@type",
"@base": "http://mike.com/",
"canine": "http://dbpedia.org/ontology/Dog",
"human": "http://schema.org/Person",
"called": "http://schema.org/givenName",
"ownerOf": "http://schema.org/owns"
},
"identifier": "me",
"objectType": "human",
"called": "Mike",
"ownerOf": {
"identifier": "canine/Bob",
"objectType": "canine",
"called": "Bob"
}
}
Expansion
• Each one is sent through the expansion algorithm
to output RDF
<http://mike.com/canine/Bob> <http://schema.org/givenName> "Bob" .
<http://mike.com/canine/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/Dog> .
<http://mike.com/me> <http://schema.org/givenName> "Mike" .
<http://mike.com/me> <http://schema.org/owns> <http://mike.com/canine/Bob> .
<http://mike.com/me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> .
<http://donald.com/animal/Barley> <http://schema.org/givenName> "Barley" .
<http://donald.com/animal/Barley> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/Dog> .
<http://donald.com/people/Donald> <http://schema.org/givenName> "Donald" .
<http://donald.com/people/Donald> <http://schema.org/owns> <http://donald.com/animal/Barley> .
<http://donald.com/people/Donald> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> .
My website
Mike’s website
Merge the triples into a
Single Graph
<http://donald.com/animal/Barley> <http://schema.org/givenName> "Barley" .
<http://donald.com/animal/Barley> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/Dog> .
<http://donald.com/people/Donald> <http://schema.org/givenName> "Donald" .
<http://donald.com/people/Donald> <http://schema.org/owns> <http://donald.com/animal/Barley> .
<http://donald.com/people/Donald> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> .
<http://mike.com/canine/Bob> <http://schema.org/givenName> "Bob" .
<http://mike.com/canine/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/Dog> .
<http://mike.com/me> <http://schema.org/givenName> "Mike" .
<http://mike.com/me> <http://schema.org/owns> <http://mike.com/canine/Bob> .
<http://mike.com/me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> .
Compaction with different
Context
"@context": {
"id": "@id",
"type": "@type",
"doggy": "http://dbpedia.org/ontology/Dog",
"peeple": "http://schema.org/Person",
"namey": "http://schema.org/givenName",
"hazIt": "http://schema.org/owns"
}
{
"@context": {
"id": "@id",
"type": "@type",
"doggy": "http://dbpedia.org/ontology/Dog",
"peeple": "http://schema.org/Person",
"namey": "http://schema.org/givenName",
"hazIt": "http://schema.org/owns"
},
"@graph": [
{
"id": "http://donald.com/people/Donald",
"type": "peeple",
"namey": "Donald",
"hazIt": {
"id": "http://donald.com/animal/Barley"
}
},
{
"id": "http://mike.com/canine/Bob",
"type": "doggy",
"namey": "Bob"
},
{
"id": "http://mike.com/me",
"type": "peeple",
"namey": "Mike",
"hazIt": {
"id": "http://mike.com/canine/Bob"
}
},
{
"id": "http://donald.com/animal/Barley",
"type": "doggy",
"namey": "Barley"
}
]
}
Questions?
Web APIs
• So far we only have looked at resolving unlike
terms into uniform machine readable URIs
• How do we build an API with this stuff?
Hydra
No, not this one
Hydra
Hydra
• Currently a W3C draft specification
• Hydra is a lightweight vocabulary to create
hypermedia-driven Web APIs. By specifying a
number of concepts commonly used in Web APIs it
enables the creation of generic API clients.
Let’s take a look…
Thanks!

Mais conteúdo relacionado

Mais procurados

Introduction To RDF and RDFS
Introduction To RDF and RDFSIntroduction To RDF and RDFS
Introduction To RDF and RDFSNilesh Wagmare
 
CSHALS 2010 W3C Semanic Web Tutorial
CSHALS 2010 W3C Semanic Web TutorialCSHALS 2010 W3C Semanic Web Tutorial
CSHALS 2010 W3C Semanic Web TutorialLeeFeigenbaum
 
The Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQLThe Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQLMyungjin Lee
 
SHACL: Shaping the Big Ball of Data Mud
SHACL: Shaping the Big Ball of Data MudSHACL: Shaping the Big Ball of Data Mud
SHACL: Shaping the Big Ball of Data MudRichard Cyganiak
 
Microformats I: What & Why
Microformats I: What & WhyMicroformats I: What & Why
Microformats I: What & WhyRachael L Moore
 
Two graph data models : RDF and Property Graphs
Two graph data models : RDF and Property GraphsTwo graph data models : RDF and Property Graphs
Two graph data models : RDF and Property Graphsandyseaborne
 
SPARQL in the Semantic Web
SPARQL in the Semantic WebSPARQL in the Semantic Web
SPARQL in the Semantic WebJan Beeck
 
Validating RDF data: Challenges and perspectives
Validating RDF data: Challenges and perspectivesValidating RDF data: Challenges and perspectives
Validating RDF data: Challenges and perspectivesJose Emilio Labra Gayo
 
Publishing and Using Linked Open Data - Day 2
Publishing and Using Linked Open Data - Day 2Publishing and Using Linked Open Data - Day 2
Publishing and Using Linked Open Data - Day 2Richard Urban
 
Build Your Own World Class Directory Search From Alpha to Omega
Build Your Own World Class Directory Search From Alpha to OmegaBuild Your Own World Class Directory Search From Alpha to Omega
Build Your Own World Class Directory Search From Alpha to OmegaRavi Mynampaty
 
semantic markup using schema.org
semantic markup using schema.orgsemantic markup using schema.org
semantic markup using schema.orgJoshua Shinavier
 
Resource description framework
Resource description frameworkResource description framework
Resource description frameworkhozifa1010
 

Mais procurados (18)

Introduction to SPARQL
Introduction to SPARQLIntroduction to SPARQL
Introduction to SPARQL
 
Introduction To RDF and RDFS
Introduction To RDF and RDFSIntroduction To RDF and RDFS
Introduction To RDF and RDFS
 
CSHALS 2010 W3C Semanic Web Tutorial
CSHALS 2010 W3C Semanic Web TutorialCSHALS 2010 W3C Semanic Web Tutorial
CSHALS 2010 W3C Semanic Web Tutorial
 
The Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQLThe Semantic Web #10 - SPARQL
The Semantic Web #10 - SPARQL
 
SHACL: Shaping the Big Ball of Data Mud
SHACL: Shaping the Big Ball of Data MudSHACL: Shaping the Big Ball of Data Mud
SHACL: Shaping the Big Ball of Data Mud
 
Microformats I: What & Why
Microformats I: What & WhyMicroformats I: What & Why
Microformats I: What & Why
 
Two graph data models : RDF and Property Graphs
Two graph data models : RDF and Property GraphsTwo graph data models : RDF and Property Graphs
Two graph data models : RDF and Property Graphs
 
SHACL Overview
SHACL OverviewSHACL Overview
SHACL Overview
 
ShEx by Example
ShEx by ExampleShEx by Example
ShEx by Example
 
RDF validation tutorial
RDF validation tutorialRDF validation tutorial
RDF validation tutorial
 
SPARQL in the Semantic Web
SPARQL in the Semantic WebSPARQL in the Semantic Web
SPARQL in the Semantic Web
 
RDF and OWL
RDF and OWLRDF and OWL
RDF and OWL
 
Validating RDF data: Challenges and perspectives
Validating RDF data: Challenges and perspectivesValidating RDF data: Challenges and perspectives
Validating RDF data: Challenges and perspectives
 
Publishing and Using Linked Open Data - Day 2
Publishing and Using Linked Open Data - Day 2Publishing and Using Linked Open Data - Day 2
Publishing and Using Linked Open Data - Day 2
 
SHACL by example
SHACL by exampleSHACL by example
SHACL by example
 
Build Your Own World Class Directory Search From Alpha to Omega
Build Your Own World Class Directory Search From Alpha to OmegaBuild Your Own World Class Directory Search From Alpha to Omega
Build Your Own World Class Directory Search From Alpha to Omega
 
semantic markup using schema.org
semantic markup using schema.orgsemantic markup using schema.org
semantic markup using schema.org
 
Resource description framework
Resource description frameworkResource description framework
Resource description framework
 

Semelhante a Creating Web APIs with JSON-LD and RDF

Debunking some “RDF vs. Property Graph” Alternative Facts
Debunking some “RDF vs. Property Graph” Alternative FactsDebunking some “RDF vs. Property Graph” Alternative Facts
Debunking some “RDF vs. Property Graph” Alternative FactsNeo4j
 
An introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked DataAn introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked DataGabriela Agustini
 
W3C Tutorial on Semantic Web and Linked Data at WWW 2013
W3C Tutorial on Semantic Web and Linked Data at WWW 2013W3C Tutorial on Semantic Web and Linked Data at WWW 2013
W3C Tutorial on Semantic Web and Linked Data at WWW 2013Fabien Gandon
 
Graph databases & data integration v2
Graph databases & data integration v2Graph databases & data integration v2
Graph databases & data integration v2Dimitris Kontokostas
 
Lecture linked data cloud & sparql
Lecture linked data cloud & sparqlLecture linked data cloud & sparql
Lecture linked data cloud & sparqlDhavalkumar Thakker
 
Introduction to Linked Data
Introduction to Linked DataIntroduction to Linked Data
Introduction to Linked DataJuan Sequeda
 
SemWeb Fundamentals - Info Linking & Layering in Practice
SemWeb Fundamentals - Info Linking & Layering in PracticeSemWeb Fundamentals - Info Linking & Layering in Practice
SemWeb Fundamentals - Info Linking & Layering in PracticeDan Brickley
 
Making the semantic web work
Making the semantic web workMaking the semantic web work
Making the semantic web workPaul Houle
 
Do it on your own - From 3 to 5 Star Linked Open Data with RMLio
Do it on your own - From 3 to 5 Star Linked Open Data with RMLioDo it on your own - From 3 to 5 Star Linked Open Data with RMLio
Do it on your own - From 3 to 5 Star Linked Open Data with RMLioOpen Knowledge Belgium
 
Publishing data on the Semantic Web
Publishing data on the Semantic WebPublishing data on the Semantic Web
Publishing data on the Semantic WebPeter Mika
 
Radically Open Cultural Heritage Data on the Web
Radically Open Cultural Heritage Data on the WebRadically Open Cultural Heritage Data on the Web
Radically Open Cultural Heritage Data on the WebJulie Allinson
 
Semantic Web: introduction & overview
Semantic Web: introduction & overviewSemantic Web: introduction & overview
Semantic Web: introduction & overviewAmit Sheth
 
Exploring the Semantic Web
Exploring the Semantic WebExploring the Semantic Web
Exploring the Semantic WebRoberto García
 
Transforming Your Data with GraphDB: GraphDB Fundamentals, Jan 2018
Transforming Your Data with GraphDB: GraphDB Fundamentals, Jan 2018Transforming Your Data with GraphDB: GraphDB Fundamentals, Jan 2018
Transforming Your Data with GraphDB: GraphDB Fundamentals, Jan 2018Ontotext
 
RDFa: introduction, comparison with microdata and microformats and how to use it
RDFa: introduction, comparison with microdata and microformats and how to use itRDFa: introduction, comparison with microdata and microformats and how to use it
RDFa: introduction, comparison with microdata and microformats and how to use itJose Luis Lopez Pino
 
Consuming Linked Data SemTech2010
Consuming Linked Data SemTech2010Consuming Linked Data SemTech2010
Consuming Linked Data SemTech2010Juan Sequeda
 

Semelhante a Creating Web APIs with JSON-LD and RDF (20)

SWT Lecture Session 2 - RDF
SWT Lecture Session 2 - RDFSWT Lecture Session 2 - RDF
SWT Lecture Session 2 - RDF
 
Debunking some “RDF vs. Property Graph” Alternative Facts
Debunking some “RDF vs. Property Graph” Alternative FactsDebunking some “RDF vs. Property Graph” Alternative Facts
Debunking some “RDF vs. Property Graph” Alternative Facts
 
An introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked DataAn introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked Data
 
W3C Tutorial on Semantic Web and Linked Data at WWW 2013
W3C Tutorial on Semantic Web and Linked Data at WWW 2013W3C Tutorial on Semantic Web and Linked Data at WWW 2013
W3C Tutorial on Semantic Web and Linked Data at WWW 2013
 
Graph databases & data integration v2
Graph databases & data integration v2Graph databases & data integration v2
Graph databases & data integration v2
 
Danbri Drupalcon Export
Danbri Drupalcon ExportDanbri Drupalcon Export
Danbri Drupalcon Export
 
Analysis on semantic web layer cake entities
Analysis on semantic web layer cake entitiesAnalysis on semantic web layer cake entities
Analysis on semantic web layer cake entities
 
Introduction to RDF Data Model
Introduction to RDF Data ModelIntroduction to RDF Data Model
Introduction to RDF Data Model
 
Lecture linked data cloud & sparql
Lecture linked data cloud & sparqlLecture linked data cloud & sparql
Lecture linked data cloud & sparql
 
Introduction to Linked Data
Introduction to Linked DataIntroduction to Linked Data
Introduction to Linked Data
 
SemWeb Fundamentals - Info Linking & Layering in Practice
SemWeb Fundamentals - Info Linking & Layering in PracticeSemWeb Fundamentals - Info Linking & Layering in Practice
SemWeb Fundamentals - Info Linking & Layering in Practice
 
Making the semantic web work
Making the semantic web workMaking the semantic web work
Making the semantic web work
 
Do it on your own - From 3 to 5 Star Linked Open Data with RMLio
Do it on your own - From 3 to 5 Star Linked Open Data with RMLioDo it on your own - From 3 to 5 Star Linked Open Data with RMLio
Do it on your own - From 3 to 5 Star Linked Open Data with RMLio
 
Publishing data on the Semantic Web
Publishing data on the Semantic WebPublishing data on the Semantic Web
Publishing data on the Semantic Web
 
Radically Open Cultural Heritage Data on the Web
Radically Open Cultural Heritage Data on the WebRadically Open Cultural Heritage Data on the Web
Radically Open Cultural Heritage Data on the Web
 
Semantic Web: introduction & overview
Semantic Web: introduction & overviewSemantic Web: introduction & overview
Semantic Web: introduction & overview
 
Exploring the Semantic Web
Exploring the Semantic WebExploring the Semantic Web
Exploring the Semantic Web
 
Transforming Your Data with GraphDB: GraphDB Fundamentals, Jan 2018
Transforming Your Data with GraphDB: GraphDB Fundamentals, Jan 2018Transforming Your Data with GraphDB: GraphDB Fundamentals, Jan 2018
Transforming Your Data with GraphDB: GraphDB Fundamentals, Jan 2018
 
RDFa: introduction, comparison with microdata and microformats and how to use it
RDFa: introduction, comparison with microdata and microformats and how to use itRDFa: introduction, comparison with microdata and microformats and how to use it
RDFa: introduction, comparison with microdata and microformats and how to use it
 
Consuming Linked Data SemTech2010
Consuming Linked Data SemTech2010Consuming Linked Data SemTech2010
Consuming Linked Data SemTech2010
 

Último

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 

Último (20)

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 

Creating Web APIs with JSON-LD and RDF

  • 1. Creating Web APIs with JSON-LD and RDF
  • 2. About Me Donald Smith Sr. Software Engineer at Argo
  • 3. Creating Web APIs with JSON-LD and RDF
  • 9.
  • 13. But JSON has won on the web!
  • 14. But, it’s not good enough
  • 16. What if a machine could understand information instead?
  • 17. RDF
  • 20. RDF is a standard model for data interchange on the Web
  • 21. What does it do? • Data merging even if underlying schemas differ • Supports the evolution of schemas over time without requiring consumers to change • Eliminates data silos between your applications • Allows you to ask questions of your data in a standard way
  • 24. Think of a sentence written by a first grader
  • 25. Donald owns a dog.
 His name is Barley.
  • 26. Yes, I like beer
  • 27. a lot
  • 28. Triple Composition • Made up of three parts (hence Triple) • The Subject • The Predicate • The Object
  • 29. Sentence To Triple Donald owns a dog. subject predicate object
  • 31. Um, this doesn’t look better than JSON
  • 32. Universal Uniqueness • Triples use IRIs to uniquely identify Things in the Universe. • IRIs allow us to use terms that are specific and universal • IRIs are URIs, but internationalized
  • 33. Expressed as a graph Donald Barley subject predicate object owns
  • 34. As JSON { "id": "people/Donald", "type": "Person", "name": "Donald", "owns": { "id": "animal/Barley", "type": "Dog", "name": "Barley" } }
  • 35. As RDF <http://example.com/people/Donald> <http://www.w3.org/ 1999/02/22-rdf-syntax-ns#type> <http://schema.org/ Person> .
 <http://example.com/people/Donald> <http://schema.org/ givenName> "Donald"^^xsd:string .
 <http://example.com/people/Donald> <http://schema.org/ owns> <http://example.com/animals/Rover> .
 <http://example.com/animals/Barley> <http://www.w3.org/ 1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ ontology/Dog> .
 <http://example.com/animals/Barley> <http://schema.org/ givenName> "Barley"^^xsd:string .
  • 36. Whoa, I thought you said it was better than JSON? That’s unreadable!
  • 37. It even repeats itself!
  • 38. GTFO!
  • 40. RDF was created for machines. Not humans.
  • 41. There is a solution. Turtle!
  • 42. Example in Turtle @base <http://example.com/> .
 @prefix schema: <http://schema.org/> .
 @prefix db: <http://dbpedia.org/ontology/> .
 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
 
 <people/Donald> a schema:Person ;
 schema:givenName "Donald"^^xsd:string ;
 schema:owns <animals/Barley> .
 
 <animals/Barley> a db:Dog ;
 schema:givenName "Barley"^^xsd:string .
  • 43. Cool stuff? • RDF is just a way of making statements about Things. • There is no order in RDF unlike JSON objects. • To assert information about a given subject, you don’t have to know where in the hierarchy that it exists. We just use the subjects IRI.
  • 44. RDF allows us to say anything about any Thing in the Universe.
  • 45. Whatever man, this stuff looks confusing and stupid. I’ll stick to JSON.
  • 46. That’s ok. That’s cool. Some smart guys thought you’d say that.
  • 47. JSON-LD • The goal was to require as little effort as possible from developers • There are a ton of web APIs out there. Changing to a new format would break a lot of stuff • JSON-LD lets us add semantic meaning without breaking.
  • 48. JSON-LD Context { "@context": { "id": "@id", "type": "@type", "@base": "http://example.com/", "Dog": "http://dbpedia.org/ontology/Dog", "Person": "http://schema.org/Person", "name": "http://schema.org/givenName", "owns": "http://schema.org/owns" }, "id": "people/Donald", "type": "Person", "name": "Donald", "owns": { "id": "animal/Barley", "type": "Dog", "name": "Barley" } }
  • 49. The JSON object is preserved. Existing applications won’t break.
  • 50. Let’s take a look…
  • 52. Media Types • JSON-LD: application/ld+json • Turtle: text/turtle • N-Triples: application/n-triples • N-Quads: application/n-quads • RDF/XML: application/rdf+xml (Don’t use this one)
  • 53. No need for another media type • The media type isn’t that relevant anymore • Any schema or data model can be described with RDF. • Think of it as a language that everyone speaks.
  • 54. JSON Web APIs • Existing Web APIs can leverage JSON-LD to promote data exchange between Applications • Existing Web APIs that don’t or won’t support JSON-LD is ok too. You can inject an @context into a JSON fragment using out-of-band knowledge and still use it as RDF • JSON-LD supports both expansion and compaction
  • 56. Merging data sources My website Mike’s website { "@context": { "id": "@id", "type": "@type", "@base": "http://donald.com/", "Dog": "http://dbpedia.org/ontology/Dog", "Person": "http://schema.org/Person", "name": "http://schema.org/givenName", "owns": "http://schema.org/owns" }, "id": "people/Donald", "type": "Person", "name": "Donald", "owns": { "id": "animal/Barley", "type": "Dog", "name": "Barley" } } { "@context": { "identifier": "@id", "objectType": "@type", "@base": "http://mike.com/", "canine": "http://dbpedia.org/ontology/Dog", "human": "http://schema.org/Person", "called": "http://schema.org/givenName", "ownerOf": "http://schema.org/owns" }, "identifier": "me", "objectType": "human", "called": "Mike", "ownerOf": { "identifier": "canine/Bob", "objectType": "canine", "called": "Bob" } }
  • 57. Expansion • Each one is sent through the expansion algorithm to output RDF <http://mike.com/canine/Bob> <http://schema.org/givenName> "Bob" . <http://mike.com/canine/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/Dog> . <http://mike.com/me> <http://schema.org/givenName> "Mike" . <http://mike.com/me> <http://schema.org/owns> <http://mike.com/canine/Bob> . <http://mike.com/me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> . <http://donald.com/animal/Barley> <http://schema.org/givenName> "Barley" . <http://donald.com/animal/Barley> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/Dog> . <http://donald.com/people/Donald> <http://schema.org/givenName> "Donald" . <http://donald.com/people/Donald> <http://schema.org/owns> <http://donald.com/animal/Barley> . <http://donald.com/people/Donald> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> . My website Mike’s website
  • 58. Merge the triples into a Single Graph <http://donald.com/animal/Barley> <http://schema.org/givenName> "Barley" . <http://donald.com/animal/Barley> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/Dog> . <http://donald.com/people/Donald> <http://schema.org/givenName> "Donald" . <http://donald.com/people/Donald> <http://schema.org/owns> <http://donald.com/animal/Barley> . <http://donald.com/people/Donald> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> . <http://mike.com/canine/Bob> <http://schema.org/givenName> "Bob" . <http://mike.com/canine/Bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/Dog> . <http://mike.com/me> <http://schema.org/givenName> "Mike" . <http://mike.com/me> <http://schema.org/owns> <http://mike.com/canine/Bob> . <http://mike.com/me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> .
  • 59. Compaction with different Context "@context": { "id": "@id", "type": "@type", "doggy": "http://dbpedia.org/ontology/Dog", "peeple": "http://schema.org/Person", "namey": "http://schema.org/givenName", "hazIt": "http://schema.org/owns" }
  • 60. { "@context": { "id": "@id", "type": "@type", "doggy": "http://dbpedia.org/ontology/Dog", "peeple": "http://schema.org/Person", "namey": "http://schema.org/givenName", "hazIt": "http://schema.org/owns" }, "@graph": [ { "id": "http://donald.com/people/Donald", "type": "peeple", "namey": "Donald", "hazIt": { "id": "http://donald.com/animal/Barley" } }, { "id": "http://mike.com/canine/Bob", "type": "doggy", "namey": "Bob" }, { "id": "http://mike.com/me", "type": "peeple", "namey": "Mike", "hazIt": { "id": "http://mike.com/canine/Bob" } }, { "id": "http://donald.com/animal/Barley", "type": "doggy", "namey": "Barley" } ] }
  • 62. Web APIs • So far we only have looked at resolving unlike terms into uniform machine readable URIs • How do we build an API with this stuff?
  • 64. Hydra
  • 65. Hydra • Currently a W3C draft specification • Hydra is a lightweight vocabulary to create hypermedia-driven Web APIs. By specifying a number of concepts commonly used in Web APIs it enables the creation of generic API clients.
  • 66. Let’s take a look…