W3C home > Mailing lists > Public > public-odrl@w3.org > November 2015

Re: W3C WG Update

From: Nandana Mihindukulasooriya <nmihindu@fi.upm.es>
Date: Sat, 7 Nov 2015 00:46:41 +0100
Message-ID: <CAAOEr1=bApuzfdJMqVqoN3mg+xQw-c__sJgA+-peoEyjD-xnDQ@mail.gmail.com>
To: "public-odrl@w3.org Group" <public-odrl@w3.org>
Cc: Renato Iannella <renato@knowledgeflux.com>, Víctor Rodríguez Doncel <vrodriguez@fi.upm.es>
Adding to what Victor said, if you have RDF, JSON, and XML (not relevant in
this case), JSON-LD sort of comes for free.

a) RDF -> JSON-LD (straightforward serialization of the RDF graph just as
any other RDF serialization such as Turtle, RDF/XML, N-Triples, etc.)
b) JSON -> JSON-LD (by adding a context to the JSON document)

To simplify case b), the working group can prepare a ready-to-use JSON-LD
context that maps the ODRL 2.1 JSON Encoding names to the ODRL 2.1 ontology
properties. Some other W3C WGs such as W3C Hydra CG already follow similar
approach [1].

If the WG decides to do so, may be the only actions required are
1.) Create a context document that can be easily used by people
2.) Explain in "2.1 A Note on JSON-LD" [2] of ODRL Version 2.1 JSON
Encoding how to convert JSON to JSON-LD using this approach with an example

With this, case b) can be simplified as something like the following

{
  "@context": "http://www.w3.org/ns/odrl/2/context.jsonld",
  "@id": "http://example.com/policy:0099",
  "policytype": "http://www.w3.org/ns/odrl/2/Set",
  "permissions": [{
       "target": "http://example.com/asset:9898",
       "action": "http://www.w3.org/ns/odrl/2/reproduce" }]
}

Best Regards,
Nandana
https://twitter.com/nandanamihindu

Ontology Engineering Group (OEG),
Department of Artificial Intelligence,
Universidad Politécnica de Madrid,
Madrid, Spain.

[1] http://www.w3.org/ns/hydra/context.jsonld
[2] https://www.w3.org/community/odrl/json/2.1/#section-JSON-LD

On Fri, Nov 6, 2015 at 1:01 PM, Víctor Rodríguez Doncel <
vrodriguez@fi.upm.es> wrote:

>
> By adding a context to the existing JSON document, transformations are
> strightforward.
>
> For example, this is the RDF for example of use #1
> <http://www.w3.org/ns/odrl/2/ODRL21>.
>
> @prefix odrl: <http://www.w3.org/ns/odrl/2/> <http://www.w3.org/ns/odrl/2/> .
> <http://example.com/policy:0099> <http://example.com/policy:0099>
> 	a odrl:Set;
> 	odrl:permission [
> 		a odrl:Permission ;
> 		odrl:target <http://example.com/asset:9898> <http://example.com/asset:9898> ;
> 		odrl:action odrl:reproduce
> 	] ;
> 	odrl:prohibition [
> 		a odrl:Prohibition ;
> 		odrl:target <http://example.com/asset:9898> <http://example.com/asset:9898> ;
> 		odrl:action odrl:modify
> 	] .
>
>
> By using a converter tool (for example the one at
> http://www.easyrdf.org/converter), we obtain the JSON-LD equivalent....
>
> [
>   {
>     "@id": "_:b0",
>     "@type": [
>       "http://www.w3.org/ns/odrl/2/Permission" <http://www.w3.org/ns/odrl/2/Permission>
>     ],
>     "http://www.w3.org/ns/odrl/2/target" <http://www.w3.org/ns/odrl/2/target>: [
>       {
>         "@id": "http://example.com/asset:9898" <http://example.com/asset:9898>
>       }
>     ],
>     "http://www.w3.org/ns/odrl/2/action" <http://www.w3.org/ns/odrl/2/action>: [
>       {
>         "@id": "http://www.w3.org/ns/odrl/2/reproduce" <http://www.w3.org/ns/odrl/2/reproduce>
>       }
>     ]
>   },
> ... OMITTED FOR CLARITY ...
>
>
>
> Which is indeed different from the ODRL JSON serialization
> <https://www.w3.org/community/odrl/json/2.1/#section-Examples>.
>
> {
>     "policytype": "http://www.w3.org/ns/odrl/2/Set" <http://www.w3.org/ns/odrl/2/Set>,
>     "policyid": "http://example.com/policy:0099" <http://example.com/policy:0099>,
>     "permissions": [{
>         "target": "http://example.com/asset:9898" <http://example.com/asset:9898>,
>         "action": "http://www.w3.org/ns/odrl/2/reproduce" <http://www.w3.org/ns/odrl/2/reproduce>
>     }],
>     "prohibitions": [{
>         "target": "http://example.com/asset:9898" <http://example.com/asset:9898>,
>         "action": "http://www.w3.org/ns/odrl/2/modify" <http://www.w3.org/ns/odrl/2/modify>
>     }]
> }.
>
>
> However, this JSON can be transformed to JSON-LD by adding a context:
>
> {
>   "@context": {
>     "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#" <http://www.w3.org/1999/02/22-rdf-syntax-ns#>,
>     "odrl": "http://www.w3.org/ns/odrl/2/" <http://www.w3.org/ns/odrl/2/>,
>     "policytype": { "@id": "rdf:type",  "@type": "@id" },
>     "permissions": { "@id": "odrl:permission",  "@type": "@id" },
>      "target" : {"@id": "odrl:target",  "@type": "@id" },
>      "action" : {"@id": "odrl:action",  "@type": "@id" }
>    },
>   "@graph": [
>      {
>         "@id": "http://example.com/policy:0099" <http://example.com/policy:0099>,
>          "policytype": "http://www.w3.org/ns/odrl/2/Set" <http://www.w3.org/ns/odrl/2/Set>,
>          "permissions": [{
>               "target": "http://example.com/asset:9898" <http://example.com/asset:9898>,
>               "action": "http://www.w3.org/ns/odrl/2/reproduce" <http://www.w3.org/ns/odrl/2/reproduce>
>           }]
>       }
>    ]
> }
>
>
> And then we can then create RDF from the JSON form...
>
> @prefix odrl: <http://www.w3.org/ns/odrl/2/> <http://www.w3.org/ns/odrl/2/> .
> <http://example.com/policy:0099> <http://example.com/policy:0099> a odrl:Set .<http://example.com/policy:0099> <http://example.com/policy:0099> odrl:permission _:perm0 .
> _:perm0 odrl:action <http://www.w3.org/ns/odrl/2/reproduce> <http://www.w3.org/ns/odrl/2/reproduce> .
> _:perm0 odrl:target <http://example.com/asset:9898> <http://example.com/asset:9898> .
>
>
> Very interesting, though...
>
> Regards,
> Víctor and Nandana
>
>
>
> El 06/11/2015 a las 0:05, Renato Iannella escribió:
>
>
> On 5 Nov 2015, at 2:54 AM, Myles, Stuart <SMyles@ap.org> wrote:
>
> So, given this, and given that the at least some of the current
> implementations of ODRL 2.1 support JSON already, can we get the W3C to
> retain the existing format?
>
>
> Does it make sense to then have two encodings? (one for JSON, and one for
> JSON-LD)
>
> Or...Can we automatically serialise the JSON-LD from the ODRL OWL ontology?
>
> *Renato Iannella*
> *Head of Innovation and Emerging Technologies, **KnowledgeFlux*
> Level 7, 100 Edward St, Brisbane 4000 AUSTRALIA +61 4 1313 2206
>
>
>
>
>
>
>
>
>
>
>
> --
> Víctor Rodríguez-Doncel
> D3205 - Ontology Engineering Group (OEG)
> Departamento de Inteligencia Artificial
> ETS de Ingenieros Informáticos
> Universidad Politécnica de Madrid
>
> Campus de Montegancedo s/n
> Boadilla del Monte-28660 Madrid, Spain
> Tel. (+34) 91336 3753
> Skype: vroddon3
>
>
Received on Friday, 6 November 2015 23:47:27 UTC

This archive was generated by hypermail 2.3.1 : Friday, 6 November 2015 23:47:28 UTC