What are Linked Data?

by @_pieroit_

"why should I care about a globally distributed hypertext when the whole encyclopedia sits in a CD?"

"... WikiPedia"

2006 proposal for a M2M web

1. Use URIs as names for things

 

2. Use HTTP URIs so that people can look up those names

 

3. When someone looks up a URI, provide useful information, using the standards (RDF*, SPARQL)

 

4. Include links to other URIs so that they can discover more things

Resource Description Framework

RDF : Linked Data = HTML : Hypertext

S         P         O

Resource Description Framework

RDF : Linked Data = HTML : Hypertext

# subject                    # predicate                                       # object

<http://example.com/grandma> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> .
<http://example.com/grandma> <http://schema.org/relatedTo>                     <http://example.com/me> .
<http://example.com/grandma> <https://schema.org/birthDate>                    "1934" .
<http://cookingsite.net/pie> <http://schema.org/author>                        <http://example.com/grandma> .
<http://cookingsite.net/pie> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Recipe> .
<http://cookingsite.net/pie> <http://schema.org/recipeIngredient>              <http://foodnoprofit.info/apple> .
<http://example.com/me>      <http://schema.org/owns>                          <http://foodnoprofit.info/apple> .
<http://example.com/me>      <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> .

S         P         O

"why should I care about a globally distributed database when all my data can sit in my server/cluster?"

"... Wikidata"
(and the Linked Data Cloud)

Open standard

no royalties!

Decentralization

anybody can publish and link data

... even computer grandma!

Interoperability

public agreement on a data format

cross-domain queries!

Self descriptive

data and metadata

are expressed in the same way

No data silos

data and application

are two different things

Solid project

(on nodejs)

Onthologies

agreement on objects and relations

Amazing open data!

 

Queries

"Give me world recipes containing Black Pepper and Eggs"

PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?s, ?l WHERE {
    ?s a dbo:Food .
    ?s dbo:ingredient <http://dbpedia.org/resource/Black_pepper> .
    ?s dbo:ingredient <http://dbpedia.org/resource/Egg_(food)> .
    ?s rdfs:label ?l .

    FILTER (lang(?l) = "en")
}

Queries

"Give me movies based on books written by science fiction writers"

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?p ?w ?m WHERE {
    ?m  wdt:P31    wd:Q11424 .     # ?m is a Movie
    ?m  wdt:P144   ?w .            # ?m is based on ?w
    ?w  wdt:P50    ?p .            # ?w written by ?p
    ?p  wdt:P106   wd:Q18844224 .  # ?p is a science fiction writer
}

Queries

"List hungarian and russian porn actresses,

with hair color and photo"

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT
?x ?xLabel ?nationalityLabel ?haircolorLabel ?img
WHERE {
  ?x wdt:P106 wd:Q488111 .
  ?x wdt:P27 ?nationality .
  ?x wdt:P1884 ?haircolor .
  ?x wdt:P18 ?img .
  
  FILTER( ?nationality IN (wd:Q159, wd:Q28) )
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}

Queries

"Voti alla Camera del 19/10/2017: Disposizioni concernenti la coltivazione e la somministrazione della cannabis a uso medico."

SELECT DISTINCT
?votazione ?descrizione ?numeroVotazione
?nome ?cognome ?espressione ?infoAssenza ?deputato

WHERE {

## Votazioni del 19 Ottobre 2017
?votazione a ocd:votazione;
   dc:date '20171019';
   dc:description ?descrizione;
   dc:identifier ?numeroVotazione.

## voti espressi
?voto a ocd:voto;
   ocd:rif_votazione ?votazione;
   dc:type ?espressione;
   ocd:rif_deputato ?deputato.
OPTIONAL{?voto dc:description ?infoAssenza}

## info deputato
?deputato foaf:surname ?cognome;
   foaf:firstName ?nome.  

}
ORDER BY ?cognome

So, how do we query the web?

So, how do we query the web?

Problems

  • ivory towers

  • immature stack

  • no killer app (SEO?)

  • what about REST APIs?

SEO

JSON-LD

official W3C recommendation

{
  "@context" : "http://schema.org/",
  "@type"    : "Person",
  "name"     : "Fraccarso da Velletri",
  "jobTitle" : "Professor",
  "telephone": "(425) 123-4567",
  "url"      : "http://frac-da-velletri.org",
  "knows"    : "http://..........",
  "sameAs"   : "http://wikidata/entity/..."
}

RDF-JS

W3C community group

use one representation

for linked data

across all JS applications

Thanks

Made with Slides.com