SPARQL サンプル コード ----------------------- #### SPARQLコンソール経由 select * where { ?s ?p ?o. } limit 10 #### SPARQL API経由 http://sparql.odp.jig.jp/api/v1/sparql?query=select+*+where+%7B+%3Fs+%3Fp+%3Fo.+%7D+limit+10&output=text #### 参考 * [SPARQL Examples](https://wiki1.hbz-nrw.de/display/SEM/SPARQL+Examples) SPARQLの例 ----------------------- #### 全データ指定 select * where { ?s ?p ?o . } limit 10 #### 全部データ指定 (グラフ付き) select * where { graph ?g { ?s ?p ?o . }} limit 10 #### グラフ一覧 select distinct ?g where { graph ?g { ?s ?p ?o . } } #### グラフ指定 select distinct * where { graph { ?s ?p ?o . }} #### 複数グラフ指定 select distinct * from named from named where { ?s ?p ?o . } #### REGEXフィルタ select * where { ?s ?p ?o . filter(regex(str(?s), "公園")) } #### xsd:floatの値でフィルタ prefix geo: prefix xsd: select * where { { ?s geo:lat ?o . } filter(xsd:float(?o) < 40.0) } limit 5 #### xsd:dateの型でフィルタ prefix xsd: select * where { ?s ?p ?o . filter(datatype(xsd:date(?o)) = xsd:date) . } limit 5