- From: Víctor Rodríguez Doncel <vrodriguez@fi.upm.es>
- Date: Fri, 06 Nov 2015 13:01:43 +0100
- To: Renato Iannella <renato@knowledgeflux.com>, public-odrl@w3.org
- Message-ID: <563C96A7.2040805@fi.upm.es>
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://example.com/policy:0099>
a odrl:Set;
odrl:permission [
a odrl:Permission ;
odrl:target <http://example.com/asset:9898> ;
odrl:action odrl:reproduce
] ;
odrl:prohibition [
a odrl:Prohibition ;
odrl:target <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/target": [
{
"@id": "http://example.com/asset:9898"
}
],
"http://www.w3.org/ns/odrl/2/action": [
{
"@id": "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",
"policyid": "http://example.com/policy:0099",
"permissions": [{
"target": "http://example.com/asset:9898",
"action": "http://www.w3.org/ns/odrl/2/reproduce"
}],
"prohibitions": [{
"target": "http://example.com/asset:9898",
"action": "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#",
"odrl": "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",
"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"
}]
}
]
}|
And then we can then create RDF from the JSON form...
|@prefix odrl: <http://www.w3.org/ns/odrl/2/> .
<http://example.com/policy:0099> a odrl:Set .
<http://example.com/policy:0099> odrl:permission _:perm0 .
_:perm0 odrl:action <http://www.w3.org/ns/odrl/2/reproduce> .
_:perm0 odrl:target <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
>> <mailto: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 12:03:47 UTC