Re: Starting with Contexts and Schema.org

On Aug 5, 2013, at 10:56 AM, vikash agrawal <vikashagrawal1990@gmail.com> wrote:

> hi Everyone, 
> 
> Context Public.json ->https://gist.github.com/ivikash/6041987
> 
> Context Event.json ->https://gist.github.com/ivikash/6157882
> 
> Context Place.json ->https://gist.github.com/ivikash/6157930

A comment on the Person context (for the others too):

* If you're using @vocab, then you don't need to be explicit about the @id of the properties defined within the context. For example, you can leave out definitions for "name" and "gender", and change "address" and others similar to the following:

{
    "@context" : {
        "@vocab": "http://schema.org/",
        "address" : {"@type" : "@id"},
        ...
    }
}

That's sort of the point of using @vocab.

> I have one query, If schema.org says that the type is an organisation or say postal address, it be expanded to an IRI, am i right? 

JSON-LD has no innate knowledge of the range of schema.org properties. When constructing a context, you'd need to add @type: @id to those property definitions as you have done. Note that this is not the type of an entity, but the range of a property. This can be done by looking at the RDFS definition of schema.org [1] and creating appropriate property definitions where feasable. (Also, not this can be done for properties that should take a list of values, such as schema:recipeInstructions. Also useful for types that take various scalar values, such as schema:totalTime taking an xsd:duration. Note that we eventually expect schema.org to publish their own context.

For example, look at schema:publisher [2]; this has domain Organization and range CreativeWork, this implies that the value should be an @id. If you distill this, you get a JSON-LD representation such as the following:

{
  "@context": {
    "owl": "http://www.w3.org/2002/07/owl#",
    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
    "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
    "schema": "http://schema.org/",
  },
  "@id": "schema:publisher",
  "@type": [
    "rdf:Property",
    "owl:Property"
  ],
  "rdfs:comment": {
    "@value": "The publisher of the creative work.",
    "@language": "en"
  },
  "rdfs:label": {
    "@value": "publisher",
    "@language": "en"
  },
  "schema:domainIncludes": {
    "@id": "schema:CreativeWork"
  },
  "schema:rangeIncludes": {
    "@id": "schema:Organization"
  }
}

Gregg

[1] http://schema.org/docs/schema_org_rdfa.html
[2] http://schema.org/publisher

> I had a word with taaz, but can I get a slightly better insight at this.




> Regards
> ~Vikash
> 
> 
> On Tue, Jul 23, 2013 at 12:35 AM, vikash agrawal <vikashagrawal1990@gmail.com> wrote:
> Errors Noted! 
> Reading the spec and Rectifying!
> 
> 
> On Tue, Jul 23, 2013 at 12:29 AM, vikash agrawal <vikashagrawal1990@gmail.com> wrote:
> Hey Nikalas, 
> 
> I have tried to understand your statements.
> 
> So, I this would be first working Person schema, https://gist.github.com/ivikash/6041987 (Revision 7).
> 
> If this looks good, I will file a PR and move to Places and events too :-)
> 
> Regards
> ~Vikash
> 
> 
> 
> On Mon, Jul 22, 2013 at 9:24 PM, Niklas Lindström <lindstream@gmail.com> wrote:
> Hi Vikash,
> 
> Also note that you don't need to add explicit "@id" mappings to the terms since their names can be resolved against the defined "@vocab" value.
> 
> Or I should say "should resolve", since there seems to be something strange going on with some of them. For instance, both "presentAddress" and "permanentAddress" are mapped to "http://schema.org/address", "image" is mapped to "http://schema.org/url" and "phoneNumber" to "http://schema.org/telephone" in your context. It seems like a copy-paste error (apparently so if you look at "firstName", "middleName" and "familyName"), and I don't think it is a good idea if it is intentional. You should use the term names as defined in the vocabulary, unless you have some very specific reason otherwise. What is your intention here?
> 
> Cheers,
> Niklas
> 
> 
> On Mon, Jul 22, 2013 at 5:27 PM, vikash agrawal <vikashagrawal1990@gmail.com> wrote:
> Thank-You Markus and Dave,
> 
> 
> 
> On Mon, Jul 22, 2013 at 8:09 PM, Markus Lanthaler <markus.lanthaler@gmx.net> wrote:
> On Monday, July 22, 2013 3:39 PM, vikash agrawal wrote:
> > Thank-You Nikalas and Markus,
> >
> > I am pretty sure, I do have a lot of things to grasp. I
> > did refer and read the spec after being advised by Manu
> > and I am progressing.
> 
> Good
> 
> 
> :-)
>  
> 
> > This is my very initial attempt to the context. And I
> > think there might small or big mistakes and glitches.
> > Can you please see to this and let me know my mistakes.
> >
> > https://gist.github.com/ivikash/6041987
> 
> You don't need to type-coerce everything to @id. You only do that if the value is a URL. The value of firstName, lastName etc. for sure isn't. So you have to remove the "@type": "@id".
> 
> 
> 
> Over IRC, Dave really made me understand things, which I werent able to get in the first shot.
> 
> I am writing the person context and share the gist link soon :) 
> 
>  
> > [Using GMail, and I hope its in ascii]
> 
> Nope, it's HTML :-P
> 
> 
> Cant help it any more :P. Else I have to use mutt :D
>  
> 
> Cheers,
> Markus
> 
> 
> --
> Markus Lanthaler
> @markuslanthaler
> 
> 
> 
> 
> 
> 
> 

Received on Monday, 5 August 2013 19:01:58 UTC