Re: [poe] On 2.6.8 Rule Active State Processing

> Perhaps, the rule-level "Active"/"Not-Active" should be changed to "Applicable"/"Not-Applicable" to reduce any potential confusion with the states of the individual rules?

well, depending on the use case we may actually need both:

## UC1: Identify all _(currently) active_ rules of a policy 

https://www.w3.org/2016/poe/wiki/Evaluator:
> The task of an ODRL Evaluator is to determine which ~~Permission(s) or Prohibitions~~ _Rules_ are in effect. 

**Example:**
```turtle
:policy101 a odrl:Set ;
    ### active ###
    odrl:permission [ 
        odrl:action odrl:print ;
    ] .

:policy102 a odrl:Set ;
    ### not active ###
    odrl:permission [ 
        odrl:action odrl:print ;
        odrl:constraint [ 
            odrl:leftOperand odrl:dateTime;
            odrl:operator odrl:lt ;
            odrl:rightOperand "2000-12-31" ;
        ]
    ] .

:policy103 a odrl:Set ;
    ### active ###
    odrl:permission [
        odrl:action odrl:print ;
    ] ;

    ### active ###
    odrl:prohibition [ 
        odrl:action odrl:display ;
    ] .

:policy104 a odrl:Set ;
    ### not active ###
    odrl:obligation [ 
        odrl:action odrl:inform ;
        odrl:constraint [ 
            odrl:leftOperand odrl:dateTime;
            odrl:operator odrl:lt ;
            odrl:rightOperand "2000-12-31" ;
        ]
    ] ;

    ### active ###
    odrl:obligation [ 
        odrl:action odrl:compensate;
        odrl:constraint [ 
            odrl:leftOperand odrl:dateTime;
            odrl:operator odrl:gt ;
            odrl:rightOperand "2000-12-30" ;
        ]
    ] .
```

----

## UC2: Determine whether an ODRL Rule is _applicable_ for a given asset and/or assignee

>From [ODRL Evaluator Rules by @philA](https://lists.w3.org/Archives/Public/public-poe-wg/2017May/0042.html):
> An ODRL Evaluator determines **whether an ODRL Rule is in effect for a 
given asset**. It MAY assume that the given ODRL Policy has been validated 
by an ODRL Validator.
[...]
The latter example implies that an OE must also be able to accept a 
third parameter: the assignee. So you can ask it questions like, **"is 
Policy X in effect for Asset Y for Assignee Z?"**

as well as 

@nitmws in [How Rules become Active](https://github.com/w3c/poe/issues/221) #221:
> This raises the question: a Rule may have also an assigner and an assignee and should have a target - should they be matched too against the value of a planned action?
>
> In other words: **is a Rule with assignee = "http://examples.com/company/4711" active if it is evaluated by assignee = "http://examples.com/company/9912"?**
>
> I guess ODRL users will expect it is not-active, as this is the same situation as with not satisfied Constraint(s).

**Example:**
```turtle
:policy201 a odrl:Set ;
    ### active ###
    odrl:permission [ 
        odrl:target :Asset1 ;
        odrl:assignee :Alice ;
        odrl:action odrl:print ;
    ] .
```
**Q:** Is `:Alice` permitted to print `:Asset1`?
**A:** Yes (permission is active and applicable)

**Q:** Is `:Bob` permitted to print `:Asset1`?
**A:** n/a (no applicable permission)

**Q:** Is `:Alice` permitted to print `:Asset2`? 
**A:** n/a (no applicable permission)

----

```turtle
:policy202 a odrl:Set ;
    ### not active ###
    odrl:permission [
        odrl:target :Asset1 ;
        odrl:assignee :Alice ; 
        odrl:action odrl:print ;
        odrl:constraint [ 
            odrl:leftOperand odrl:dateTime;
            odrl:operator odrl:lt ;
            odrl:rightOperand "2000-12-31" ;
        ]
    ] .
```
**Q:** Is `:Alice` permitted to print `:Asset1`? 
**A:** no or n/a (permission is applicable but not active)

**Q:** Is `:Bob` permitted to print `:Asset1`?
**A:** n/a (no applicable permission)

**Q:** Is `:Alice` permitted to print `:Asset2`?
**A:** n/a (no applicable permission)

----

```turtle 
:policy203 a odrl:Set ;
    ### active ###
    odrl:permission [
        odrl:target :Asset1 ;
        odrl:assignee :Alice ; 
        odrl:action odrl:print ;
    ] ;

    ### active ###
    odrl:prohibition [ 
        odrl:target :Asset2 ;
        odrl:assignee :Alice, :Bob ;
        odrl:action odrl:display ;
    ] .
```
**Q:** Is `:Alice` permitted to print `:Asset1`? 
**A:** yes (permission is active and applicable)

**Q:** Is `:Bob` permitted to print `:Asset1`? 
**A:** n/a (no applicable permission)

**Q:** Is `:Alice` permitted to display `:Asset2`? 
**A:** no (prohibition is active and applicable)

**Q:** Is `:Bob` permitted to display `:Asset2`? 
**A:** no (prohibition is active and applicable)

----

## UC3: Conflict Detection/Resolution 

http://w3c.github.io/poe/model/#conflict:
> The conflict property is used to establish strategies to resolve conflicts that arise from the merging of Policies or conflicts between Permissions and Prohibitions in the same Policy. 

**Example:**
```turtle
:policy301 a odrl:Set ;
    ### active ###
    odrl:permission [
        odrl:target :Asset1 ;
        odrl:assignee :Alice ; 
        odrl:action odrl:print ;
    ] ;

    ### active ###
    odrl:prohibition [ 
        odrl:target :Asset1 ;
        odrl:assignee :Alice ;
        odrl:action odrl:print ;
    ] .
```
**Q:** Is `:policy301` valid?
**A:** no (both permission and prohibition are active, apply to the same assignee and asset, and are defined for the same action)

----

```turtle
:policy302 a odrl:Set ;
    ### not active ###
    odrl:permission [
        odrl:target :Asset1 ;
        odrl:assignee :Alice ; 
        odrl:action odrl:print ;
        odrl:constraint [ 
            odrl:leftOperand odrl:dateTime;
            odrl:operator odrl:lt ;
            odrl:rightOperand "2000-12-31" ;
        ]
    ] ;
 
    ### active ###
    odrl:prohibition [ 
        odrl:target :Asset1 ;
        odrl:assignee :Alice ;
        odrl:action odrl:print ;
    ] .
```
**Q:** Is `:policy302` valid?
**A:** yes (both permission and prohibition are defined for the same action and apply to the same assignee and asset, but only the prohibition is active)

----

```turtle 
:policy303 a odrl:Set ;
    ### active ###
    odrl:permission [
        odrl:target :Asset1 ;
        odrl:assignee :Alice ; 
        odrl:action odrl:print ;
    ] ;

    ### active ###
    odrl:prohibition [ 
        odrl:target :Asset1 ;
        odrl:assignee :Bob ;
        odrl:action odrl:print ;
    ] .
```
**Q:** Is `:policy303` valid?
**A:** yes (both permission and prohibition are active, apply to the same asset, and are defined for the same action, but don't apply to the same assignee)


(more on that tomorrow)

-- 
GitHub Notification of comment by simonstey
Please view or discuss this issue at https://github.com/w3c/poe/issues/226#issuecomment-325945568 using your GitHub account

Received on Wednesday, 30 August 2017 10:06:19 UTC