@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

@prefix math: <http://www.w3.org/2000/10/swap/math#> .
@prefix type: <http://dig.csail.mit.edu/2009/IARPA-PIR/generic#> .
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
@prefix list: <http://www.w3.org/2000/10/swap/list#> .
@prefix air: <http://dig.csail.mit.edu/TAMI/2007/amord/air#> .
@prefix db: <http//dig.csail.mit.edu/db#> .
@prefix s: <http://dig.csail.mit.edu/2009/IARPA-PIR/sparql#> .
@prefix : <http://dig.csail.mit.edu/2009/IARPA-PIR/Yotam_Work/Only_Ask_Policy#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.

#This policy only allows the user to use the ASK command.

@forAll :Q,:C, :S, :X.

:Only_Ask_Policy a air:Policy;
	air:label "Only Ask Policy";
	air:rule :Only_Ask_Rule1.

:Only_Ask_Rule1 a air:BeliefRule;
	air:label "Only Ask Rule 1";
	air:pattern {
              :Q a s:Query;
        	  s:Clause :C
       };
	air:description(:Q " is a SPARQL query.");
	air:rule :Only_Ask_Rule2.

:Only_Ask_Rule2 a air:BeliefRule;
	air:label "Only Ask Rule 2";
	air:pattern{
		:Q s:VarList :S.
		:S s:variable :X.
	};
	air:description(:Q " retrieves a variable. You are only allowed to retrieve a True/False value.");
	air:assert{:Q air:non-compliant-with :Only_Ask_Policy};
	air:alt [air:assert {:Q air:compliant-with :Only_Ask_Policy}].
