Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Sparql

1,258 views

Published on

Published in: Business, Technology
  • Be the first to comment

Sparql

  1. 1. Querying with SPARQL Govinda et Lei
  2. 2. SPARQL on IMDB
  3. 3. IMDBObjectLinkedMDB publishes linked open data using theD2R Server. The project aims at publishing thefirst open semantic web database for movies,including a large number of interlinks to severaldatasets on the open data cloud and referencesto related webpages.
  4. 4. IMDBInerlink
  5. 5. IMDBAccessing DataWeb browsers (see examples below) film: http://data.linkedmdb.org/page/film actor: http://data.linkedmdb.org/page/actorSemantic Web browsers - entry point: http://data.linkedmdb.org/allSPARQL clients - SPARQL endpoint: http://data.linkedmdb.org/sparql
  6. 6. Search film on HTMLGoto category: Film -> Disraelihttp://data.linkedmdb.org/page/film/100Etc...
  7. 7. Query with SPARQLOnline Explorer: SPARQL ExplorerQuery examples following...
  8. 8. Query with SPARQLSelect all director namesSELECT ?nameDirector WHERE {?director movie:director_name ?nameDirector.}ORDER BY ?nameDirector Etc...
  9. 9. Query with SPARQLSelect a certain director "George Lucas"SELECT ?title WHERE { ?film rdf:type movie:film ; foaf:page ?link ; dc:title ?title ;movie:director ?director. ?director movie:director_name ?nameDirector. FILTER ( regex(?nameDirector, "George Lucas","i") && regex(str(?link), "^http://www.imdb.com/title", "i") ) }ORDER BY ?title
  10. 10. Query with SPARQLCount the films produced by a certain directorSELECT count (*) WHERE { ?film rdf:type movie:film ; foaf:page ?link ; dc:title ?title ;movie:director ?director. ?director movie:director_name ?nameDirector. FILTER ( regex(?nameDirector, "George Lucas","i") && regex(str(?link), "^http://www.imdb.com/title", "i") ) }ORDER BY ?title
  11. 11. Query with SPARQLSelect the films produced by a certain directorand Filter them by dateSELECT ?title ?link WHERE { ?film rdf:type movie:film ; foaf:page ?link ; dc:title ?title ; dc:date ?date ; movie:director ?director. ?director movie:director_name ?nameDirector. FILTER ( regex(?nameDirector, "George Lucas","i") && regex(str(?link), "^http://www.imdb.com/title", "i") && str(?date) > "2000" ) }ORDER BY ?title
  12. 12. SPARQL on Wordpress
  13. 13. Use PluginsOpenLink Data Explorer Site http://molene.enstb.org/F2B506/ index.php?sioc_type=site Post http://molene.enstb.org/F2B506/ index.php? sioc_type=post&sioc_id=274Embedded RDF auther http://molene.enstb.org/F2B506/ ?author=1 auther http://molene.enstb.org/F2B506/ ?feed=foaf&author=1
  14. 14. Query on SPARQLSELECT ALL POSTSPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>PREFIX sioc: <http://rdfs.org/sioc/ns#>PREFIX foaf: <http://xmlns.com/foaf/0.1/>PREFIX dc: <http://purl.org/dc/elements/1.1/>SELECT ?post ?title ?content ?creator ?user ?containerWHERE {?post dc:title ?title.?post sioc:content ?content.?creator rdfs:label ?user?post sioc:has_container ?container.} ORDER BY ?title
  15. 15. Thanks !

×