Add JSON encoding.
authorMo McRoberts <mo.mcroberts@bbc.co.uk>
Tue, 11 Nov 2014 15:53:44 +0000
changeset 58 64c700f1e077
parent 55 81cc37d6421d
child 59 28fea0fd561e
Add JSON encoding.
2/ODRL21.json
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/2/ODRL21.json	Tue Nov 11 15:53:44 2014 +0000
@@ -0,0 +1,193 @@
+   {
+    "type": "object",
+    "$schema": "http://json-schema.org/draft-04/schema#",
+    "title": "ODRL JSON Schema",
+    "description": "ODRL JSON Schema (Draft September 2014)",
+    "id": "http://www.w3.org/ns/odrl/2/jsonschema#",
+    "definitions": {"prohibdutytype": {
+        "type": "array",
+        "items": {
+            "type": "object",
+            "required": ["action"],
+            "properties": {
+                "assigner": {
+                    "type": "string",
+                    "format": "uri"
+                },
+                "assignee": {
+                    "type": "string",
+                    "format": "uri"
+                },
+                "assignee_scope": {
+                    "type": "string",
+                    "format": "uri"
+                },
+                "target": {
+                    "type": "string",
+                    "format": "uri"
+                },
+                "output": {
+                    "type": "string",
+                    "format": "uri"
+                },
+                "action": {
+                    "type": "string",
+                    "format": "uri"
+                },
+                "constraints": {
+                    "type": "array",
+                    "items": {
+                        "type": "object",
+                        "required": [
+                            "name",
+                            "operator",
+                            "rightoperand"
+                        ],
+                        "properties": {
+                            "name": {
+                                "type": "string",
+                                "format": "uri"
+                            },
+                            "operator": {
+                                "type": "string",
+                                "format": "uri"
+                            },
+                            "rightoperand": {"type": "string"},
+                            "rightoperanddatatype": {"type": "string"},
+                            "rightoperandunit": {"type": "string"},
+                            "status": {"type": "string"}
+                        }
+                    }
+                }
+            },
+            "patternProperties": {
+                "^[a-z]+party": {
+                    "type": "string",
+                    "format": "uri"
+                },
+                "^[a-z]+_scope": {
+                    "type": "string",
+                    "format": "uri"
+                }
+            }
+        }
+    }},
+    "required": [
+        "policyid",
+        "policytype"
+    ],
+    "properties": {
+        "policyid": {
+            "type": "string",
+            "format": "uri"
+        },
+        "policytype": {
+            "type": "string",
+            "format": "uri"
+        },
+        "conflict": {
+            "type": "string",
+            "enum": [
+                "perm",
+                "prohibit",
+                "invalid"
+            ]
+        },
+        "undefined": {
+            "type": "string",
+            "enum": [
+                "support",
+                "ignore",
+                "invalid"
+            ]
+        },
+        "inheritallowed": {"type": "boolean"},
+        "inheritfrom": {
+            "type": "string",
+            "format": "uri"
+        },
+        "inheritrelation": {
+            "type": "string",
+            "format": "uri"
+        },
+        "policyprofile": {
+            "type": "string",
+            "format": "uri"
+        },
+        "permissions": {
+            "type": "array",
+            "items": {
+                "type": "object",
+                "required": ["action"],
+                "properties": {
+                    "assigner": {
+                        "type": "string",
+                        "format": "uri"
+                    },
+                    "assigner_scope": {
+                        "type": "string",
+                        "format": "uri"
+                    },
+                    "assignee": {
+                        "type": "string",
+                        "format": "uri"
+                    },
+                    "assignee_scope": {
+                        "type": "string",
+                        "format": "uri"
+                    },
+                    "target": {
+                        "type": "string",
+                        "format": "uri"
+                    },
+                    "output": {
+                        "type": "string",
+                        "format": "uri"
+                    },
+                    "action": {
+                        "type": "string",
+                        "format": "uri"
+                    },
+                    "constraints": {
+                        "type": "array",
+                        "items": {
+                            "type": "object",
+                            "required": [
+                                "name",
+                                "operator",
+                                "rightoperand"
+                            ],
+                            "properties": {
+                                "name": {
+                                    "type": "string",
+                                    "format": "uri"
+                                },
+                                "operator": {
+                                    "type": "string",
+                                    "format": "uri"
+                                },
+                                "rightoperand": {"type": "string"},
+                                "rightoperanddatatype": {"type": "string"},
+                                "rightoperandunit": {"type": "string"},
+                                "status": {"type": "string"}
+                            }
+                        }
+                    },
+                    "duties": {"$ref": "#/definitions/prohibdutytype"}
+                },
+                "patternProperties": {
+                    "^[a-z]+party": {
+                        "type": "string",
+                        "format": "uri"
+                    },
+                    "^[a-z]+_scope": {
+                        "type": "string",
+                        "format": "uri"
+                    }
+                }
+            }
+        },
+        "prohibitions": {"$ref": "#/definitions/prohibdutytype"}
+    }
+ 
+}