Re: an idea: @context in coercion rules ?

Pierre-Antoine Champin wrote:
> Hi,
> 
> an idea that came to me while reading the JSON-LD syntax document is one
> could put a @context inside a coercion rule,
> in order to change the meaning of a property depending on where it appears.
> 
> For example,
> 
> {
>   "@context": {
>     "name": "http://xmlns.com/foaf/0.1/name",
>     "homepage": {
>       "@id": "http://xmlns.com/foaf/0.1/homepage",
>       "@type": "@id",
>       "@context": {
>         "name": "http://purl.org/dc/terms/title"
>       }
>     }
>   },
>   "name": "Manu Sporny",
>   "homepage": {
>        "@id": "http://manu.sporny.org/",
>        "name": "Manu's homepage"
>   }
> }
> 
> would give the following triples
> 
> _:t0 <http://xmlns.com/foaf/0.1/name> "Manu Sporny" .
> _:t0 <http://xmlns.com/foaf/0.1/homepage> <http://manu.sporny.org/> .
> <http://manu.sporny.org/> <http://purl.org/dc/terms/title> "Manu's
> homepage" .
> 
> where property name means foaf:name or dc:title depending on where it
> appears.
> 
> Has this been discussed in the community group? Does this look like a valid
> use case?

Looks good and a valid requirement, question whether the secondary 
context is needed, e.g. would/could the following accomplish the same:

    "@context": {
      "name": "http://xmlns.com/foaf/0.1/name",
      "homepage": {
        "@id": "http://xmlns.com/foaf/0.1/homepage",
        "@type": "@id",
        "name": "http://purl.org/dc/terms/title"
      }
    },

additionally question what complexity this would add to processors, 
whether there are different approaches, and whether it's too dependent 
on a set hierarchical layout, e.g what if homepage description was a non 
nested object.

Best,

Nathan

Received on Wednesday, 11 July 2012 13:20:54 UTC