sparqlでマッシュアップ -lod活用のための技術紹介-

Download SPARQLでマッシュアップ-LOD活用のための技術紹介-

Post on 06-Jul-2015

1.487 views

Category:

Technology

5 download

Embed Size (px)

DESCRIPTION

4 Linked Open Data with LODC2014 UDC2014 2014.12.7

TRANSCRIPT

  • 1. SPARQL -LOD-LODJapan4Linked Open Data with LODC2014 UDC20142014.12.7

2. LOD 2014Linked Open Data Japan2014Webhttp://uedayou.net/ 3. SPARQL(SPARQL Protocol and RDF Query Language) 4. SPARQLRDF(LOD)RDF(LOD)3 PREFIX rdfs:SELECT * WHERE {?urirdfs:label?label .}LIMIT 10?uri?labelhttp://ja.dbpedia.org/resource/""http://ja.dbpedia.org/resource/""http://ja.dbpedia.org/resource/""http://ja.dbpedia.org/resource/"" 5. SPARQLWebAPIWikipediaDBPediaWikipediaOpen Data METILODEuropeanaLODAC MuseumThe British MuseumThe British National BibliographyWeb NDL AuthoritiesLinked Geo DataLODACLocationXMLAPILODACSpeciesSPARQL 6. LODSPARQL http://lodc.jp 7. http://lodc.jp/#dataset3+ 8. SPARQL SparqlEPCUhttp://lodcu.cs.chubu.ac.jp/SparqlEPCU/ 9. SparqlEPCUWebSPARQL(SPARQL Web API)Linked Open DataJapan 2012 http://lod.sfc.keio.ac.jp/blog/?p=1071 10. Twitter/Facebook Project ID()(ttl,rdf/xml, nt)ProjectAPIURL SPARQL1234 11. http://www.slideshare.net/siramatu/sparqlmashup2 12. LODRDF Resource Description Framework1 (Subject)(Object)(Predicate) 13. dbpedia: rdfs:label""dbpedia: rdfs:comment "dbpedia: rdfs:labeldbpedia: rdfs:comment" "dbpedia: rdfs:labeldbpedia: rdfs:comment" "idlabelcommentdbpedia: "" "dbpedia: " "dbpedia: " "SPARQL 14. HTMLCSVXMLJSON formatJSONhttp://db.lodc.jp/sparql?query=...&format=jsonXMLhttp://db.lodc.jp/sparql?query=...&format=xmlCSVhttp://db.lodc.jp/sparql?query=...&format=csvformatSPARQL 15. SPARQL 16. SPARQLSPARQL WebWeb 17. SPARQLleaflet-simple-sparqlSlickQuiz-SPARQLfullcalendar-sparql-jsSPARQL Timelinerbooksearch-sparql-jssgvizler 18. leaflet-simple-sparqlhttps://github.com/uedayou/leaflet-simple-sparql 19. leaflet-simple-sparqlgithubDownload ZIP config.jsindex.htmlvar endpoint = "http://ja.dbpedia.org/sparql";var query = (function () {/*PREFIX geo: PREFIX rdfs: select * where {?link rdfs:label ?title;geo:lat ?lat;geo:long ?long.}limit 1000*/}).toString().match(/n([sS]*)n/)[1]; 20. SlickQuiz-SPARQLhttps://github.com/uedayou/SlickQuiz-SPARQL 21. SlickQuiz-SPARQLgithubDownload ZIP config.jsindex.htmlvarendpoint = "http://lodcu.cs.chubu.ac.jp/SparqlEPCU/api/yokohama_quiz";varquery = (function () {/*select distinct * where { ?uri ?question; ?choise1; ?choise2; ?choise3; ?choise4; ?answer_no; ?kaisetsu.bind(concat('',str(?kaisetsu),'') as ?correct)bind(concat('',str(?kaisetsu),'') as ?incorrect) } ORDER BY RAND() LIMIT 10*/}).toString().match(/n([sS]*)n/)[1]; 22. SlickQuiz-SPARQL LinkData.org http://linkdata.org/work/rdf1s560i 23. fullcalendar-sparql-jshttps://github.com/uedayou/fullcalendar-sparql-js 24. fullcalendar-sparql-jsgithubDownload ZIP config.jsindex.htmlvarendpoint = "http://archive.yafjp.org/test/inspection.php";varquery = (function () {/*PREFIX dc: PREFIX schema: PREFIX event: SELECT * WHERE{?uria event:Event;schema:name?title;schema:startDate?start;schema:endDate?end;dc:description?description.}*/}).toString().match(/n([sS]*)n/)[1]; 25. SPARQL Timelinerhttp://uedayou.net/SPARQLTimeliner/ 26. SPARQL TimelinerURLhttp://uedayou.net/SPARQLTimeliner URL Load>> 27. SPARQL Timelinerhttp://www.slideshare.net/uedayou/sparql-timeliner- 28905905 28. Linked Open Data 2013 Web http://y4ashida.github.io/toilet/ 29. SPARQL https://github.com/uedayou/dangerzone-sparql 30. http://uedayou.github.io/dangerzone-sparql/ 31. 1.Download ZIP 2.ZIP3.config.js 4. Index.html SPARQL 32. config.js // SPARQLvarendpoint = "http://db.lodc.jp/sparql";// SPARQLvarquery = (function () {/*SELECT DISTINCT *FROM WHERE{?uri ""@ja ; ?latitude ; ?longitude .}*/}).toString().match(/n([sS]*)n/)[1];// varinitial_latitude=34.68206400648744;varinitial_longitude=135.49816131591797;// varinitial_zoom= 11;SPARQLSPARQL 33. // SPARQLvarendpoint = "http://db.lodc.jp/sparql";// SPARQLvarquery = (function () {/*SELECT DISTINCT *FROM WHERE{?uri ""@ja ; ?latitude ; ?longitude .}LIMIT 1000*/}).toString().match(/n([sS]*)n/)[1];// varinitial_latitude=34.68206400648744;varinitial_longitude=135.49816131591797;// varinitial_zoom= 11;@ja@ja@ja@ja@ja@ja 34. booksearch-sparql-jshttps://github.com/uedayou/booksearch-sparql-js 35. booksearch-sparql-jsgithubDownload ZIP config.js?uriURI?title ?description {% QUERY %} index.html// SPARQLURLvarendpoint = "http://lodcu.cs.chubu.ac.jp/SparqlEPCU/api/kyotobook_list";// SPARQL)varlist_query= (function () {/*select distinct ?uri?title ?description where{?uri ?title; ?description.filter(regex(str(?title), '.*?{% QUERY %}.*?'))}*/}).toString().match(/n([sS]*)n/)[1]; 36. booksearch-sparql-jsconfig.js prop_labelsURI URI varprop_labels= {"http://purl.org/dc/terms/title":"","http://purl.org/dc/elements/1.1/creator":"", 37. sgvizlerhttp://dev.data2000.no/sgvizler/0.5 38. sgvizlerHTML ?year.}GROUP BY ?yearORDER BY DESC(?noOfUri)data-sgvizler-chart="gBarChart"data-sgvizler-loglevel="2"data-sgvizler-chart-options="title=Number of instances"style="width:2000px; height:2500px;">http://uedayou.net/sparql-mashup/sgvizler-sample.html 39. sgvizler ?year.}GROUP BY ?yearORDER BY DESC(?noOfUri)data-sgvizler-chart="gBarChart"data-sgvizler-loglevel="2"data-sgvizler-chart-options=title="style="width:800px; height:500px;">Id 40. LODJapan2014LOD2011-2013LODSPARQL 41. http://uedayou.net/sparql-mashup/sgvizler/kyoto-issued-ranking.html 42. 10http://uedayou.net/sparql-mashup/sgvizler/kyoto-author-top10.html 43. http://uedayou.net/sparql-mashup/sgvizler/kyoto-recommend-ranking.html 44. http://uedayou.net/sparql-mashup/sgvizler/kyoto-publisher-ranking.html 45. http://uedayou.net/sparql-mashup/sgvizler/kyoto-category-ranking.html 46. data-sgvizler-chartgPieChartgColumnChartgBarChartGROUP BY COUNTPREFIX dcterms: SELECT ?year (COUNT(?uri) AS ?noOfUri)WHERE {?uridcterms:issued?year.}GROUP BY ?yearORDER BY DESC(?noOfUri) 47. 48. LOD http://uedayou.net/sparql-mashup/sgvizler/lodc-network.html 49. select distinct ?title1 ?title2from where {?s ?o.?s ?title1.?o ?title2.}data-sgvizler-chartgForceGraphSELECT 50. 51. SPARQL http://uedayou.net/sparql-mashup/ 52. URI(IRI)URI(IRI) : IDURIURI: , 100 , 2014-12-07 (string, integer, float) 53. "" "RDF 54. URI"" " 55. (1) SPARQLSELECT ?s ?p ?o WHERE{?s ?p ?o.} 56. SELECTSELECT ?) WHERE ?s?p?oSELECT ?s ?p ?o WHERE{?s ?p ?o.} 57. SELECTWHERE ?s?p?o SELECT * WHERE{?s ?p ?o .}SELECT ?s ?p ?o WHERE{?s ?p ?o.}= 58. WHEREWHERE { } SELECT ?s ?p ?o WHERE{?s ?p ?o .} 59. 3 URI1?URI1SELECT ?s ?p ?o WHERE{?s ?p ?o.} 60. ?s , ?p , ?o, ?label, ?comment ??id rdfs:label?label.idlabeldbpedia: ""dbpedia: dbpedia: rdfs:labelURI 61. ?id rdfs:comment?comment.rdfs:commentURI 62. ?id rdfs:label?label.?id rdfs:comment?comment.(?id)ANDURI 63. (1) SPARQLSELECT ?s ?p ?o WHERE{?s ?p ?o.} 64. ?s?p?o"" " 65. http://uedayou.net/sparql-mashup/test-endpoint/ 66. (2) rdfs:labelSELECT ?s ?o WHERE{?s ?o .} 67. ?s?p?o"" " 68. http://uedayou.net/sparql-mashup/test-endpoint/ 69. select distinct * where{ ?p ?o .}(3) 70. ?s?p?o"" " 71. http://uedayou.net/sparql-mashup/test-endpoint/ 72. (4) 1.URI 2. rdfs:label(?pref) URI (AND)SELECT DISTINCT ?pref?label WHERE{ ?pref.?pref ?label.} 73. "" "?pref?label?prefURI 74. http://uedayou.net/sparql-mashup/test-endpoint/ 75. PREFIXURIURIPREFIXPREFIX BINDNAME: PREFIX rdfs: PREFIX URIPREFIX rdfs: rdfs:label 76. PREFIX rdfs: PREFIX dbpedia-ja: PREFIX prop-ja: "" "dbpedia-jp:rdfs:labeldbpedia-jp:rdfs:commentdbpedia-jp:prop-ja:dbpedia-jp:dbpedia-jp:prop-ja:dbpedia-jp:dbpedia-jp:prop-ja:dbpedia-jp:dbpedia-jp:prop-ja:dbpedia-jp:dbpedia-jp:rdfs:labeldbpedia-jp:rdfs:labeldbpedia-jp:rdfs:labeldbpedia-jp:rdfs:label 77. (5) SELECT DISTINCT ?pref?label WHERE{ ?pref.?pref ?label.}PREFIX rdfs: PREFIX dbpedia-ja: PREFIX prop-ja: SELECT DISTINCT ?pref?label WHERE{dbpedia-ja:prop-ja:?pref.?prefrdfs:label?label .} 78. http://uedayou.net/sparql-mashup/test-endpoint/ 79. (6) .; SELECT DISTINCT *WHERE {dbpedia-ja:rdfs:label?label .dbpedia-ja:rdfs:comment?comment .}SELECT DISTINCT *WHERE {dbpedia-ja:rdfs:label?label ;rdfs:comment?comment .} 80. http://uedayou.net/sparql-mashup/test-endpoint/ 81. SPARQLDISTINCTLIMITOFFSETORDER BYOPTIONALOPTIONALFILTERREGEXBINDCONCATREPLACESUBSTRCOUNTGROUP BYHAVINGSlideShare 82. SPARQL 83. DISTINCTSELECTDISTINCT SELECT DISTINCT ?s ?p ?o WHERE{?s ?p ?o.} 84. LIMITWHERE{}LIMIT 1010PREFIX rdfs: SELECT DISTINCT ?uri?label WHERE{?urirdfs:label?label .}LIMIT 10 85. OFFSETWHERE{}OFFSET 100100PREFIX rdfs: SELECT DISTINCT ?uri?label WHERE{?urirdfs:label?label .}LIMIT 10OFFSET 100 86. ORDER BY / ORDER BY DESCWHERE{}ORDER BY ?createdORDER BY DESC(?created)LIMITOFFSETPREFIX dc: SELECT DISTINCT ?uri?created WHERE{?uridc:created?created.}ORDER BY ?createdLIMIT 10OFFSET 100PREFIX dc: SELECT DISTINCT ?uri?created WHERE{?uridc:created?created.}ORDER BY DESC(?created)LIMIT 10OFFSET 100 87. OPTIONALOPTIONAL{ } OPTIONAL WHERE{ } PREFIX rdfs: PREFIX dc: SELECT DISTINCT ?uri?label ?description WHERE{?urirdfs:label?label .OPTIONAL {?uridc:description?description.}} 88. FILTERWHERE{ } dcterms:issued2000PREFIX rdfs:PREFIX dcterms: SELECT DISTINCT ?uri?label ?issued WHERE{?urirdfs:label?label ;dcterms:issued?issued .FILTER ( ?issued >= 2000)} 89. REGEXFILTER WHERE{ } REGEX( , )PREFIX rdfs:SELECT DISTINCT ?uri?label WHERE{?urirdfs:label?label .FILTER ( REGEX ( ?label, ^.*$ ) )}?label 90. BIND / CONCATBIND BIND( []AS [] )CONCAT CONCAT( [or] , [or] , )PREFIX rdfs: PREFIX dc: SELECT DISTINCT ?uri?label ?description ?text WHERE{?urirdfs:label?label ;dc:description?description .BIND( CONCAT( , ?label ,

, ?description,

) AS?text )}?text [?label]

[?description]

91. REPLACEREPLACE( , , )BIND PREFIX rdfs: PREFIX dc: SELECT DISTINCT ?uri?label ?description ?text WHERE{?urirdfs:label?label ;dc:description?description .BIND( REPLACE( ?description , , ) AS ?text )} 92. SUBSTRSUBSTR( , , )BIND PREFIX rdfs: PREFIX dc: SELECT DISTINCT ?u