Skip to content

Latest commit

 

History

History

SQL

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

To setup the solution you should:

  • create a database;
  • run scripts.sql to create tables, views, and other SQL related objects
  • run page_compression.sql, to change compression scheme for the tables (optional step, which requires advanced SQL Server editions);
  • Continue to Persons, if you want to populate data with DBpedia Persons data set.

Play the game.

The initial call is like this:

declare @params xml;
declare @result xml;

execute Data.GetNextPredicates @params = @params, @result = @result output;

select @result;

This returns the first offers like this:

<question name="IsLivingPerson" />

Then the second request can be like this

declare @params xml = '
 <request>
   <question name="IsLivingPerson" answer="1"/>
 </request>';

declare @result xml;

execute Data.GetNextPredicates @params = @params, @result = @result output;

select @result;

This returns the second offers like this:

<question name="IsFootballPlayer" />

So, you will continue to add questions to request and fill answers until there is nothing to offer.

Once you descended to the last predicate, you can get entities matched:

declare @params xml = '
 <request>
   <question name="IsLivingPerson" answer="1"/>
   <question name="IsFootballPlayer" answer="1"/>
 </request>';

declare @result xml;

execute Data.GetEntities @params = @params;