DQL Query Service

Enter premise and query as predicate subject object, with ?varname for must-bind variables and with namespaces prepended. One triple per blank. To specify a may-bind variable, use ~varname, and for a don't-bind variable, use !varname.

To use KIF for your premise or query, use parentheses around your entries. KIF is required for any premises or queries which have more than 2 arguments per slot.

You may also directly enter DAML for your premise or query. Simply enter something like <rdf:RDF ...

Some namespace abbreviations are defined for you. They are: rdf, rdfs, daml, dql, var, tkb. tkb is the target KB namespace. For examples, see below.

DQL Server:
 
Premise:
 
Query:
 
Answer Pattern:
 
EITHER, Select KB:
OR, Enter KB URL:
OR, Search All:
 
Generate Explanations:
 
Maximum answers:

Examples

For the Tony Hall AQUAINT system:

English:
   Have any other Congressman visited Iraq since the Gulf War? Who?
Query:
    (and (|http://www.w3.org/1999/02/22-rdf-syntax-ns#|::type ~visit 
          |http://www.ksl.stanford.edu/projects/Aquaint/AquaSumo.daml#|::|Visit|) 
         (|http://reliant.teknowledge.com/DAML/SUMO.daml#|::located ~visit 
          |http://reliant.teknowledge.com/DAML/CountriesAndRegions.daml#|::|Iraq|) 
         (|http://www.ksl.stanford.edu/projects/Aquaint/AquaSumo.daml#|::visitor 
          ~visit ?who) 
         (/= ?who |http://www.ksl.stanford.edu/projects/Aquaint/TonyHall.daml#|::|TonyHall|) 
         (|http://reliant.teknowledge.com/DAML/SUMO.daml#|::member ?who 
          |http://www.ksl.stanford.edu/projects/Aquaint/AquaSumo.daml#|::|UnitedStatesCongress|) 
         (precedes 
          (whenfn |http://www.ksl.stanford.edu/projects/Aquaint/AquaSumo.daml#|::|GulfWar|) 
          (whenfn ~visit)))
Answer pattern:
   ?who has also visited Iraq since the Gulf War.

English:
   On his first full day in Iraq, where did Tony Hall go?
Query:
    (and (|http://reliant.teknowledge.com/DAML/SUMO.daml#|:|subProcess| ~visit 
	  |http://www.ksl.stanford.edu/projects/Aquaint/TonyHall.daml#|::|TonyHallVisitsIraq|)
	 (location-of 
	  (starting-point (whenfn |http://www.ksl.stanford.edu/projects/Aquaint/TonyHall.daml#|::|TonyHallVisitsIraq|)) 
	  ~earliest-starting-pt ~latest-starting-pt)
	 (time-point-after ~earliest-starting-pt day 1 ~onedaylater)
	 (first-time-point ~onedaylater day ~day1start)
	 (time-point-after ~day1start day 1 ~day1end)
	 (temporally-intersects (whenfn ~visit) 
				(time-interval-fn ~day1start ~day1end))
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|:located ~visit ?loc))
Answer pattern:
   Tony Hall went to ?loc

English:
   On his first full day in Iraq, who did Tony Hall visit?
Query:
    (and (|http://reliant.teknowledge.com/DAML/SUMO.daml#|:|subProcess| 
          ~mtg |http://www.ksl.stanford.edu/projects/Aquaint/TonyHall.daml#|::|TonyHallVisitsIraq|)
         (location-of 
          (starting-point (whenfn |http://www.ksl.stanford.edu/projects/Aquaint/TonyHall.daml#|::|TonyHallVisitsIraq|)) 
          ~earliest-starting-pt ~latest-starting-pt)
         (time-point-after ~earliest-starting-pt day 1 ~onedaylater)
         (first-time-point ~onedaylater day ~day1start)
         (time-point-after ~day1start day 1 ~day1end)
         (temporally-intersects (whenfn ~mtg) 
				(time-interval-fn ~day1start ~day1end))
         (|http://www.w3.org/1999/02/22-rdf-syntax-ns#|::type ~mtg 
          |http://reliant.teknowledge.com/DAML/SUMO.daml#|::|Meeting|)
         (|http://reliant.teknowledge.com/DAML/SUMO.daml#|::agent ~mtg ?agt)
         (/= ?agt |http://www.ksl.stanford.edu/projects/Aquaint/TonyHall.daml#|::|TonyHall|))
Answer pattern:
   Tony hall visited ?agt

English:
   When did Tony Hall arrive and depart Iraq?
Query:
    (and (location-of 
	  (starting-point (whenfn |http://www.ksl.stanford.edu/projects/Aquaint/TonyHall.daml#|::|TonyHallVisitsIraq|)) 
	  ?min-arrive-time ?max-arrive-time)
	 (location-of 
	  (ending-point (whenfn |http://www.ksl.stanford.edu/projects/Aquaint/TonyHall.daml#|::|TonyHallVisitsIraq|)) 
	  ?min-depart-time ?max-depart-time))
Answer pattern:
   Tony hall arrived between ?min-arrive-time and ?max-arrive-time and he left between ?min-depart-time ?max-depart-time

English:
   Who accompanied Tony Hall on his visit?
Query:
    (and (|http://www.ksl.stanford.edu/projects/Aquaint/AquaSumo.daml#|::experiencer
	  |http://www.ksl.stanford.edu/projects/Aquaint/TonyHall.daml#|::|TonyHallVisitsIraq| ?who) 
	 (/= ?who |http://www.ksl.stanford.edu/projects/Aquaint/TonyHall.daml#|::|TonyHall|))
Answer pattern:
   ?who accompanied Tony Hall on his visit.

English:
   On Tony Hall's third full day in Iraq, where did he go?
   Note: there are currently no answers to this query. Strangely, none
   of the articles in our data covers the third day of his visit.
Query:
    (and (|http://reliant.teknowledge.com/DAML/SUMO.daml#|:|subProcess| ~visit 
	  |http://www.ksl.stanford.edu/projects/Aquaint/TonyHall.daml#|::|TonyHallVisitsIraq|)
	 (location-of 
	  (starting-point (whenfn |http://www.ksl.stanford.edu/projects/Aquaint/TonyHall.daml#|::|TonyHallVisitsIraq|)) 
	  ~earliest-starting-pt ~latest-starting-pt)
	 (time-point-after ~earliest-starting-pt day 3 ~threedayslater)
	 (first-time-point ~threedayslater day ~day3start)
	 (time-point-after ~day3start day 1 ~day3end)
	 (temporally-intersects (whenfn ~visit) (time-interval-fn ~day3start ~day3end))
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|:located ~visit ?loc))
Answer pattern:
   Tony Hall went to ?loc on his third full day in Iraq.

English:
   What are the hospitals and their locations that Tony Hall visited in Iraq?
Query:
    (and (|http://reliant.teknowledge.com/DAML/SUMO.daml#|:|subProcess| 
	  ~visit |http://www.ksl.stanford.edu/projects/Aquaint/TonyHall.daml#|::|TonyHallVisitsIraq|)
	 (|http://www.w3.org/1999/02/22-rdf-syntax-ns#|::type ~visit 
	  |http://www.ksl.stanford.edu/projects/Aquaint/AquaSumo.daml#|::|Visit|)
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|:located ~visit ?hosp)
	 (|http://www.w3.org/1999/02/22-rdf-syntax-ns#|::type ?hosp 
	  |http://www.ksl.stanford.edu/projects/Aquaint/AquaSumo.daml#|::|Hospital|)
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|:located ?hosp ?loc))
Answer pattern:
   Tony Hall went to ?hosp located in ?loc

English:
   What other (non-hospital) facilities did Tony Hall visit?
   Note: This query takes a while.
Query:
    (and (|http://reliant.teknowledge.com/DAML/SUMO.daml#|:|subProcess| 
	  ~visit |http://www.ksl.stanford.edu/projects/Aquaint/TonyHall.daml#|::|TonyHallVisitsIraq|)
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|:located ~visit ?facility)
	 (|http://www.w3.org/1999/02/22-rdf-syntax-ns#|::type ?facility  
	  |http://reliant.teknowledge.com/DAML/SUMO.daml#|:|Building|)
	 (|http://www.w3.org/1999/02/22-rdf-syntax-ns#|::type ?facility 
	  |http://www.ksl.stanford.edu/projects/Aquaint/AquaSumo.daml#|::|HospitalComplement|)
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|:located ?facility ?loc))
Answer pattern:
   Tony Hall visited ?facility located in ?loc

English:
   What is the distance (in miles) between Baghdad and Basra?
Query:
    (and (distance 
	  |http://reliant.teknowledge.com/DAML/CountriesAndRegions.daml#|::|BaghdadIraq| 
	  |http://reliant.teknowledge.com/DAML/CountriesAndRegions.daml#|::|BasraIraq| ~dist) 
	 (magnitude ~dist mile ?miles))
Answer pattern:
   Baghdad and Basra are ?miles apart

English:
   How did Tony Hall get to Baghdad?
Query:
    (and (|http://www.w3.org/1999/02/22-rdf-syntax-ns#|::type 
	  ~trav |http://www.ksl.stanford.edu/projects/Aquaint/AquaSumo.daml#|::|Travel|) 
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|::patient 
	  ~trav |http://www.ksl.stanford.edu/projects/Aquaint/TonyHall.daml#|::|TonyHall|) 
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|::destination ~trav 
	  |http://reliant.teknowledge.com/DAML/CountriesAndRegions.daml#|::|BaghdadIraq|) 
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|::origin ~trav ?origin) 
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|::instrument ~trav ?transport))
Answer pattern:
   Tony Hall went to Baghdad from ?origin via ?transport

English:
   Follow-up question: How did Tony Hall get to Amman, Jordan?
Query:
    (and (|http://www.w3.org/1999/02/22-rdf-syntax-ns#|::type 
	  ~trav |http://www.ksl.stanford.edu/projects/Aquaint/AquaSumo.daml#|::|Travel|) 
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|::patient ~trav 
	  |http://www.ksl.stanford.edu/projects/Aquaint/TonyHall.daml#|::|TonyHall|)
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|::destination ~trav 
	  |http://reliant.teknowledge.com/DAML/CountriesAndRegions.daml#|::|AmmanJordan|) 
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|::instrument ~trav ?transport))
Answer pattern:
   Tony Hall travelled to Amman via ?transport

English:
   What was the purpose of Congressman Hall's visit?
Query:
    (|http://www.ksl.stanford.edu/projects/Aquaint/AquaSumo.daml#|:|purposeForAgent| 
     |http://www.ksl.stanford.edu/projects/Aquaint/TonyHall.daml#|::|TonyHallVisitsIraq| 
     ?purpose)
Answer pattern:
   Tony Hall visited Iraq because of ?purpose

English:
   Why did the Iraqi government give Tony Hall permission to visit Iraq?
Query:
    (and (|http://www.ksl.stanford.edu/projects/Aquaint/AquaSumo.daml#|:permission
	  |http://www.ksl.stanford.edu/projects/Aquaint/TonyHall.daml#|::|TonyHallVisitsIraq| 
	  ~permission) 
	 (|http://www.ksl.stanford.edu/projects/Aquaint/AquaSumo.daml#|:rationale 
	  ~permission ?rationale))
Answer pattern:
   The Iraqi government gave Tony Hall permission because ?rationale

English:
   What is Tony Hall's opinion on UN sanctions?
Query:
    (and (|http://www.w3.org/1999/02/22-rdf-syntax-ns#|::type ~evt 
	  |http://reliant.teknowledge.com/DAML/SUMO.daml#|::|Communication|) 
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|::agent ~evt 
	  |http://www.ksl.stanford.edu/projects/Aquaint/TonyHall.daml#|::|TonyHall|)
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|::patient ~evt ~info)
	 (|http://www.w3.org/1999/02/22-rdf-syntax-ns#|::type ~info 
	  |http://reliant.teknowledge.com/DAML/SUMO.daml#|::|Reasoning|)
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|::patient ~info 
	  |http://www.ksl.stanford.edu/projects/Aquaint/AquaSumo.daml#|:|UnitedNationsEconomicSanctionsAgainstIraq|) 
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|::result ~info ?opinion))
Answer pattern:
   Tony Hall's opinion on sanctions is ?opinion

English:
   What are Tony Hall's recommendations regarding the Iraqi humanitarian crisis?
Query:
    (and (|http://www.w3.org/1999/02/22-rdf-syntax-ns#|::type ~evt 
	  |http://reliant.teknowledge.com/DAML/SUMO.daml#|::|Communication|) 
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|::agent ~evt 
	  |http://www.ksl.stanford.edu/projects/Aquaint/TonyHall.daml#|::|TonyHall|)
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|::patient ~evt ~info)
	 (|http://www.w3.org/1999/02/22-rdf-syntax-ns#|::type ~info 
	  |http://reliant.teknowledge.com/DAML/SUMO.daml#|::|Reasoning|) 
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|::patient ~info 
	  |http://www.ksl.stanford.edu/projects/Aquaint/AquaSumo.daml#|:|IraqHumanitarianCrisis|) 
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|::result ~info ?opinion))
Answer pattern:
   Tony Hall's recommendation is ?opinion

English:
   According to Tony Hall, what dual-use items are in short supply? Why are they important?
Query:
    (and (|http://www.w3.org/1999/02/22-rdf-syntax-ns#|::type ~evt 
	  |http://reliant.teknowledge.com/DAML/SUMO.daml#|::|Communication|) 
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|::agent ~evt
	  |http://www.ksl.stanford.edu/projects/Aquaint/TonyHall.daml#|::|TonyHall|) 
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|::patient ~evt ~info)
	 (|http://www.w3.org/1999/02/22-rdf-syntax-ns#|::type ~info
	  |http://reliant.teknowledge.com/DAML/SUMO.daml#|::|Reasoning|)
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|::patient ~info 
	  |http://reliant.teknowledge.com/DAML/CountriesAndRegions.daml#|::|Iraq|)
	 (|http://reliant.teknowledge.com/DAML/SUMO.daml#|::patient ~info 
	  ?dual-use-item)
	 (|http://www.w3.org/2000/01/rdf-schema#|::|subClassOf| ?dual-use-item
	  |http://www.ksl.stanford.edu/projects/Aquaint/AquaSumo.daml#|:|DualUseObject|) 
	 (|http://www.w3.org/2000/01/rdf-schema#|::|subClassOf| ?dual-use-item
	  ~restr)
	 (|http://www.daml.org/2001/03/daml+oil#|::|onProperty| ~restr 
	  |http://reliant.teknowledge.com/DAML/SUMO.daml#|::|hasPurpose|) 
	 (|http://www.daml.org/2001/03/daml+oil#|::|hasValue| ~restr ?import))
Answer pattern:
   Tony Hall says ?dual-use-item is in short supply, important because ?import

For the wines KB:

Premise:
   rdf:type tkb:NEW-COURSE tkb:SEAFOOD-COURSE
   tkb:FOOD tkb:NEW-COURSE tkb:CRAB
   tkb:DRINK tkb:NEW-COURSE tkb:W1
Query:
   tkb:COLOR tkb:W1 ?x

The DQL server will reason that W1 is a white wine.

For the DAML Example KB:

Premise:
   rdf:type tkb:Fred tkb:Person
Query:
   rdf:type tkb:Fred ?x

The DQL server will reason that Fred is an Animal, Person, and a few other things.

For the Taliban Temporal KB:

Query:
   (duration-in-units Iranian-Taliban-crisis day ?lower-bound ?upper-bound)

Query:
   (duration-in-units Iranian-Taliban-crisis week ?lower-bound ?upper-bound)

Query:
   (location-of (starting-point Iranian-Taliban-crisis) ?lower-bound ?upper-bound)

Query:
   (during Iran-declares-right-under-international-law-to-strike-Taliban ?evt)

Query:
   (during Iran-declares-right-under-international-law-to-strike-Taliban ?evt)

Query:
   (precedes ?evt Iran-warns-Taliban-and-Pakistan-of-major-regional-war)

Query:
   (and (precedes ?evt Iran-military-exercise) (location-of (ending-point ?evt) ?end-lower-bound ?end-upper-bound))

Query:
   (location-of (starting-point Occupation-of-mazar-e-sharif) ?lower-bound ?upper-bound)