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

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,
Markus


--
Markus Lanthaler
@markuslanthaler



> -----Original Message-----
> From: elf Pavlik [mailto:perpetual-tripper@wwelves.org]
> Sent: Wednesday, June 20, 2012 11:20 AM
> To: public-linked-json
> Cc: nil
> Subject: Fwd: Re: [unhosted] getting social: defining the 'contacts'
> category
> 
> hi, would someone like to share suggestions about using JSON-LD
> with/insteadOf jCards? thank you! :)
> you can find replies to original message below here:
> https://groups.google.com/group/unhosted/browse_thread/thread/afc876f98
> dddd050#anchor_47c625e430b3a9ad
> 
> --- Begin forwarded message from nil ---
> From: nil <nil.niklas@googlemail.com>
> To: unhosted <unhosted@googlegroups.com>
> Date: Tue, 19 Jun 2012 08:18:39 +0000
> Subject: Re: [unhosted] Re: getting social: defining the 'contacts'
> category
> 
> As far as we have discussed this now (mostly in the channel and in
> RL), we have settled on using JSON representations of hCards/vCards,
> called jCards, pretty much like http://microformats.org/wiki/jcard.
> Those can (for example) be generated with the vCardJS[1] library.
> 
> Now as there's been some talk about using JSON-LD at various points,
> we should probably think about using that in the contacts category as
> well. There seems to be a @context for people[2]. We could just use
> that. I have only scanned through that briefly, and am not sure yet,
> whether all info from vCards can be mapped to person.jsonld (and/or
> vice versa). But to me JSON-LD seems more sophisticated than jcards
> (which are only very loosely defined).
> 
> Anyone else any thoughts?
> 
> [1]: https://github.com/nilclass/vcardjs
> [2]: http://json-ld.org/contexts/person.jsonld
> --- End forwarded message ---

Received on Wednesday, 20 June 2012 10:32:30 UTC