Re: [poe] Support JSON-LD

Well, one thing that makes the context invalid is on line 151, where 
`meteredTime` should be `odrl:meteredTime`; that seems to be the 
immediate source of the issue you found in the playground.

There are some other things you should consider:

As you discuss, properties who's range is a resource rather than a 
literal (similar to owl:objectProperty) should typically have `@type: 
@id`. However, then the resource comes from a constrained vocabulary, 
where the instances are defined in the context, you should use `@type:
 @vocab`.

This is due to the expansion rules, where `@type: @id` expands IRIs 
relative to the document base, and `@type: @vocab` relative to the 
vocabulary base, which also means they can be terms defined in the 
`@context`.

For example, the property `leftOperand` has a range of `LeftOperand`, 
which includes `meteredTime` as a member. So, I would make the term 
definition as follows:

```json
{"@context": {
  ...
  "leftOperand":          {"@type": "@vocab", "@id": 
"odrl:leftOperand"},
  ...
}
```

This way, if you have something like `{"leftOperand": "meteredValue"}`
 it will expand as you expect.

Another thing to consider is if you want to make your context also be 
a vocabulary document. For example, we did this for [CSVW][csvw], and 
[Web Ontology][oa] took a similar tack. This way, you can feed both 
the OWL/RDFS vocabulary and the context at the same time, but it does 
come at the cost of having a larger document.

I typically use a script to generate all the vocabularies. For 
example, the CSVW 
[script](https://github.com/w3c/csvw/blob/gh-pages/ns/mk_vocab.rb) 
takes a CSV input and generates Turtle, JSON-LD and HTML+RDFa.

[csvw]: https://www.w3.org/ns/csvw
[oa]: https://www.w3.org/ns/oa

-- 
GitHub Notification of comment by gkellogg
Please view or discuss this issue at 
https://github.com/w3c/poe/issues/46#issuecomment-279107214 using your
 GitHub account

Received on Saturday, 11 February 2017 01:04:20 UTC