From b7d7fe7efe59063d0c03b80a0d248dcd35685912 Mon Sep 17 00:00:00 2001 From: Serena Villata Date: Fri, 2 Dec 2016 15:56:28 +0100 Subject: [PATCH] Added @context to examples --- model/index.html | 195 ++++++++++++++++++++++++++++++----------------- 1 file changed, 126 insertions(+), 69 deletions(-) diff --git a/model/index.html b/model/index.html index fea57ec..ce4c233 100644 --- a/model/index.html +++ b/model/index.html @@ -150,15 +150,18 @@

Policy

{
-    "type": "http://www.w3.org/ns/odrl/2/Set",
+"@context": {
+    "odrl": "http://www.w3.org/ns/odrl/2/"
+    }
+    "type": "odrl:Set",
     "uid": "http://example.com/policy:1010",
     "permission": [{
         "target": "http://example.com/asset:9898",
-        "action": "http://www.w3.org/ns/odrl/2/read"
+        "action": "odrl:read"
     }],
     "prohibition": [{
         "target": "http://example.com/asset:9898",
-        "action": "http://www.w3.org/ns/odrl/2/reproduce"
+        "action": "odrl:reproduce"
     }]
 }
 
@@ -166,20 +169,23 @@

Policy

Example Use Case: A Policy of type Set states that the Asset http//example.com/asset:9898 is the target of the Permission reproduce, the Duty attribute to http://example.com/owner:9898 and the Prohibition commercialize. Two parties are involved, namely the Assigner of the Permissions and the Party to be attributed.

{
-    "type": "http://www.w3.org/ns/odrl/2/Set",
+"@context": {
+    "odrl": "http://www.w3.org/ns/odrl/2/"
+    }
+    "type": "odrl:Set",
     "uid": "http://example.com/policy:1010",
     "permission": [{
         "target": "http://example.com/asset:9898",
-        "action": "http://www.w3.org/ns/odrl/2/reproduce",
+        "action": "odrl:reproduce",
         "assigner": "http://example.com/assigner:88",
         "duty": [{
-                "action": "http://www.w3.org/ns/odrl/2/attribute",
+                "action": "odrl:attribute",
                 "attributedParty": "http://example.com/owner:9898"
         }]
     }],
     "prohibition": [{
         "target": "http://example.com/asset:9898",
-        "action": "http://www.w3.org/ns/odrl/2/commercialize"
+        "action": "odrl:commercialize"
     }]
 }
 
@@ -200,32 +206,38 @@

Policy Conflict

{
-    "type": "http://www.w3.org/ns/odrl/2/Set",
+"@context": {
+    "odrl": "http://www.w3.org/ns/odrl/2/"
+    }
+    "type": "odrl:Set",
     "uid": "http://example.com/policy:1212",
     "conflict": "perm",
     "permission": [{
         "target": "http://example.com/asset:1212",
-        "action": "http://www.w3.org/ns/odrl/2/reproduce",
-        "action": "http://www.w3.org/ns/odrl/2/use",
-        "action": "http://www.w3.org/ns/odrl/2/commercialize",
+        "action": "odrl:reproduce",
+        "action": "odrl:use",
+        "action": "odrl:commercialize",
         "assigner": "http://example.com/owner:181"
     }]
 }
 
{
-    "type": "http://www.w3.org/ns/odrl/2/Set",
+"@context": {
+    "odrl": "http://www.w3.org/ns/odrl/2/"
+    }
+    "type": "odrl:Set",
     "uid": "http://example.com/policy:1213",
     "conflict": "prohibit",
     "permission": [{
         "target": "http://example.com/asset:1212",
-        "action": "http://www.w3.org/ns/odrl/2/reproduce",
+        "action": "odrl:reproduce",
         "assigner": "http://example.com/owner:182"
     }]
     "prohibition": [{
         "target": "http://example.com/asset:1212",
-        "action": "http://www.w3.org/ns/odrl/2/commercialize",
-        "action": "http://www.w3.org/ns/odrl/2/display"
+        "action": "odrl:commercialize",
+        "action": "odrl:display"
     }]
 }
@@ -251,7 +263,10 @@

Undefined Policy

 {
-    "type": "http://www.w3.org/ns/odrl/2/Set",
+    "@context": {
+    "odrl": "http://www.w3.org/ns/odrl/2/"
+    }
+    "type": "odrl:Set",
     "uid": "http://example.com/policy:8888",
     "undefined": "invalid",
     "permission": [{
@@ -303,48 +318,60 @@ 

Policy Inheritance

{
-    "type": "http://www.w3.org/ns/odrl/2/Set",
+ "@context": {
+    "odrl": "http://www.w3.org/ns/odrl/2/"
+    }
+    "type": "odrl:Set",
     "uid": "http://example.com/parent_policy:1111",
     "inheritAllowed": true,
     "permission": [{
         "target": "http://example.com/asset:1111",
-        "action": "http://www.w3.org/ns/odrl/2/reproduce",
+        "action": "odrl:reproduce",
         "assigner": "http://example.com/owner:1818"
     }]
 }
 
{
-    "type": "http://www.w3.org/ns/odrl/2/Set",
+"@context": {
+    "odrl": "http://www.w3.org/ns/odrl/2/"
+    }
+    "type": "odrl:Set",
     "uid": "http://example.com/parent_policy:2222",
     "inheritAllowed": true,
     "permission": [{
         "target": "http://example.com/asset:3333",
-        "action": "http://www.w3.org/ns/odrl/2/distribute",
+        "action": "odrl:distribute",
         "assigner": "http://example.com/owner:1919"
     }]
 }
{
-    "type": "http://www.w3.org/ns/odrl/2/Set",
+"@context": {
+    "odrl": "http://www.w3.org/ns/odrl/2/"
+    }
+    "type": "odrl:Set",
     "uid": "http://example.com/child_policy:2222",
     "inheritFrom": "http://example.com/parent_policy:1111",
     "permission": [{
         "target": "http://example.com/asset:2222",
-        "action": "http://www.w3.org/ns/odrl/2/read",
+        "action": "odrl:read",
         "assigner": "http://example.com/owner:1818",
         "assignee": "http://example.com/assignee:88"
     }]
 }
{
-    "type": "http://www.w3.org/ns/odrl/2/Set",
+"@context": {
+    "odrl": "http://www.w3.org/ns/odrl/2/"
+    }
+    "type": "odrl:Set",
     "id": "http://example.com/child_policy:1111",
     "inheritFrom": "http://example.com/parent_policy:2222",
     "permission": [{
         "target": "http://example.com/asset:4444",
-        "action": "http://www.w3.org/ns/odrl/2/play",
-        "action": "http://www.w3.org/ns/odrl/2/distribute",
+        "action": "odrl:play",
+        "action": "odrl:distribute",
         "assigner": "http://example.com/owner:1919",
         "assignee": "http://example.com/assignee:88"
     }]
@@ -385,11 +412,14 @@ 

Relation

Example Use Case: The Party http//example.com/guest:0001 needs to display the target Asset http://example.com/asset:3333, but she needs to be granted with the permission to do so. This request can be implemented through a Policy of the type Request asking for the permission to display Asset http://example.com/asset:3333.

{
-    "type": "http://www.w3.org/ns/odrl/2/Request",
+ "@context": {
+    "odrl": "http://www.w3.org/ns/odrl/2/"
+    }
+    "type": "odrl:Request",
     "uid": "http://example.com/policy:3333",
     "permission": [{
         "target": "http://example.com/asset:3333",
-        "action": "http://www.w3.org/ns/odrl/2/display",
+        "action": "odrl:display",
         "assignee": "http://example.com/guest:0001"
     }]
 }
@@ -400,12 +430,15 @@

Relation

{
-    "type": "http://www.w3.org/ns/odrl/2/Set",
+ "@context": {
+    "odrl": "http://www.w3.org/ns/odrl/2/"
+    }
+    "type": "odrl:Set",
     "uid": "http://example.com/policy:1011",
     "permission": [{
         "target": "http://example.com/archive1011",
         "x:collection": "http://example.com/x/database",
-        "action": "http://www.w3.org/ns/odrl/2/index"
+        "action": "odrl:index"
     }]
 }
@@ -452,15 +485,18 @@

Role

Example Use Case: The target Asset http://example.com/asset:myPhotos:football4444 are photos posted to a Social Network site by the assigner and owner of the photos http://example.com/myPhoto:assigner44. The assignee is a Party group http://example.com/myPhoto:assignee:footballfans44, and represents the football fan club members, who are each allowed to display the photos.

{
-    "type": "http://www.w3.org/ns/odrl/2/Agreement",
+"@context": {
+    "odrl": "http://www.w3.org/ns/odrl/2/"
+    }
+    "type": "odrl:Agreement",
     "uid": "http://example.com/policy:4444",
     "permission": [{
         "target": "http://example.com/asset:myPhotos:football4444",
-        "action": "http://www.w3.org/ns/odrl/2/display",
+        "action": "odrl:display",
         "assigner": "http://example.com/myPhoto:assigner44",
         "assignee": [{
                 "uid": "http://example.com/myPhoto:assignee:footballfans44",
-                "scope": "http://www.w3.org/ns/odrl/2/group"	
+                "scope": "odrl:group"	
         }]
     }]
 }
@@ -486,14 +522,17 @@

Permission

Example Use Case: The ticket Policy expresses the play Permission for the target Asset http//example.com/game:9090, stating that the Ticket is valid until the end of the year 2016. Any valid holder of this ticket may exercise this Permission.

{
-    "type": "http://www.w3.org/ns/odrl/2/Ticket",
+ "@context": {
+    "odrl": "http://www.w3.org/ns/odrl/2/"
+    }
+    "type": "odrl:Ticket",
     "uid": "http://example.com/policy:9090",
     "permission": [{
         "target": "http://example.com/game:9090",
-        "action": "http://www.w3.org/ns/odrl/2/play",
+        "action": "odrl:play",
         "constraint": [{
-            "name": "http://www.w3.org/ns/odrl/2/dateTime",
-            "operator": "http://www.w3.org/ns/odrl/2/lteq",
+            "name": "odrl:dateTime",
+            "operator": "odrl:lteq",
             "rightOperand": "2016-12-31"
         }]
     }]
@@ -516,18 +555,21 @@ 

Prohibition

Example Use Case: The owner and assigner of a target Asset http://example.com/photoAlbum:55 needs an Agreement Policy expressing with both a Permission and a Prohibition. Then assigner Party http://example.com/MyPix:55 assigns the Permission display to the assignee Party http://example.com/assignee:55 at the same time they are prohibited from archiving the target Asset. Additionally, in case of any conflict between permissions and prohibitions, the conflict attribute is set to perm indicating that the Permission entity will take precedence.

{
-    "type": "http://www.w3.org/ns/odrl/2/Agreement",
+"@context": {
+    "odrl": "http://www.w3.org/ns/odrl/2/"
+    }
+    "type": "odrl:Agreement",
     "uid": "http://example.com/policy:5555",
-    "conflict": "http://www.w3.org/ns/odrl/2/perm",
+    "conflict": "odrl:perm",
     "permission": [{
         "target": "http://example.com/photoAlbum:55",
-        "action": "http://www.w3.org/ns/odrl/2/display",
+        "action": "odrl:display",
         "assigner": "http://example.com/MyPix:55",
         "assignee": "http://example.com/assignee:55"
     }],
     "prohibition": [{
         "target": "http://example.com/photoAlbum:55",
-        "action": "http://www.w3.org/ns/odrl/2/archive",
+        "action": "odrl:archive",
         "assigner": "http://example.com/MyPix:55",
         "assignee": "http://example.com/assignee:55"
     }]
@@ -549,24 +591,27 @@ 

Duty

 {
-    "type": "http://www.w3.org/ns/odrl/2/Offer",
+   "@context": {
+    "odrl": "http://www.w3.org/ns/odrl/2/"
+    }
+    "type": "odrl:Offer",
     "uid": "http://example.com/policy:88",
     "permission": [{
         "assigner": "http://example.com/assigner:sony",
         "target": "http://example.com/music/1999.mp3",
-        "action": "http://www.w3.org/ns/odrl/2/play",
+        "action": "odrl:play",
         "duty": [{
-            "action": "http://www.w3.org/ns/odrl/2/compensate",
+            "action": "odrl:compensate",
             "constraint": [{
-                "name": "http://www.w3.org/ns/odrl/2/payAmount",
-                "operator": "http://www.w3.org/ns/odrl/2/eq",
+                "name": "odrl:payAmount",
+                "operator": "odrl:eq",
                 "rightOperand": "5.00",
                 "unit": "http://cvx.iptc.org/iso4217a/AUD"
             }],
             "constraint": [{
-                "name": "http://www.w3.org/ns/odrl/2/event",
-                "operator": "http://www.w3.org/ns/odrl/2/lt",
-                "rightOperand": "http://www.w3.org/ns/odrl/2/policyUsage"
+                "name": "odrl:event",
+                "operator": "odrl:lt",
+                "rightOperand": "odrl:policyUsage"
             }]
         }]
     }]
@@ -592,24 +637,27 @@ 

Duty

{
-    "type": "http://www.w3.org/ns/odrl/2/Privacy",
+"@context": {
+    "odrl": "http://www.w3.org/ns/odrl/2/"
+    }
+    "type": "odrl:Privacy",
     "uid": "http://example.com/policy:7777",
     "permission": [{
         "target": "http://example.com/personal-data:77",
-        "action": "http://www.w3.org/ns/odrl/2/distribute",
+        "action": "odrl:distribute",
         "constraint": [{
-            "name": "http://www.w3.org/ns/odrl/2/purpose",
-            "operator": "http://www.w3.org/ns/odrl/2/eq",
+            "name": "odrl:purpose",
+            "operator": "odrl:eq",
             "rightOperand": "http://www.w3.org/2002/01/P3Pv1:contact"
         }],
         "assigner": "http://example.com/assigner:77",
         "assignee": "http://example.com/gov:health:au",
         "duty": [{
-            "action": "http://www.w3.org/ns/odrl/2/delete",
+            "action": "odrl:delete",
             "target": "http://example.com/personal-data:77",
             "constraint": [{
-                "name": "http://www.w3.org/ns/odrl/2/dateTime",
-                "operator": "http://www.w3.org/ns/odrl/2/eq",
+                "name": "odrl:dateTime",
+                "operator": "odrl:eq",
                 "rightOperand": "P30D"
             }]
         }]
@@ -632,13 +680,16 @@ 

Action

Example Use Case: The Party needs to define an Offer policy granting several permissions about the target Asset http://example.com/music:1012, namely the permission to play, to create multiple copies of the Asset that are being concurrently used, and to to perform or exhibit the Asset to an audience.

{
-    "type": "http://www.w3.org/ns/odrl/2/Offer",
+"@context": {
+    "odrl": "http://www.w3.org/ns/odrl/2/"
+    }
+    "type": "odrl:Offer",
     "uid": "http://example.com/policy:1012",
     "permission": [{
             "target": "http://example.com/music:1012",
-            "action": "http://www.w3.org/ns/odrl/2/play",
-            "action": "http://www.w3.org/ns/odrl/2/concurrentUse",
-            "action": "http://www.w3.org/ns/odrl/2/present"
+            "action": "odrl:play",
+            "action": "odrl:concurrentUse",
+            "action": "odrl:present"
      }]
 }
@@ -666,30 +717,33 @@

Constraint

Example Use Case: The Party http://example.com/myPix:6161 wants to assign the Permission distribute directly to the potential buyer of the permission who will pay 100 EUR for this grant. The distribute Permission is also constrained to a specific country, i.e., Italy. The potential assignee may then distribute the target Asset http://example.com/wallpaper:1234 according to the nextPolicy target Asset linked directly from this Duty. In this case, the next Policy Asset stipulates that the potential assignee may only offer the display Permission to downstream consumers.

{
-    "type": "http://www.w3.org/ns/odrl/2/Offer",
+"@context": {
+    "odrl": "http://www.w3.org/ns/odrl/2/"
+    }
+    "type": "odrl:Offer",
     "uid": "http://example.com/policy:6161",
     "permission": [{
         "target": "http://example.com/wallpaper:1234",
-        "action": "http://www.w3.org/ns/odrl/2/distribute",
+        "action": "odrl:distribute",
         "constraint": [{
-            "name": "http://www.w3.org/ns/odrl/2/spatial",
-            "operator": "http://www.w3.org/ns/odrl/2/eq",
+            "name": "odrl:spatial",
+            "operator": "odrl:eq",
             "rightOperand": "http://www.itu.int/tML/tML-ISO-3166:it"
         }],
         "assigner": "http://example.com/myPix:6161",
         "duty": [
             {
-                "action": "http://www.w3.org/ns/odrl/2/compensate",
+                "action": "odrl:compensate",
                 "constraint": [{
-                    "name": "http://www.w3.org/ns/odrl/2/payAmount",
-                    "operator": "http://www.w3.org/ns/odrl/2/eq",
+                    "name": "odrl:payAmount",
+                    "operator": "odrl:eq",
                     "rightOperand": "100.00",
                     "dataType": "http://www.w3.org/2001/XMLSchema#decimal",
                     "unit": "http://cvx.iptc.org/iso4217a/EUR"
                 }]
             },
             {
-                "action": "http://www.w3.org/ns/odrl/2/nextPolicy",
+                "action": "odrl:nextPolicy",
                 "target": "http://example.com/policy:7171"
             }
         ]
@@ -697,11 +751,14 @@ 

Constraint

}
{
-        "type": "http://www.w3.org/ns/odrl/2/Set",
+    "@context": {
+    "odrl": "http://www.w3.org/ns/odrl/2/"
+    }
+        "type": "odrl:Set",
         "uid": "http://example.com/policy:7171",
         "permission": [{
             "target": "http://example.com/wallpaper:1234",
-            "action": "http://www.w3.org/ns/odrl/2/display"
+            "action": "odrl:display"
         }]
     }