- From: stuartmyles via GitHub <sysbot+gh@w3.org>
- Date: Mon, 13 Feb 2017 12:00:23 +0000
- To: public-poe-archives@w3.org
Here's a draft JSON-LD context which appears to support all of the existing JSON encodings: https://dl.dropboxusercontent.com/u/8555005/context.json I want to do more testing, though, just to make sure. Note that one difference in this ODRL Context (versus the one that Renato has been developing) is that it follows the convention we established for JSON - that explicit URIs always be used. This dramatically simplifies the @context, since it doesn't require the values of things like "leftoperand" to be included within the @context. This fits with the concept of different vocabularies (such as, say, RightsML) being able to be plugged into the JSON. If you don't follow that approach, then you would need a different @context file for a RightsML document versus an ODRL document, even if the only difference was some additional vocabulary items. There are some changes in the JSON spec that need to be addressed. Mainly, these are bugs in the original spec. Regards, Stuart On Fri, Feb 10, 2017 at 8:04 PM, Gregg Kellogg <notifications@github.com> wrote: > 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: > > {"@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 > <https://www.w3.org/ns/csvw>, and Web Ontology <https://www.w3.org/ns/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. > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/w3c/poe/issues/46#issuecomment-279107214>, or mute > the thread > <https://github.com/notifications/unsubscribe-auth/ADwBf2-q4JfjQTAa23eiDAJacFGfcwZxks5rbQkNgaJpZM4KZWR0> > . > -- GitHub Notification of comment by stuartmyles Please view or discuss this issue at https://github.com/w3c/poe/issues/46#issuecomment-279368120 using your GitHub account
Received on Monday, 13 February 2017 12:00:30 UTC