+++
+++
SELECT ?author
WHERE {
?author <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/Writer> .
} LIMIT 1000
+++
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT ?author
WHERE {
?author rdf:type dbo:Writer .
} LIMIT 1000
+++
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT ?author ?work
WHERE {
?author rdf:type dbo:Writer .
?author dbo:notableWork ?work
} LIMIT 1000
+++
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT ?author ?work
WHERE {
?author rdf:type dbo:Writer .
OPTIONAL {?author dbo:notableWork ?work}
} LIMIT 1000
+++
Esercizio: estrarre da DBpedia tutte le triple che riguardano Palermo
+++
SELECT ?predicato ?oggetto
WHERE {
<http://dbpedia.org/resource/Palermo> ?predicato ?oggetto .
}
+++
Ci sono tutte?
+++
SELECT ?soggetto ?predicato
WHERE {
?soggetto ?predicato <http://dbpedia.org/resource/Palermo> .
}
+++
Esercizio: Tutte le chiese con Architettura gotica a Palermo
+++
SELECT ?chiesa
WHERE {
?chiesa dbp:architectureStyle dbr:Gothic_architecture .
?chiesa dct:subject dbc:Churches_in_Palermo
}
+++
Trova la differenza
+++
SELECT ?label
WHERE {
?chiesa dbp:architectureStyle dbr:Gothic_architecture .
?chiesa dct:subject dbc:Churches_in_Palermo .
?chiesa rdfs:label ?label
}
+++
e la descrizione?
+++
SELECT ?chiesa ?abstract
WHERE {
?chiesa dbp:architectureStyle dbr:Gothic_architecture .
?chiesa dct:subject dbc:Churches_in_Palermo .
?chiesa dbo:abstract ?abstract
}
+++
SELECT ?chiesa ?abstract
WHERE {
?chiesa dbp:architectureStyle dbr:Gothic_architecture .
?chiesa dct:subject dbc:Churches_in_Palermo .
?chiesa dbo:abstract ?abstract .
FILTER (langMatches(lang(?abstract), "RU")) .
}
+++
http://linkedgeodata.org/sparql
+++
Prefix lgdo: <http://linkedgeodata.org/ontology/>
Prefix geom: <http://geovocab.org/geometry#>
Prefix ogc: <http://www.opengis.net/ont/geosparql#>
Prefix owl: <http://www.w3.org/2002/07/owl#>
Select * {
?s
owl:sameAs <http://dbpedia.org/resource/Palermo> ;
geom:geometry [
ogc:asWKT ?sg
] .
?x
a lgdo:Hospital ;
rdfs:label ?l ;
geom:geometry [
ogc:asWKT ?xg
] .
Filter(bif:st_intersects (?sg, ?xg, 10)) .
}
+++
Prefix lgdo:<http://linkedgeodata.org/ontology/>
Prefix geom:<http://geovocab.org/geometry#>
Prefix ogc: <http://www.opengis.net/ont/geosparql#>
SELECT * WHERE {
?p a lgdo:Helipad ; geom:geometry/ogc:asWKT ?pgv .
?h a lgdo:Hospital; geom:geometry/ogc:asWKT ?hgv .
Filter(bif:st_intersects(?pgv, ?hgv, 0.5))
}
LIMIT 10
+++
http://datiopen.istat.it/sparqlIstat.php
+++
lasciamo perdere....
+++
aspetta un attimo...
+++
http://datiopen.istat.it/sparql/oracle?query=<QUERY>&format=<FORMATO>
+++
select * where { ?s ?p ?o } limit 10
https://meyerweb.com/eric/tools/dencoder/
select%20*%20where%20%7B%20%3Fs%20%3Fp%20%3Fo%20%7D%20limit%2010
+++
+++
PREFIX ORACLE_SEM_FS_NS: <http://oracle.com/semtech#timeout=600,allow_dup=t,strict_default=f>
PREFIX+ORACLE_SEM_FS_NS%3A+%3Chttp%3A%2F%2Foracle.com%2Fsemtech%23timeout%3D600%2Callow_dup%3Dt%2Cstrict_default%3Df%3E%20
+++
+++
Comuni più alti d'Italia
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ter: <http://datiopen.istat.it/odi/ontologia/territorio/>
PREFIX cen: <http://datiopen.istat.it/odi/ontologia/censimento/>
PREFIX qb: <http://purl.org/linked-data/cube#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?Comune ?Codice_Istat_Comune ?Provincia (replace(str(?Alt),"<http://www.w3.org/2001/XMLSchema#decimal>", "") as ?Altitudine)
WHERE {
?com rdf:type ter:EntitaTerritoriale .
?com ter:haNome ?Comune .
?com ter:haCodIstat ?Codice_Istat_Comune .
?com ter:haAltitudineMaxCOM ?Alt .
?com ter:provincia_di_COM ?prov .
?prov ter:haNome ?Provincia .
FILTER (?Alt > 4000)
} ORDER BY DESC (?Alt)
+++
+++
Elenco località della provincia di Palermo con numero di stranieri di origine asiatica
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ter: <http://datiopen.istat.it/odi/ontologia/territorio/>
PREFIX cen: <http://datiopen.istat.it/odi/ontologia/censimento/>
PREFIX qb: <http://purl.org/linked-data/cube#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?Localita (replace(str(?Stranieri),"<http://www.w3.org/2001/XMLSchema#decimal>", "") as ?Stranieri_origine_Asiatica)
WHERE {
?loc rdf:type ter:LOC .
?loc ter:haNome ?Localita .
?loc ter:provincia_di_LOC ?prov .
?loc ter:haIndicatoreCensimento ?o .
?o cen:provieneDa cen:Asia .
?o cen:haStranieriApolidiResidentiItalia ?Stranieri.
FILTER(?prov = <http://datiopen.istat.it/odi/risorsa/territorio/province/Palermo>)
} ORDER BY DESC (?Stranieri)
+++
+++
+++
SELECT ?leg WHERE {
?leg a ocd:legislatura
}
+++
SELECT ?leg WHERE {
?votazione a ocd:votazione .
?votazione ocd:rif_leg ?leg
}
+++
SELECT distinct ?leg WHERE {
?votazione a ocd:votazione .
?votazione ocd:rif_leg ?leg
}
+++
SELECT distinct * WHERE {
?votazione a ocd:votazione;
dc:date ?data;
dc:title ?denominazione;
dc:description ?descrizione;
ocd:votanti ?votanti;
ocd:rif_leg <http://dati.camera.it/ocd/legislatura.rdf/repubblica_17>
}
ORDER BY DESC(?data)
+++
Chiedere a uno SPARQL Endpoint quali RDF Graphs sono disponibili
+++
SELECT DISTINCT ?g
WHERE {
GRAPH ?g { ?s ?p ?o . }
}
+++
+++ =IMPORTDATA("http://factforge.net/repositories/ff-news?query=%23+F4%3A+Top-lev el+industries+by+number+of+companies%0A%23+-+benefits+from+the+mapping+a nd+consolidation+of+industry+classifications%0A%23+++and+predicates+in+DBPedi a+done+in+the+FactForge%0A%23+-+benefits+from+reasoning+-+transitive+and+s ymmetric+properties+across%0A%23+++the+industry+classification+taxonomy+of+ FactForge%0A%0APREFIX+dbo%3A+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology% 2F%3E%0APREFIX+ff-map%3A+%3Chttp%3A%2F%2Ffactforge.net%2Fff2016-mappin g%2F%3E%0A%0ASELECT+DISTINCT+%3Ftop_industry+(COUNT(*)+AS+%3Fcount) %0A%7B%0A+++%3Fcompany+dbo%3Aindustry+%3Findustry+.%0A+++%3Findust ry+%5Eff-map%3AindustryVariant+%2F+ff-map%3AindustryCenter+%3Ftop_industry +.%0A%7D%0AGROUP+BY+%3Ftop_industry+ORDER+BY+DESC(%3Fcount)+")
+++
+++
curl -H Accept:text/tab-separated-values "http://factforge.net/repositories/ff-news?infer=true&sameAs=false&query=PREFIX+dbo%3A+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2F%3E%0ASELECT+%3Findustry+%7B%24company+dbo%3Aindustry+%3Findustry%7D%0A&$company=<http://dbpedia.org/resource/Google>"
+++
Spraklis
http://www.irisa.fr/LIS/ferre/sparklis/
+++
NLquery http://nlquery.ayoungprogrammer.com/
Hokudai http://wnews.ist.hokudai.ac.jp/wc3?search=Songs+written+by+Paul+McCartney