SPARQLthon40HandsOnSeminar
提供:TogoWiki
- 初めてのSPARQL
SELECT * WHERE { ?s ?p ?o } LIMIT 10
- グラフの種類を調べる
SELECT ?g WHERE { GRAPH ?g { ?s ?p ?o } } GROUP BY ?g
- これまでの参加者一覧
PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX s: </mw/> PREFIX sparqlthon: <http://sparqlthon.org/ontology#> SELECT DISTINCT ?name FROM <http://sparqlthon.org/> WHERE { ?s sparqlthon:has_participant ?people . ?people foaf:name ?name . }
- これまでの参加者一覧2
PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX s: </mw/> PREFIX sparqlthon: <http://sparqlthon.org/ontology#> SELECT DISTINCT ?name FROM <http://sparqlthon.org/> WHERE { ?s sparqlthon:has_participant ?people . ?people foaf:name ?name_string . BIND(str(?name_string) AS ?name) }
- SPARQLthon 30 〜 40 の参加者数
PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX s: </mw/> PREFIX sparqlthon: <http://sparqlthon.org/ontology#> SELECT * FROM <http://sparqlthon.org/> WHERE { VALUES ?sparqlthon { s:SPARQLthon30 s:SPARQLthon31 s:SPARQLthon32 s:SPARQLthon33 s:SPARQLthon34 s:SPARQLthon35 s:SPARQLthon36 s:SPARQLthon37 s:SPARQLthon38 s:SPARQLthon39 s:SPARQLthon40 } ?sparqlthon sparqlthon:has_participant ?people }
- SPARQLthon 30 〜 40 の参加者の組織数
PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX s: </mw/> PREFIX sparqlthon: <http://sparqlthon.org/ontology#> PREFIX org: <http://www.w3.org/ns/org#> SELECT DISTINCT ?name FROM <http://sparqlthon.org/> WHERE { VALUES ?sparqlthon { s:SPARQLthon31 s:SPARQLthon32 s:SPARQLthon33 s:SPARQLthon34 s:SPARQLthon35 s:SPARQLthon36 s:SPARQLthon37 s:SPARQLthon38 s:SPARQLthon39 s:SPARQLthon40 } ?sparqlthon sparqlthon:has_participant ?people . ?people org:memberOf ?org . ?org rdfs:label ?label . BIND(str(?label) AS ?name) }