Re: About @type, @ and other tokens

On Jul 10, 2011, at 5:14 PM, Manu Sporny wrote:

On 07/08/2011 01:42 PM, Gregg Kellogg wrote:
With some minor processing rule changes, this could just use regular
@context term/prefix definitions.

{ "iri": "@source" ...}

I don't quite follow Gregg. Are you saying that the context would
declare that the @subject is the document's IRI if one wasn't specified
by the data file?

Basically, I'm taking a similar view to your previous post, although I think it's somewhat backwards. Adding a _reserved_ section doesn't really buy us anything. If what we're looking for is a way of aliasing the standard keywords to something an author might prefer, the standard prefix mechanism should work just fine. As I said, this might need a small change in the processing algorithm to perform in-scope term/prefix substitutions before doing keyword detection. Of course, you can't alias the first use of @context, but you could define different terms for @context in the default context (e.g., @profile).

If we assume that built-in keywords are @type, @context and @subject, then we could do the following:

{
  "@context": {
    "uri": "@subject",
    "a": "@type"
  }
}

This would allow usage such as the following:

{
  "@context": {
    "uri": "@subject",
    "a": "@type"
  },
  "uri": "http://subject/",
  "a": "http://schema.org/Person"
}

Basically, the @context processing would establish mappings for "uri" => "@subject", and "a" => "@type", and in the processing loop, then the key would be interpreted through this mapping and resolve to "@subject" and "@type" respectively.

Gregg

-- manu

--
Manu Sporny (skype: msporny, twitter: manusporny)
President/CEO - Digital Bazaar, Inc.
blog: PaySwarm Developer Tools and Demo Released
http://digitalbazaar.com/2011/05/05/payswarm-sandbox/

Received on Monday, 11 July 2011 01:15:25 UTC