"My Github page" =======
ODRL2.0 is a language to express policies: permissions, prohibitions, obligations. It is specified by the ODRL W3C Community and Business Group
ODRL2.0 can be serialized as XML, as JSON or as RDF based on the draft ODRL2.0 Ontology. The only serialization this Java API supports in this version is the RDFODRL2.0 Core Model is abstract, i.e., serialization independent. The examples in this document assume the RDF serialization. The most common prefixes are:
A policy may represent the following statement: "The asset 9898 can be read and written".
The following example is taken from the official ODRL example 1
http://example.com/policy:0099 a odrl:Policy , odrl:Set ; odrl:permission [ a odrl:Permission ; odrl:action odrl:write , odrl:read ; odrl:target "http://example.com/asset:9898" ] ;
In order to produce that code, the ODRLAPI can be used, by typing the excerpt shown belowThis may have been defined in Java with the
Policy policy = new Policy("http://example.com/policy:0099"); Permission permission = new Permission(); permission.setTarget("http://example.com/asset:9898"); permission.setActions(Arrays.asList(new Action("http://www.w3.org/ns/odrl/2/read"), new Action("http://www.w3.org/ns/odrl/2/write"))); policy.addRule(permission); System.out.println(ODRLRDF.getRDF(policy, Lang.TTL));
The first line creates an object of type Policy An empty string creates anonymous objects.
The last line converts objects in the ODRL2.0 Simple API Model to the RDF (Turtle by default) serialization. Indeed, RDF/XML, N-Triples etc. are also supported.
The source code includes 7 full examples of working source code for you to start digging. Look into the examples folder.