SQUALL Examples

Language features

A number of the following examples were freely inspired by A Comparison of RDF Query Languages (Haase, Broekstra, Eberhart and Volz, ISWC'04).

Path expressions
What is the name of the author-s of PaperX?
Union
What is the label of a topic or is the title of a publication?
Difference
What is the label of a topic and is not the title of a publication?
Optional
The author-s of a publication have which name and maybe have which email?
What is the name of an author X of a publication and if defined, what is the email of X ?
Quantification
Which person is an author of every publication?
Which person is an author of at least 10 publication-s?
Modifiers
Which mountain has the highest elevation ?
Which mountain has an elevation that is the 2nd highest ?
Which person-s have the 10 lowest age ?
Which person-s have a child whose age is the 3rd to 5th lowest ?
Aggregation
How many person-s are an author of PaperX?
PaperX has how many author-s?
What is the number of author-s of PaperX?
Which publication has how many author-s?
Which publication has at least 3 author-s?
Which publication has between 2 and 3 author-s?
Which publication has the most author-s?
Who is the author of the most publication-s?
Grouping
How many person-s have which affiliation ?
What is the number of person-s per affiliation ?
How many publication-s have an author that has which affiliation?
What is the number of publication-s X per the affiliation of an author of X ?
What is the number of publication-s whose author has some affiliation A per A ?
What is the average number of publication-s per author ?
For every journal J, give me the average number of publication-s that are-publishedIn J per author.
Recursion
What is a subtopic+ of InformationSystems?
Entailment
What is a publication?
What has a rdf:type that is-rdfs:subClassOf* the class publication?
Reifications of predicates ('relate(s)') and classes ('belong(s)')
Which rdf:Property relates a publication to a person?
To which nationality an author of PaperX belongs?
Graphs and services
In which graph whose source is SourceX every publication has at least 1 author?
Give me all researcher-s which from service Facebook have at least 10 friend-s.
In which graph PersonX know-s PersonY?
Which person knows PersonX in at least 3 graphs?
Patterns
How many publication-s have topic 'Computer Science' ?
Which person whose rdfs:label is 'John Smith' is an author of PaperX ?
Namespaces
Which organisation has a str that matches "^http:/www.aifb.unikarlsruhe.de/"?
The string of which organisation matches "^http:/www.aifb.unikarlsruhe.de/"?
Language
What has language "de" and is the rdfs:label of the topic that has a rdfs:label whose str is "Database Management" and whose language is "en"?
Literals and Datatypes
Which publication has pageNumber 8?
Which publication has a pageNumber whose str is "08"?
Expressions
Which rectangle has the heigth * the width equal to 100 and has 2 * (the height + the width) equal to 40 ?
Return concat("Hello ", the foaf:firstName, " ", the foaf:lastName, " !") of all person-s .
Which person has substr(the foaf:name,0,3) that contains "Dr" ?
Is every odd + every even an even ?
Collections
Which publication-s have authorList [PersonA, PersonB, PersonC] ?
Which publication-s have authorList [PersonA, _, PersonC] ?
What is an rdf:element of the authorList of PaperX ?
PaperX has authorList [..., what, ...] ?
What is the rdf:last of the authorList of PaperX ?
PaperX has authorList [..., what] ?
Imperative questions
Return the publication-s of PersonX .
List all author-s of PaperX .
Give me the title of the publication-s of PersonX .
Closed questions (ASK)
Whether PubliX has an author that worksFor OrgY?
Does PaperX have an author that worksFor OrgY ?
Describe questions (DESCRIBE)
Describe PaperX.
Describe every author of PaperX.
Graph literals as results (CONSTRUCT, N3 formulas)
For every person X that shares a parent with a person Y, return that X has sibling Y and Y has sibling X.
For every person X, for S = concat(every firstname, " ", every lastname) of X, return that X has fullname S.
If a person X shares a parent with a person Y then return that X has sibling Y and Y has sibling X.
Insertion
BookX is a book whose title is "A new book" and whose author is PersonY.
Deletion
In graph GraphA BookX has title "Compiler Design" and not "Compiler desing".
Group of updates
For every book B that some P relates to some V and whose date < 2001-01-01, P does not relate B to V.
If a book B has at least 2 author-s then B is a CollaborativeWork.
Graph-level updates
Load <http://example.org/data.rdf> into GraphA.
Move GraphA to the default graph.
Clear all named graphs.
Drop all graphs.
Copy
Every P that relates some S to some V in graph GraphA relates S to V in graph GraphB.
Move
Every P that relates some S to some V in graph GraphA relates S to V in graph GraphB and not GraphA.

About films in DBpedia

The following examples are valid queries for the DBpedia SPARQL endpoint. To get results to those queries from DBpedia, just click the first link after the SPARQL translation. To make the writing of queries more concise and natural, the following prefix declarations are added to those of the Dbpedia SPARQL endpoint:

PREFIX : <http://dbpedia.org/ontology/>
PREFIX res: <http://dbpedia.org/resource/>
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dbp: <http://dbpedia.org/property/>

  1. List all Film-s.
  2. Which Film has director res:Tim_Burton and is-starring res:Johnny_Depp and res:Helena_Bonham_Carter ?
  3. Which Film whose releaseDate is greater or equal to 2010-01-01 has a director whose birthPlace is res:England or res:United_States ?
  4. Which Film has country res:France or has a director or starring or musicComposer whose birthPlace is res:France ?
  5. Which Person has birthPlace res:United_States and is the director of a Film that is-starring res:Johnny_Depp and whose releaseDate is what ?
  6. Which Person X is the director of a Film that is-starring X ?
  7. Which Film has which country X and has a director whose birthPlace is not X ?
  8. How many Film-s whose director is res:Tim_Burton are-starring which Person ?

QALD-3 DBpedia training questions

The following examples are SQUALL translations for the DBpedia training questions from the QALD challenge, co-located with CLEF 2013. Those SQUALL translations have been designed to conform to the SPARQL solutions, and therefore may not be the simplest translation of the original English questions. We here assume the same prefixes as above.

  1. Give me all yago:RussianCosmonauts that are a yago:FemaleAstronauts.
  2. Give me the birthDate of the starring-s of res:Charmed.
  3. Who is the dbp:spouse of the child of res:Ingrid_Bergman?
  4. res:Brooklyn_Bridge crosses which River?
  5. How many yago:EuropeanCountries have governmentType 'monarchy'?
  6. What is the deathPlace of res:John_F._Kennedy?
  7. Is the spouse of res:Barack_Obama 'Michelle'?
  8. Which yago:StatesOfGermany have dbp:rulingParty 'SPD' or 'Social Democratic Party'?
  9. Which yago:StatesOfTheUnitedStates have dbp:mineral 'Gold'?
  10. What is the sourceCountry of res:Nile?
  11. Which Country is the location of more than 2 Cave-s?
  12. Is res:Proinsulin a Protein?
  13. What is the dbp:classis of 'tree frog'?
  14. What is the height of res:Claudia_Schiffer?
  15. Who is the creator of res:Goofy?
  16. Give me the capital-s of the yago:AfricanCountries.
  17. Give me all City-es that isPartOf res:New_Jersey and whose populationTotal is greater than 100000.
  18. What is the dbp:museum of res:The_Scream ?
  19. Is the largestCity of res:Egypt the capital of res:Egypt?
  20. What is the numberOfEmployees of res:IBM?
  21. What are the dbp:borderingstates of res:Illinois?
  22. What is the country of res:Limerick_Lake?
  23. Which TelevisionShow has creator res:Walt_Disney?
  24. Which Mountain has the highest elevation lesser than the elevation of res:Annapurna?
  25. Which Film has director res:Garry_Marshall and is-starring res:Julia_Roberts?
  26. Which Bridge shares a dbp:design with res:Manhattan_Bridge?
  27. Does res:Andrew_Jackson have a battle?
  28. Which yago:EuropeanCountries have governmentType res:Constitutional_monarchy?
  29. What are the dbp:awards of res:WikiLeaks?
  30. Which yago:StatesOfTheUnitedStates has the lowest dbp:densityrank?
  31. What is the currency of res:Czech_Republic?
  32. Which yago:EuropeanUnionMemberStates have dbp:currencyCode 'EUR'?
  33. What is the areaCode of res:Berlin?
  34. Which Country has more than 2 officialLanguage-s?
  35. Who is the owner of res:Universal_Studios?
  36. What are the dbp:country of res:Yenisei_River?
  37. What is the dbp:accessioneudate of res:Latvia?
  38. Which yago:MonarchsOfTheUnitedKingdom have a spouse whose birthPlace is res:Germany?
  39. What is the date of res:Battle_of_Gettysburg?
  40. Which Mountain that is-locatedInArea res:Australia has the highest elevation?
  41. Give me all SoccerClub whose dbp:ground is 'Spain'.
  42. What are the officialLanguage-s of res:Philippines?
  43. What is the leaderName of res:New_York_City?
  44. Who is the dbp:designer of res:Brooklyn_Bridge?
  45. Which Organisation-s whose dbp:industry is 'Telecommunication' have location res:Belgium?
  46. Does res:Frank_Herbert have no deathDate?
  47. What is the highestPlace of res:Karakoram?
  48. Give me the foaf:homepage of res:Forbes.
  49. Give me all Company-es whose dbp:industry is 'advertising'.
  50. What is the deathCause of res:Bruce_Carver?
  51. Give me all yago:SchoolTypes.
  52. Which President-s or yago:Presidents have birthDate '1945'?
  53. Give me all yago:PresidentsOfTheUnitedStates.
  54. Who is the spouse of res:Abraham_Lincoln?
  55. Who is the developer of res:World_of_Warcraft?
  56. What is the foaf:homepage of res:Tom_Cruise?
  57. List all TelevisionEpisode-s whose series is res:The_Sopranos and whose seasonNumber is 1.
  58. Who is the producer of the most Film-s?
  59. Give me all foaf:Person whose foaf:givenName is 'Jimmy'.
  60. Is there a VideoGame that is 'Battle Chess'?
  61. Which Mountain has a greater dbp:elevationM than res:Nanga_Parbat?
  62. Who is the author of res:Wikipedia?
  63. Who does 'Last Action Hero' be-starring?
  64. Which Software-s have developer an Organisation whose foundationPlace is res:California?
  65. Which Company has dbp:industry res:Aerospace and res:Nuclear_reactor_technology?
  66. Is res:Christian_Bale a starring of res:Batman_Begins?
  67. Give me the foaf:homepage of the Company-es whose dbp:numEmployees is greater than 500000.
  68. Which Actor-s have birthPlace res:Germany or a thing whose country is res:Germany?
  69. Which Cave-s have an dbp:entranceCount greater than 3?
  70. Give me all Film-s whose producer is res:Hal_Roach.
  71. Give me all VideoGame-s whose publisher is 'Mean Hamster Software'.
  72. What is a :language of res:Estonia or is-spokenIn res:Estonia?
  73. Who is the keyPerson of res:Aldi?
  74. Which yago:CapitalsInEurope are a yago:HostCitiesOfTheSummerOlympicGames?
  75. Who has orderInOffice '^5th President United States'?
  76. How many Film-s have producer res:Hal_Roach?
  77. What is the album of 'Last Christmas'?
  78. Give me all Book-s whose author is res:Danielle_Steel.
  79. Which Airport-s have location res:California ?
  80. Give me all RecordLabel-s whose genre is res:Grunge and whose country is res:Canada.
  81. Which Country has the most dbp:officialLanguages?
  82. What is the programmingLanguage of res:GIMP?
  83. Who are the producer-s of the Film-s that are-starring res:Natalie_Portman?
  84. Give me all Film-s that are-starring res:Tom_Cruise.
  85. Which Film-s are-starring res:Julia_Roberts and res:Richard_Gere?
  86. Give me all yago:FemaleHeadsOfGovernment whose dbp:office is res:Chancellor_of_Germany.
  87. Who is the author of res:The_Pillars_of_the_Earth?
  88. How many Film-s are-starring res:Leonardo_DiCaprio?
  89. Give me all SoccerClub-s whose league is res:Premier_League.
  90. What is the dbp:foundation of res:Capcom?
  91. Which Organisation-s have dbp:foundation or formationYear '1950'?
  92. Which Mountain has the highest elevation?
  93. Does res:Natalie_Portman have a birthPlace whose country is res:United_States?
  94. What is the budget of the Film whose director is 'Zdenek Sverak' and whose releaseDate is the earliest?
  95. How many Fire-s have location res:Paris and have period 'Middle Age'?
  96. Is 'Jen Friebe' a Vegan?
  97. How many divorce-s of 'Michael Jordan' are there?
  98. Which Painting has the highest beauty?
  99. Give me all Species whose livingPlace is 'Teutoburg Forest'.
  100. What is the releaseDateInNetherlands of 'Worst Case Scenario'?

QALD-3 DBpedia test questions

Same as above with DBpedia 'test' questions.

  1. Which Town that has country res:Germany has a populationTotal greater than 250000?
  2. Who is the successor of res:John_F._Kennedy?
  3. Who is the leader of res:Berlin?
  4. What is the numberOfStudents of res:Vrije_Universiteit?
  5. Which Mountain has the 2nd highest elevation?
  6. Give me all Person-s whose occupation is res:Skateboarding and whose (nationality or birthPlace) is res:Sweden.
  7. What is the dbp:admittancedate of res:Alberta?
  8. What is a dbp:country of res:Himalayas?
  9. Give me all Person-s whose instrument is res:Trumpet and whose occupation is res:Bandleader.
  10. What is the dbp:strength of res:New_York_City_Fire_Department?
  11. Which FormulaOneRacer has the highest races?
  12. Give me all WorldHeritageSite whose dbp:year is between 2008 and 2013.
  13. Which SoccerPlayer whose team has league res:Premier_League has the latest birthDate?
  14. Give me all bandMember-s of res:Prodigy.
  15. Which River has the highest dbp:length?
  16. Does the TelevisionShow that is a dbp:tv of res:Battlestar_Galactica and with the latest releaseDate have a greater numberOfEpisodes than the TelevisionShow that is a dbp:tv of res:Battlestar_Galactica and with the earliest releaseDate?
  17. Give me all Automobile-s whose assembly is res:Germany.
  18. OUT OF SCOPE
  19. Give me all Person-s whose birthPlace is res:Vienna and whose deathPlace is res:Berlin.
  20. What is the height of res:Michael_Jordan?
  21. What is the capital of res:Canada?
  22. Who is the dbp:governor of res:Wyoming?
  23. Does 'Prince Harry' have the same dbp:mother as 'Prince William'?
  24. Who is the dbp:father of res:Elizabeth_II?
  25. Which yago:StatesOfTheUnitedStates has the latest dbp:admittancedate?
  26. How many officialLanguage-s of res:Seychelles are there?
  27. res:Sean_Parnell is the dbp:governor of which yago:StatesOfTheUnitedStates?
  28. Give me all Film-s whose director is res:Francis_Ford_Coppola.
  29. Give me all Person-s that are a starring of a Film whose director and starring is res:William_Shatner.
  30. What is the dbp:birthName of res:Angela_Merkel?
  31. Give me all yago:CurrentNationalLeaders whose dbp:religion is res:Methodism.
  32. How many spouse-s of res:Nicole_Kidman are there?
  33. Give me all Organisation-s whose type is res:Nonprofit_organization and whose location is res:Australia.
  34. What are the battle-s of res:T._E._Lawrence?
  35. Who is the developer of res:Minecraft?
  36. OUT OF SCOPE
  37. OUT OF SCOPE
  38. What is the populationTotal of res:Maribor?
  39. Give me all Company-es whose location is res:Munich.
  40. List all Game-s whose publisher is 'GMT'.
  41. Whom does res:Intel be-foundedBy?
  42. Who is the dbp:spouse of res:Amanda_Palmer?
  43. Give me all dbp:breed of res:German_Shepherd.
  44. What are the city-es of res:Weser?
  45. What are the country-es of res:Rhine?
  46. Who has occupation res:Surfing and has birthPlace res:Philippines?
  47. OUT OF SCOPE
  48. Which Place-s whose country is res:United_Kingdom is the headquarter of res:Secret_Intelligence_Service?
  49. Which Weapon shares the dbp:designer with res:Uzi?
  50. Does res:Cuban_Missile_Crisis have an earlier date than res:Bay_of_Pigs_Invasion?
  51. Give me all yago:FrisianIslands whose country is res:Netherlands.
  52. OUT OF SCOPE
  53. What is the dbp:leaderParty of res:Lisbon?
  54. What are the dbp:nickname of res:San_Francisco?
  55. Which yago:GreekGoddesses have dbp:abode res:Mount_Olympus?
  56. Which ?date do res:Hells_Angels be-dbp:founded?
  57. Give me all Astronaut-s whose mission is res:Apollo_14.
  58. What is the dbp:timezone of res:Salt_Lake_City?
  59. Which yago:StatesOfTheUnitedStates share the dbp:timezone with res:Utah?
  60. Give me all Lake-s whose country is res:Denmark.
  61. How many SpaceMission-s are there?
  62. Does res:Aristotle be-influencedBy res:Socrates?
  63. Give me all Film-s whose country is res:Argentina.
  64. Give me all LaunchPad-s whose operator is res:NASA.
  65. What are the instrument-s of res:John_Lennon?
  66. What has dbp:shipNamesake res:Benjamin_Franklin?
  67. Who are the parent-s of the spouse of 'Juan Carlos I'?
  68. What is the numberOfEmployees of res:Google?
  69. Does 'Tesla' have award 'Nobel Prize Physics'?
  70. Is res:Michelle_Obama the spouse of res:Barack_Obama?
  71. What is the dbp:beginningDate of res:Statue_of_Liberty?
  72. Which yago:StatesOfTheUnitedStates is the dbp:location of res:Fort_Knox?
  73. res:Benjamin_Franklin has how many child-s?
  74. What is the deathDate of res:Michael_Jackson?
  75. Which yago:DaughtersOfBritishEarls have the same deathPlace as birthPlace?
  76. List the child-s of res:Margaret_Thatcher.
  77. Who has dbp:nickname res:Scarface?
  78. Does res:Margaret_Thatcher have profession res:Chemist?
  79. Does res:Dutch_Schultz have dbp:ethnicity 'Jewish'?
  80. Give me all Book-s whose author is res:William_Goldman and whose numberOfPages is greater than 300.
  81. Which Book-s have author res:Jack_Kerouac and have publisher res:Viking_Press?
  82. Give me all yago:AmericanInventions.
  83. What is the elevation of res:Mount_Everest?
  84. Who is the creator of res:Captain_America?
  85. What is the populationTotal of the capital of res:Australia?
  86. What is the largestCity of res:Australia?
  87. Who is the musicComposer of res:Harold_and_Maude?
  88. Which Film-s have starring and director res:Clint_Eastwood?
  89. Which Place is the restingPlace of 'Juliana Netherlands'?
  90. What is the dbp:residence of res:Prime_Minister_of_Spain?
  91. Which yago:StatesOfTheUnitedStates has dbp:postalabbreviation 'MN'?
  92. Give me all Song-s whose artist is res:Bruce_Springsteen and whose releaseDate has a year between 1980 and 1990.
  93. Which Film-s have director res:Akira_Kurosawa and have a later releaseDate than 'Rashomon'?
  94. What is the dbp:foundation of the dbp:brewery of res:Pilsner_Urquell?
  95. Who is the dbp:author of the anthem of res:Poland?
  96. Give me all dbp:bSide of the Album-s whose artist is res:Ramones.
  97. Who is the dbp:artist of res:The_Storm_on_the_Sea_of_Galilee?
  98. What is the nationality of the creator of res:Miffy?
  99. What is the recordLabel of the Album whose artist is res:Elvis_Presley and whose releaseDate is the earliest?
  100. Who has product res:Orangina?