AIR Abstract Syntax
From TAMI
Contents |
Notations
we specify the abstract syntax using the extended BNF used in OWL Abstract Syntax.
The abstract syntax is specified here by means of a version of Extended BNF, very similar to the EBNF notation used for XML [XML]. Terminals are quoted; non-terminals are bold and not quoted. Alternatives are either separated by vertical bars (|) or are given in different productions. Components that can occur at most once are enclosed in square brackets ([...]); components that can occur any number of times (including zero) are enclosed in braces ({...}). Whitespace is ignored in the productions here.
| semantics | example | notes |
|---|---|---|
| terminal term | ' term ' (?) | quoted string |
| non-terminal term | Term | bold but not quoted string |
| alternative terms | term1 | term2 | separated by vertical bar |
| term occurs at most once | [ term ] | enclosed by square brackets |
| term occurs any number of times (including zero) | { term } | enclosed by curly brackets |
| grouping of terms? | ( term1 | term2 )? | enclosed by round brackets |
AIR 2.0
Abstract Syntax
Policy-document is the start element.
1. Action-container ::= Rule-reference | Assertion.
2. Action-nl-description ::= 'description(' { (Variable | String) blank-space} ')'.
3. Alphanumeric ::= concatenation of alpha-numeric characters
4. Annotation ::= ??
5. Assertion ::= 'assert(' [Action-nl-description] 'statement(' Assertion-stmt {Assertion-stmt} ')' ')'.
6. Assertion-stmt ::= 'Triple(' Subject-wo-blank Property Object-wo-blank ')'.
7. Blank-node ::= '_:' Alphanumeric.
8. Blank-space ::= blank .
9. Condition ::= {Existential-variable-declaration} Condition-stmt {Condition-stmt}.
10. Condition-actions ::= 'if (' [Condition] ')' ['matched-graph(' Graph-variable ')']
- ('then(' Action-container ')' | 'else(' Action-container ')') {'then(' Action-container ')' | 'else(' Action-container ')'}.
- ('then(' Action-container ')' | 'else(' Action-container ')') {'then(' Action-container ')' | 'else(' Action-container ')'}.
11. Condition-stmt ::= 'Triple(' Subject Property Object ')'.
12. dataLiteral ::= as defined in OWL Abstract Syntax 1
13. Existential-variable-declaration ::= 'forSome(' Variable ')'.
14. Global-variable-declaration ::= {Universal-variable-declaration}.
15. Graph-variable ::= Variable.
16. Hidden-or-ellipsed ::= 'hidden' | 'ellipsed'.
17. Object ::= Object-wo-blank | Blank-node.
18. Object-wo-blank := URIReference | dataLiteral | Variable.
19. Policy ::= 'Policy(' Policy-id {Annotation} Rule-reference { Rule-reference } ')'.
20. Policy-document ::= (Global-variable-declaration | Policy | Rule-def) {Global-variable-declaration | Policy | Rule-def}.
21. Policy-id ::= URIReference.
22. Property ::= URIReference | Variable.
23. Rule-def := 'Rule(' Rule-id [Hidden-or-ellipsed] {Annotation} Condition-actions ')'.
24. Rule-id ::= URIReference.
25. Rule-reference ::= 'rule(' [Action-nl-description] (Rule-id | 'Rule(' {Annotation} Condition-actions ')') ')'.
26. Subject ::= Subject-wo-blank | Blank-node.
27. Subject-wo-blank := URIReference | Variable.
28. Universal-variable-declaration ::= 'forAll(' Variable ')'.
29. URIReference ::= as defined in OWL Abstract Syntax 1
30. Variable ::= URIReference.
Examples
Example 1
Policy
@forAll :PERSON1, :PERSON2 .
:Policy1 a air:Policy;
air:rule [
air:if { :PERSON1 tamip:Has_Father :PERSON2. };
air:then
[ air:description (:PERSON1 "has parent" :PERSON2 " because of their has_father relation" );
air:assertion
[ air:statement [ { :PERSON1 air:compliant-with :Demo1_Policy ;
tamip:Has_Parent :PERSON2.} ] ] ].
Policy in Abstract-syntax
forAll(:PERSON1).
forAll(:PERSON2).
Policy (
Policy1
rule (
Rule (
if( Triple(:PERSON1 tamip:Has_Father :PERSON2) )
then (
assert (
description (:PERSON1 "has parent" :PERSON2 " because of their has_father relation")
statement( Triple(:PERSON1 air:compliant-with :Demo1_Policy)
Triple(:PERSON1 tamip:Has_Parent :PERSON2 )
)
)
)
)
).
Example 2
Policy
@forAll :PERSON, :CITY, :NY_STATE_ID, :G1 .
Policy1 a air:Policy;
air:rule :state-residency-rule.
:state-residency-rule a air:Belief-rule;
air:if { :PERSON tamip:Lives_in_city :CITY .
:CITY tamip:Has_state :NY . };
air:then [ air:rule :state-id-check ].
:state-id-check a air:Hidden-rule;
rdfs:label "state id check rule";
air:if { :PERSON tamip:Has_ny_state_id :NY_STATE_ID. };
air:then
[ air:assert
[ air:description ( :PERSON "is a new york state resident" );
air:statement { :PERSON air:compliant-with :Demo7_Policy1.} ] ].
Policy in Abstract-syntax
forAll(:PERSON).
forAll(:CITY).
forAll(:NY_STATE_ID).
forAll(:G1).
Policy ( Policy1 rule ( :state-residency-rule ) ).
Rule ( :state-residency-rule
if ( Triple (:PERSON tamip:Lives_in_city :CITY) Triple (:CITY tamip:Has_state :NY) )
then ( rule ( :state-id-check ) ) ).
Rule ( :state-id-check
'hidden'
if ( Triple ( :PERSON tamip:Has_ny_state_id :NY_STATE_ID ) )
then (
description ( :PERSON "is a new york state resident" )
assert ( statement ( Triple (:PERSON air:compliant-with :Demo7_Policy1 ) ) ) ) )
AIR 1.0
Abstract Syntax
- Policy-Document ::= Global-variable-declaration Rule-container {Rule-container}.
- Global-variable-declaration ::= {Universal-variable-declaration}.
- Existential-variable-declaration ::= 'forSome(' Variable ')'.
- Universal-variable-declaration ::= 'forAll(' Variable ')'.
- Rule-container ::= Policy | Rule.
- Policy ::= 'Policy(' PolicyID [Annotation] 'rule(' RuleID | 'Rule(' Rule-content ')' ')' {'rule(' RuleID | 'Rule(' Rule-content ')' ')'}')'.
- Rule := 'Rule(' RuleID Rule-content ')'.
- Rule-content := [Annotation] [Hide-justification] Pattern-action.
- Hide-justification ::= 'true'| 'false'.
- Pattern-action ::= Action| Pattern Action ['alt(' Action ')'] | Pattern 'alt('Action')').
- Pattern ::= 'pattern(' N3-Pattern ')' ['matched-graph(' Graph-variable ')'].
- N3-pattern ::= {Universal-variable-declaration|Existential-variable-declaration} Statement {Statement }.
- Statement ::= 'Triple(' (Term|Blank) Term (Term|Blank) ')'.
- Action ::= {'rule(' RuleID | 'Rule(' Rule-content ')' ')'} ['assert(' Asserted-Statement {Asserted-Statement} ')’] [Action-Description] [Justification].
- Asserted-Statement ::= 'Triple(' Term Term Term ')'.
- Justification ::= 'justification(' 'rule-id(' RuleID ')' 'antecedent(' Graph-variable ')' ')'.
- Action-description ::= { (Variable|String) blank-space}.
- Term ::= URIReference | Variable.
- PolicyID ::= URIReference.
- RuleID ::= URIReference.
- Graph-variable ::= Variable.
- Variable ::= URIReference.
- Blank ::= '_:' string ???
- Annotation ::=??
- URIReference ::= ??
- String ::= ??

