by @_pieroit_
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
RDF : Linked Data = HTML : Hypertext
S P O
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
... even computer grandma!
Solid project
(on nodejs)
"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")
}
"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
}
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" }
}
"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
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/..."
}
W3C community group