Co możemy ciekawego znaleźć w Linked Open Data? Jak te dane się ze sobą łączą? Kilkanaście przypadków użycia (zapytania SPARQL) łączących różne zbiory danych.
Część zapytań robiona była z wykorzystaniem Twinkle, część poprzez interfejsy SPARQL (endpoint). Natomiast najlepszym narzędziem okazało się YASGUI.
SELECT ?name ?area WHERE{ ?country factbook:countryname_conventionalshortform ?name . ?country factbook:area_total ?area . FILTER ( xsd:decimal(?area) < 100 ) } ORDER BY ?area
name | area |
---|---|
Holy See (Vatican City) | 0.44 |
Monaco | 1.95 |
Tokelau | 10 |
Cocos (Keeling) Islands | 14 |
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select distinct ?label ?type where { ?a a <http://dati.cdec.it/lod/shoah/NaziCamp>; rdfs:label ?label; rdf:type ?type. }
# | label | type |
---|---|---|
1 | Auschwitz | http://dati.cdec.it/lod/shoah/NaziCamp |
2 | Mauthausen | http://dati.cdec.it/lod/shoah/NaziCamp |
3 | Sachsenhausen | http://dati.cdec.it/lod/shoah/NaziCamp |
4 | Kaufering | http://dati.cdec.it/lod/shoah/NaziCamp |
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX gene: <http://linkedlifedata.com/resource/entrezgene/> PREFIX uniprot: <http://purl.uniprot.org/uniprot/core/> PREFIX core: <http://purl.uniprot.org/core/> SELECT ?genedescription ?taxonomy WHERE { ?geneid gene:description ?genedescription . ?geneid gene:uniprotAccession ?uniprotaccession . ?geneid gene:chromosome 'Y' . ?uniprotaccession core:organism ?taxonomy . ?taxonomy core:scientificName 'Homo sapiens' . }
# | genedescription | taxonomy |
---|---|---|
1 | lysine (K)-specific demethylase 5D | http://purl.uniprot.org/taxonomy/9606 |
2 | zinc finger protein, Y-linked | http://purl.uniprot.org/taxonomy/9606 |
3 | ubiquitously transcribed tetratricopeptide repeat containing, Y-linked | http://purl.uniprot.org/taxonom/9606 |
4 | DEAD (Asp-Glu-Ala-Asp) box polypeptide 3, Y-linked | http://purl.uniprot.org/taxonomy/9606 |
5 | protocadherin 11 Y-linked | http://purl.uniprot.org/taxonomy/9606 |
6 | neuroligin 4, Y-linked | http://purl.uniprot.org/taxonomy/9606 |
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> prefix aemetonto: <http://aemet.linkeddata.es/ontology/> select ?stationName ?lat ?long where { ?a a aemetonto:WeatherStation; aemetonto:stationName ?stationName; geo:location ?location. ?location geo:lat ?lat; geo:long ?long. } limit 1000
# | stationName | lat | long |
---|---|---|---|
1 | POBRA DE TRIVES,SAN MAMEDE | 42.3405555556 | -7.28055555556 |
2 | BARDENAS REALES | 42.195 | -1.4725 |
3 | BUJARALOZ | 41.5236111111 | -0.173333333333 |
4 | CALANDA | 40.9408333333 | -0.236388888889 |
SELECT ?name ?fat WHERE { ?product food:fatPer100g ?fat . ?product food:name ?name . } LIMIT 5
name | fat |
---|---|
Courgettes | 0.4 |
Cinnamon sugar | 0 |
Sweet Chili Sauce | 0 |
White Balsamic Condiment | 0 |
Flaked Almonds | 55.8 |
select ?title ?date where { ?a a <http://eur-lex.publicdata.eu/ontology/Agreement>; <http://eur-lex.publicdata.eu/ontology/Treaty> <http://eur-lex.publicdata.eu/ontology/European+Coal+And+Steel+Community>; <http://eur-lex.publicdata.eu/ontology/title> ?title; <http://eur-lex.publicdata.eu/ontology/date_document> ?date. } limit 100
# | title | date |
---|---|---|
1 | Consultation Agreement between the Swiss Confederation and the High Authority of the European Coal and Steel Community | 1956-05-07 |
2 | Agreement on the introduction of through international railway tariffs for the carriage of coal and steel through Swiss territory | 1956-07-28 |
3 | Agreement between the Austrian Federal Government, of the one part, and the Governments of the Member States of the European Coal and Steel Community and the High Authority of the European Coal and Steel Community, of the other part, on the introduction of through international railway tariffs for the carriage of coal and steel through the territory of the Republic of Austria | 1957-07-26 |
SELECT ?label ?code2 ?code3 WHERE { ?lingvo rdfs:label ?label . ?lingvo lvont:iso639P1Code ?code2 . ?lingvo lvont:iso639P2BCode ?code3 . } LIMIT 5
label | code2 | code3 |
---|---|---|
Danish | da | dan |
Interlingua (International Auxiliary Language Association) | ia | ina |
Twi | tw | twi |
Assamese | as | asm |
Uighur | ug | uig |
SELECT ?name WHERE { ?l skos:prefLabel ?name; }
name |
---|
„Schild Bernadette”@de |
„A-Kader”@de |
„B-Kader”@de |
„C-Kader”@de |
„Aktiver Sportler”@de |
„Sieber Bjoern”@de |
„Ehemalig aktiver Sportler”@de |
„Herrenteam”@de |
„Damenteam”@de |
SELECT DISTINCT ?label ?lang WHERE { ?a rdfs:label ?label. ?a dc:language ?lang. filter (?lang = "fi") } LIMIT 5
label | lang |
---|---|
„Sulhasen luona Yksinäytöksinen laulunsekainen huvinäytelmä” | „fi” |
„Helsinkiin” | „fi” |
„Itämeren risteilijä” | „fi” |
„John Jagon henki tahi kuollutko vai elävä?” | „fi” |
„Muistoja lapsen ja hopeahapsen 1 Kuvauksia” | „fi” |
select * where { ?a a <http://eur-lex.publicdata.eu/ontology/Programme>; <http://eur-lex.publicdata.eu/ontology/eurovoc_descriptor> <http://eur-lex.publicdata.eu/id/equal+treatment>; <http://eur-lex.publicdata.eu/ontology/title> ?title } limit 100
# | title |
---|---|
1 | General Programme for the abolition of restrictions on freedom to provide services |
PREFIX void: <http://rdfs.org/ns/void#> PREFIX dv: <http://bio2rdf.org/bio2rdf.dataset_vocabulary:> PREFIX dbv: <http://bio2rdf.org/drugbank_vocabulary:> SELECT ?title, ?group, ?ao WHERE { ?a a dbv:Drug; dbv:group ?group; dbv:affected-organism ?ao; dcterms:title ?title. filter (?group = dbv:Illicit). filter (?ao != dbv:Humans-and-other-mammals). }
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX movie: <http://data.linkedmdb.org/resource/movie/> PREFIX owl: <http://www.w3.org/2002/07/owl#> select distinct ?actor ?name where { ?m a movie:film; movie:genre <http://data.linkedmdb.org/resource/film_genre/31>; movie:actor ?actor. ?actor rdfs:label ?name. }
# | actor | name |
---|---|---|
1 | http://data.linkedmdb.org/resource/actor/29458 | Fay Wray (Actor) |
2 | http://data.linkedmdb.org/resource/actor/35173 | Bruce Cabot (Actor) |
3 | http://data.linkedmdb.org/resource/actor/835 | Robert Armstrong (Actor) |
PREFIX odrl: <http://www.w3.org/ns/odrl/2/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> select ?l where { ?l a <http://www.w3.org/ns/odrl/2/Set>; odrl:permission ?node. ?node odrl:action <http://www.w3.org/ns/odrl/2/copy>. }
PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dbpedia: <http://dbpedia.org/> PREFIX dbpedia-owl: <http://dbpedia.org/ontology/> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX nobel: <http://data.nobelprize.org/terms/> PREFIX eurostat: <http://wifo5-04.informatik.uni-mannheim.de/eurostat/resource/eurostat/> PREFIX dbpprop: <http://dbpedia.org/property/> select distinct ?laureat ?year ?country ?populationCensus ?death_rate ?electricity_consumption_GWh ?electricity_production_capacity_MWh where { service <http://dbpedia.org/sparql> { ?countryx a <http://dbpedia.org/ontology/Country> ; dcterms:subject <http://dbpedia.org/resource/Category:Member_states_of_the_European_Union>. OPTIONAL {?countryx dbpprop:populationCensus ?populationCensus }. }. service <http://wifo5-04.informatik.uni-mannheim.de/eurostat/sparql> { ?countryz owl:sameAs ?countryx. OPTIONAL {?countryz eurostat:death_rate ?death_rate }. OPTIONAL {?countryz eurostat:electricity_consumption_GWh ?electricity_consumption_GWh}. OPTIONAL {?countryz eurostat:electricity_production_capacity_MWh ?electricity_production_capacity_MWh}. }. ?a rdf:type <http://data.nobelprize.org/terms/Laureate>; rdfs:label ?laureat; nobel:laureateAward ?award. ?award nobel:year ?year. ?a dbpedia-owl:birthPlace ?country. ?country a <http://dbpedia.org/ontology/Country>. ?country owl:sameAs ?countryx. } order by desc(?year)
laureat | year | country | populationCensus | death_rate | electricity_consumption_GWh | electricity_production_capacity_MWh |
---|---|---|---|---|---|---|
Patrick Modiano | 2014 | http://data.nobelprize.org/resource/country/France | 350410 | 11935100 | ||
Stefan W. Hell | 2014 | http://data.nobelprize.org/resource/country/Romania | 20121641 | |||
Martin Karplus | 2013 | http://data.nobelprize.org/resource/country/Austria | 8504850 | 0.607 | 47905 | 17520 |
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX dbpedia-owl: <http://dbpedia.org/ontology/> PREFIX lgdo: <http://linkedgeodata.org/ontology/> PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX dcterms: <http://purl.org/dc/terms/> PREFIX category: <http://dbpedia.org/resource/Category:> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> PREFIX dbpedia: <http://dbpedia.org/resource/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> select ?wifiap ?SSID ?lat2 ?long2 where { service <http://dbpedia.org/sparql/> { <http://dbpedia.org/resource/Andorra_la_Vella> geo:lat ?lat1; geo:long ?long1. } ?wifiap a <http://www.openmobilenetwork.org/ontology/WiFiAP>; geo:lat ?lat2; geo:long ?long2; omn-owl:hasSSID ?SSID. } order by (xsd:float(?lat1 - ?lat2)*xsd:float(?lat1 - ?lat2) + xsd:float(?long1 - ?long2)*xsd:float(?long1 - ?long2))
# | wifiap | SSID | lat2 | long2 |
---|---|---|---|---|
1 | http://www.openmobilenetwork.org/resource/wifiap-1062888254 | WLAN_905F | 41.4037 | 2.1734 |
2 | http://www.openmobilenetwork.org/resource/wifiap1814240623 | PM-SF3 | 41.4037 | 2.17349 |
3 | http://www.openmobilenetwork.org/resource/wifiap1112433173 | ONOE983 | 41.4037 | 2.17349 |
4 | http://www.openmobilenetwork.org/resource/wifiap880011342 | ONO836C | 41.4037 | 2.17349 |
5 | http://www.openmobilenetwork.org/resource/wifiap1869454230 | Barcelona WiFi | 41.4037 | 2.17352 |