Re: Re: [unhosted] getting social: defining the 'contacts' category

Thanks Markus, very interesting stuff. Looks like I need to read up
more on RDF & things. :)

I'm not sure about whether to use prefixes. What are the pros/cons in
terms of JSON-LD?
But as Michiel said earlier in this thread, in the end it doesn't
really matter what format we use for storage, as at least on the
JavaScript front we provide the library to access the data. That can
still convert to "pure" jCards or whatever.

On Wed, Jun 20, 2012 at 3:17 PM, elf Pavlik
<perpetual-tripper@wwelves.org> wrote:
> Excerpts from Markus Lanthaler's message of 2012-06-20 10:31:52 +0000:
>> Hi Elf,
>>
>> There exists a vCard mapping to RDF [1] which would make it very easy to write a JSON-LD context. So, your jCard could easily be transformed to valid JSON-LD:
>>
>> {
>>    "@context": {
>>       "v": "http://www.w3.org/2006/vcard/ns#",
>>       "VCard": "v:VCard",
>>       "fn": "v:fn",
>>       "nickname": "v:nickname",
>>       "email": { "@id": "v:email", "@type": "@id" },
>>       "tel": "v:tel",
>>       "Home": "v:Home",
>>       "Voice": "v:Voice",
>>       "value": "http://www.w3.org/1999/02/22-rdf-syntax-ns#value",
>>       "address": "v:adr",
>>       "street": "v:street-address",
>>       "postcode": "v:postal-code",
>>       "locality": "v:locality",
>>       "country": "v:country-name"
>>    },
>>    "@id": "http://example.com/me/corky",
>>    "@type": "vCard:VCard",
>>    "fn": "Corky Crystal",
>>    "nickname": "Corks",
>>    "email": "mailto:corky@example.com",
>>    "tel": {
>>       "@type": ["Home", "Voice"],
>>       "value": "+61 7 5555 5555"
>>    },
>>    "address": {
>>       "@type": "Home",
>>       "street": "111 Lake Drive",
>>       "postcode": "5555",
>>       "locality": "WonderCity",
>>       "country": "Australia"
>>    }
>> }
>>
>> Please note that you are free to define how your fields are named in the context. I simplified some here, e.g., "street-address" to just "street" and made sure you don't have to use prefixes. If you would be fine with using prefixes such in v:address in your JSON-LD documents the context could be simplified to something like:
>>
>> {
>>   "@context": {
>>     "v": "http://www.w3.org/2006/vcard/ns#",
>>     "v:email": { "@type": "@id" },
>>     "r:value": "http://www.w3.org/1999/02/22-rdf-syntax-ns#value"
>>   }
>> }
>>
>> The document would then look as follows: http://bit.ly/Mw0weD
>>
>>
>> The advantage of using JSON-LD in this instance is that you could easily integrate data coming from RDF/XML, Turtle, RDFa (embedded in Websites) into your system.
>>
>>
>> [1] http://www.w3.org/TR/vcard-rdf/
>>
>>
>> Hope this helps,
>
> WOW! thanks a lot Markus, looks to me like enough of advice to sort it out :) let's see what nil and other folks on unhosted list think about it... thank you once more!!!
>

Received on Wednesday, 20 June 2012 14:05:41 UTC