Previous topic  Top  Next topic  Print this Topic

Provenance Option for Queries: connectorprovenance


This option for queries returns provenance information on how the answers depend on the facts in connected information sources. A list of such provenance information is given for each answer. This list provides the access literals and the variable substitutions for these access literals. Let’s have a look at a simple example.The following query requests the employee id and the last name of employees in the “Employees” table of the database "data:1433_Northwind_test"

?- _dbaccessuser("dbo"."Employees","F"("EmployeeID",?VAR1,"LastName",?VAR2),"data:1433_Northwind_test").

 We get ansers like

?VAR1= 1, ?VAR2 = "Davolio ",

?VAR1= 9, ?VAR2 = "Dodsworth",

?VAR1= 8, ?VAR2 = "Callahan"

 If we add the connector provenance option to the query:

@{options[connectorprovenance(?Z)]} ?- _dbaccessuser("dbo"."Employees","F"("EmployeeID",?VAR1,"LastName",?VAR2),"data:1433_Northwind_test").

 We get the variable ?Z bound to a list of instantiations of the _dbaccessuser predicate: 

?VAR1= 1, ?VAR2 = "Callahan", ?Z = [_dbaccessuser("dbo"."Employees","F"("EmployeeID",1,"LastName",”Davolio”),"data:1433_Northwind_test")] ?VAR1= 9, ?VAR2 = "Dodsworth", ?Z = [_dbaccessuser("dbo"."Employees","F"("EmployeeID",9,"LastName","Dodsworth"),"data:1433_Northwind_test")]


?VAR1= 8, ?VAR2 = "Callahan", ?Z = [_dbaccessuser("dbo"."Employees","F"("EmployeeID",8,"LastName","Callahan"),"data:1433_Northwind_test")]

Indicating that id = 1, last name = "Callahan", id = 9, last name = "Dodsworth", and id = 8, last name = "Callahan" has been found in the database which lead to our answers.