Simple AIR Example
All DIG members are allowed to view resources owned by the DIG group
:DIGPolicy a air:Policy;
air:rule :DAP-1.
:DAP-1 a air:BeliefRule;
rdfs:label "DIG Rule #1";
air:variable :REQ, :REQUESTER, :RESOURCE, :MEMBER, :MEMBERLIST;
air:pattern {
:REQ a air:Request;
foaf:openid :REQUESTER;
air:resource :RESOURCE.
:DIG data:owns :RESOURCE.
};
air:description (:REQ " is a request made by a requester with openid, " :REQUESTER ", for DIG resource " :RESOURCE);
air:rule :DAP-2.
:DAP-2 a air:BeliefRule;
rdfs:label "DIG Rule #2";
air:pattern {
:DIG foaf:member :MEMBERLIST.
:MEMBER list:in :MEMBERLIST.
:MEMBER a foaf:Person;
foaf:openid :REQUESTER.
};
air:description ("The requester with openid, " :REQUESTER ", is a DIG member");
air:assert{ :REQ air:compliant-with :DIGPolicy }.
Overriding Automatic Justification
:SomeOtherRule a air:BeliefRule;
air:variable :REQ, :G1;
air:matched-graph :G1;
air:pattern { :REQ a air:Request; };
air:rule :DAP-1.
:DAP-1 a air:BeliefRule;
...
air:rule :DAP-2.
:DAP-2 a air:BeliefRule;
rdfs:label "DIG Rule #2";
air:pattern {
:DIG foaf:member :MEMBERLIST.
:MEMBER list:in :MEMBERLIST.
:MEMBER a foaf:Person;
foaf:openid :REQUESTER.
};
air:description ("The request is valid");
air:assertion [
air:statement { :REQ air:compliant-with :DIGPolicy };
air:justification [
air:rule-id :SomeOtherRule;
air:antecedent :G1
]
].
MA Disability Discrimination Law
No otherwise qualified handicapped individual shall, solely by
reason of his handicap, be excluded from participation in, be denied
the benefits of, or be subject to discrimination under any program or
activity within the Commonwealth
More info: http://www.mass.gov/legis/const.htm#cart114.htm
:MA_Disability_Discrimination_Policy a air:Policy;
air:variable :EVENT, :REQUESTER, :ACTOR, :REASON, :REQUEST, :INSTRUCTION;
air:rule [
air:pattern {
:EVENT a tami:RefuseRequest;
tami:reply-to :REQUEST;
tami:receiver :REQUESTER;
tami:reason :REASON.
};
air:rule [
air:pattern {
:REQUEST tami:instruction :INSTRUCTION;
a tami:Request.
:INSTRUCTION tami:intended_beneficiary :REQUESTER;
a tami:BenefitInstruction.
:REQUESTER tami:location tami:MA.
};
air:rule [
air:pattern { :EVENT a tami:RefuseRequest;
tami:reason :REASON.
:REASON tami:category tami:HealthInformation };
air:assert { :EVENT air:non-compliant-with :MA_Disability_Discrimination_Policy }
]
];
].