Frage

Quite surprised that I couldn't find a similar question around here.

I'm looking for a way to create relationships (father / sister / wife etc.) between people, preferably within the vCard. I could quite easily create a db that holds the relationships, but then the app will not adhere to a standard or recommendation.

Does anybody know a relevant standard or recommendation?

War es hilfreich?

Lösung

The RELATED property does exactly that (see RFC 6350 p.43). Quoting the specs, the purpose of this property is:

To specify a relationship between another entity and the entity represented by this vCard.

Its value can be either a URI or free-form text. Examples of useful URIs include website addresses, URLs pointing to a vCard, or URNs that reference the UID property of another vCard.

It also has a TYPE parameter, which can optionally be used to define the type of relationship. The list of acceptable values for this parameter can be found in the vCard specs.

RELATED;TYPE=parent:http://example.com/jeb-doe.vcf
RELATED;TYPE=sibling:urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6
RELATED;TYPE=spouse;VALUE=text:Jane Doe

RELATED is supported in vCard version 4.0.

Andere Tipps

And for vCard 3 you might want to mirror what iOS/OSX do:

item3.X-ABRELATEDNAMES:John Doe
item3.X-ABLabel:_$!<Father>!$_
item4.X-ABRELATEDNAMES:Judy Doe
item4.X-ABLabel:_$!<Sister>!$_
item5.X-ABRELATEDNAMES:Joanna Doe
item5.X-ABLabel:_$!<Mother>!$_
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top