W3C home > Mailing lists > Public > public-vocabs@w3.org > March 2015

Re: using schema:Role with inverse properties?

From: ☮ elf Pavlik ☮ <perpetual-tripper@wwelves.org>
Date: Wed, 11 Mar 2015 11:37:28 +0100
Message-ID: <55001AE8.6000303@wwelves.org>
To: Jarno van Driel <jarnovandriel@gmail.com>
CC: W3C Web Schemas Task Force <public-vocabs@w3.org>
Hi Jarno,

On 03/11/2015 11:12 AM, Jarno van Driel wrote:
>>
>> "Can I add *@id* to object with "@type": "OrganizationRole", and use same @id
>> for both of those objects?"
> 
> 
> In theory, yes you can.
> 
> I've added an @id to both the Person and CollegeOrUniversity and Google's
> Structured Data Testing Tool as well as the Structured Data Linter and both
> accept the @id's successfully, meaning the 2 pieces or JSON-LD are merged
> into a single graph. Yandex's Structured Data Validator doesn't do that
> well though:
> 
> <script type="application/ld+json">
> {
>   "@context": "http://schema.org",
>   "@type": "CollegeOrUniversity",
>   "@id": "http://example.com/#SomeU",
>   "name": "University of Cambridge",
>   "sameAs": "http://en.wikipedia.org/wiki/University_of_Cambridge",
>   "alumni": {
>     "@type": "OrganizationRole",
>     "alumni": {
>       "@type": "Person",
>       "@id": "http://example.com/#SomePerson",
>        "name": "Delia Derbyshire",
>       "sameAs": "http://en.wikipedia.org/wiki/Delia_Derbyshire"
>     },
>     "startDate": "1959"
>   }
> }
> </script>
> 
> <script type="application/ld+json">
> {
>   "@context": "http://schema.org",
>   "@type": "Person",
>   "@id": "http://example.com/#SomePerson",
>    "name": "Delia Derbyshire",
>    "sameAs": "http://en.wikipedia.org/wiki/Delia_Derbyshire",
>    "alumniOf": {
>      "@type": "OrganizationRole",
>      "alumniOf": {
>        "@type": "CollegeOrUniversity",
>        "@id": "http://example.com/#SomeU",
>        "name": "University of Cambridge",
>        "sameAs": "http://en.wikipedia.org/wiki/University_of_Cambridge"
>     },
>     "startDate": "1959"
>   }
> }
> </script>
I meant to add same @id to the object with "@type": "OrganizationRole",
resulting in

  {
    "@id": "http://example.org/daila-studying-at-cambridge-uni",
    "@type": "OrganizationRole",
    "alumni": {
      "@type": "Person",
      "@id": "http://example.com/#SomePerson",
       "name": "Delia Derbyshire",
      "sameAs": "http://en.wikipedia.org/wiki/Delia_Derbyshire"
    },
    "alumniOf": {
      "@type": "CollegeOrUniversity",
      "@id": "http://example.com/#SomeU",
      "name": "University of Cambridge",
      "sameAs": "http://en.wikipedia.org/wiki/University_of_Cambridge"
    },
    "startDate": "1959"
  }

> 
> Though when doing something similar with a piece of microdata markup
> combined with JSON-LD then things are less successful. It seems only the
> Structured Data Linter is able to digest it:
To stay honest, I tend to look at it: "Use Microdata only for trivial
data, for non-trivial data use RDFa or JSON-LD".

> 
> <div itemid="http://example.com/#ProcedureProduct" itemscope itemtype="
> http://schema.org/MedicalProcedure">
>     <span itemprop="name">Butt Lift</span>
> </div>
> 
> <script type="application/ld+json">
> {
>     "@context": "http://schema.org",
>     "@type": "Product",
>     "@id": "http://example.com/#ProcedureProduct",
>     "url": "
> http://www.cosmeticsurg.net/blog/2013/10/20/how-much-fat-is-injected-with-the-brazilian-butt-lift/
> "
> }
> </script>
> 
> Which makes me wonder, why don't digest Google's and Yandex's tool digest
> multiple syntaxes? Doesn't make much sense to me.
Do you know if Google and Yandex tools have their processing rules
documented somewhere?

For Structured Data Linter one can always look at:
https://github.com/structured-data/linter

Thank you for sharing those experiments & Cheers!


> 
> 2015-03-10 13:49 GMT+01:00 ☮ elf Pavlik ☮ <perpetual-tripper@wwelves.org>:
> 
>> Hello,
>>
>> Looking at examples in http://schema.org/Role
>>
>> {
>>   "@context": "http://schema.org",
>>   "@type": "CollegeOrUniversity",
>>   "name": "University of Cambridge",
>>   "sameAs": "http://en.wikipedia.org/wiki/University_of_Cambridge",
>>   "alumni": {
>>     "@type": "OrganizationRole",
>>     "alumni": {
>>       "@type": "Person",
>>        "name": "Delia Derbyshire",
>>       "sameAs": "http://en.wikipedia.org/wiki/Delia_Derbyshire"
>>     },
>>     "startDate": "1959"
>>   }
>> }
>>
>> {
>>   "@context": "http://schema.org",
>>   "@type": "Person",
>>    "name": "Delia Derbyshire",
>>    "sameAs": "http://en.wikipedia.org/wiki/Delia_Derbyshire",
>>    "alumniOf": {
>>      "@type": "OrganizationRole",
>>      "alumniOf": {
>>        "@type": "CollegeOrUniversity",
>>        "name": "University of Cambridge",
>>        "sameAs": "http://en.wikipedia.org/wiki/University_of_Cambridge"
>>     },
>>     "startDate": "1959"
>>   }
>> }
>>
>> Can I add *@id* to object with "@type": "OrganizationRole", and use same
>> @id for both of those objects?
>>
>> I also think about using it with Web Credentials
>> http://opencreds.org/ (see embeded videos!!!)
>>
>> My examples of MembershipCredential and AttendanceCredential in this email
>> *
>> https://lists.w3.org/Archives/Public/public-credentials/2015Mar/0007.html
>>
>> Cheers!
>>
>>
>>
> 



Received on Wednesday, 11 March 2015 10:37:42 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 11 March 2015 10:37:42 UTC