AD Research Wiki
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

FrontPage

Revision 1 as of 2017-06-23 14:17:33
AD Research Wiki:
  • Projects
  • SparqlTextExampleQueries

SPARQL+Text example queries

Astronauts who walked on the moon

PREFIX fb: <http://rdf.freebase.com/ns/>
SELECT ?person ?name TEXT(?c) SCORE(?c) WHERE {
 ?person fb:people.person.profession ?profession .
 ?profession fb:type.object.name.en "Astronaut" .
 ?person fb:type.object.name.en ?name .
 ?person <in-text> ?c .
 ?c <in-text> walk* moon
}
LIMIT 100
ORDER BY DESC(SCORE(?c))

Table for: City, country, population, latitude, longitude

PREFIX fb: <http://rdf.freebase.com/ns/>
SELECT DISTINCT ?cityname ?countryname ?populationnumber ?lat ?long WHERE {
  ?city fb:type.object.type fb:location.citytown .
  ?city fb:location.location.containedby ?country .
  ?city fb:location.statistical_region.population ?population .
  ?country fb:type.object.type fb:location.country .
  ?city fb:type.object.name.en ?cityname .
  ?country fb:type.object.name.en ?countryname .
  ?population fb:measurement_unit.dated_integer.number ?populationnumber .
  ?city fb:location.location.geolocation ?geolocation .
  ?geolocation fb:location.geocode.latitude ?lat .
  ?geolocation fb:location.geocode.longitude ?long .
}
  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01