Re: Scoped contexts with @type:@vocab ?

> On Mar 6, 2017, at 5:02 PM, Robert Sanderson <azaroth42@gmail.com> wrote:
> 
> 
> Another scoping question ...  is it possible to use scoped contexts for URI expansion within specific relationships?
> 
> For example, if I have an external classification system (say http://vocab.gett.edu/aat/ <http://vocab.gett.edu/aat/>) and a predicate that refers to it (crm:P2_has_type) which I map to `classified_as`, would an embedded/scoped context be resolved for the vocabulary terms only when used with that predicate?

I believe so, but you can try it with the latest version of the Ruby json-ld gem to be sure.

The way the expansion algorithm reads is in 8.5, if key has a local context (scoped context), to use that to set term context. Later, in 8.8, term context is used to expand the value of the property (“Painting”, in your case).

> For example, in the below, I would want Painting to resolve to aat:300033618 only when used with `classified_as`:
> 
> ```
> {
>   "@context": {
>     "id": "@id",
>     "type": "@type",
>     "classified_as": {
>       "@id": "crm:P2_has_type",
>       "@type": "@vocab",
>       "@context": {
>          "aat": "http://vocab.gett.edu/aat/ <http://vocab.gett.edu/aat/>",
>          "Painting": "aat:300033618"
>       }
>     }
>   },
>   "id": "http://example.org/object/1 <http://example.org/object/1>",
>   "type": "ManMadeObject",
>   "classified_as": "Painting"
> }
> ```


I get the following expanded JSON-LD:

```
[
  {
    "@id": "http://example.org/object/1",
    "@type": [
      "ManMadeObject"
    ],
    "crm:P2_has_type": [
      {
        "@id": "http://vocab.gett.edu/aat/300033618"
      }
    ]
  }
]
```

Looks like what you want, note that ManMadeObject isn’t expanded, as it’s not defined anywhere.

Gregg

> Thoughts?
> 
> Rob
> 
> -- 
> Rob Sanderson
> Semantic Architect
> The Getty Trust
> Los Angeles, CA 90049

Received on Tuesday, 7 March 2017 01:42:39 UTC