vCard XML Schema

Abstract

This submission specifies a Resource Description Framework (RDF) encoding of the vCard profile defined by RFC 2426 and to provide equivalent functionality to its standard format. The motivation is to enable the common and consistent description of people and organisations (using the existing semantics of vCard) and to encode these in RDF formats.

Status of this document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications can be found in the W3C technical reports index at http://www.w3.org/TR/.

This updated Member Submission primarily brings together some divergence in the vCard RDF Namespace and usage patterns for some properties. The IETF vCard Working Group [VCARDWG] is currently working on Version 4.0 of vCard, and we expect a future revision to reflect these changes.

By publishing this document, W3C acknowledges that the Submitting Members have made a formal Submission request to W3C for discussion. Publication of this document by W3C indicates no endorsement of its content by W3C, nor that W3C has, is, or will be allocating any resources to the issues addressed by it. This document is not the product of a chartered W3C group, but is published as potential input to the W3C Process. A W3C Team Comment has been published in conjunction with this Member Submission. Publication of acknowledged Member Submissions at the W3C site is one of the benefits of W3C Membership. Please consult the requirements associated with Member Submissions of section 3.3 of the W3C Patent Policy. Please consult the complete list of acknowledged W3C Member Submissions.

Comments on this document may be sent to the authors or to the publicly archived Semantic Web Interest Group distribution list, semantic-web@w3.org [archive].

Table of contents

1. Introduction
2. RDF vCard Namespace
3. RDF vCard Guidelines
3.1 Classes and Properties
3.2 vCard Type Parameters
3.3 Structured Properties
3.4 Binary Values
3.5 Agent Property
3.6 Geo Property
4. RDF vCard Examples
5. RDFa vCard Examples (Informative)
Appendix A – RDF vCard Ontology Reference
Appendix B – RDF vCard “Short-Cut” Properties
Acknowledgments
References

1. Introduction

This Member Submission specifies a Resource Description Framework (RDF) [RDF] vocabulary that corresponds to the vCard electronic business card profile defined by RFC 2426 [VCARD]. This specification provides equivalent functionality to the standard format defined by vCard Version 3.0. Documents structured in accordance with this RDF mapping may also be known as ‘RDF vCard’ documents.

This Member Submission is not intended to create a separate definition for the vCard schema. The sole purpose for this Member Submission is to define an alternative RDF mapping for the format defined by vCard. The RDF vCard does not introduce any capability not expressible in the format defined by vCard. However, an attempt has been made to leverage the capabilities of the RDF model to appropriately articulate the vCard semantics.

2. RDF vCard Namespace

RDF uses the XML Namespace to uniquely identify the metadata schema and version. For vCard, the following URI is defined to be the RDF vCard Namespace:

http://www.w3.org/2006/vcard/ns#

The explicit use of this XML Namespace in RDF means that there is no need to support the VCARD Profile and Version types.

This namespace name (URI) will only be used to refer to this version of this Member Submission; different URIs will be used for any and all new versions of the Member Submission.

NOTE: The previous Namespace (http://www.w3.org/2001/vcard-rdf/3.0#) is deprecated.

Examples used in this Member Submission will use “v” as the prefix for the vCard Namespace and “rdf” for the RDF Namespace. However, any prefix can be utilised as long as it is associated with the correct Namespace. The examples shown will use both [RDF/XML] and [RDF/Turtle] syntaxes.

3. RDF vCard Guidelines

3.1 Classes and Properties

There are eight main vCard types that are RDF Classes: VCard, Name, Address, Organisation, Location, Label, Tel, and Email.

All other vCard types are defined as RDF properties. Note, some of the vCard types, for example BEGIN, END, PROFILE, and VERSION, are not required to be expressed as these are implicitly provided by RDF.

With RDF, statements are made about a resource. The resource in question is identified with a URI. This has similar semantics to the vCard UID type. Hence, RDF descriptions may additionally use the vCard UID (that has been transformed into a valid URI) as the identifier for the RDF resource.

The majority of the vCard property types have string literals as their values (objects of statements) and are simply represented by their property type name and value as specified in the vCard specification [VCARD].

As an example, the following shows an RDF vCard object encoded in XML and Turtle syntax:

    <v:VCard>
      <v:fn>Corky Crystal</v:fn>
      <v:nickname>Corks</v:nickname>
      <v:title>Computer Officer Class 3</v:title>
      <v:email>corky@example.com</v:email>
    </v:VCard>      
   v:VCard
     v:fn "Corky Crystal" ;
     v:nickname "Corks" ;
     v:title "Computer Officer Class 3" ;
     v:email "corky@example.com" .

Also note that some properties can be expressed as text literals or resource values. In the above examples, the email property is expressed as a text literal. If the value can also be expressed as a resource – with a valid URI scheme – then the property can be expressed to indicate this:

 

    <v:email rdf:resource="mailto:corky@example.com"/>
    v:email <mailto:corky@example.com>

See Appendix A for the complete list of Classes and Properties.

3.2 vCard Type Parameters

A number of vCard properties (ie Address, Label, Email, Tel) include the ability to indicate one or more type parameters for the value. For example, to indicate that a Telephone number is a Fax number, or that a particular email address is the preferred value.

To support the vCard mechanisms for type parameters, a number of subclasses have been defined for this purpose:

  • Address: Dom, Home, Intl, Parcel, Postal, Pref, Work
  • Label: Dom, Home, Intl, Parcel, Postal, Pref, Work
  • Email: Internet, X400, Pref
  • Tel: BBS, Car, Cell, Fax, Home, ISDN, Modem, Msg, PCS, Pager, Video, Voice, Work, Pref

These also maybe extended by using a URI that denotes a new kind of type parameter.

To represent these type parameters in RDF, we utilise the <rdf:type> property which allows us to specify the type of a resource by indicating a subclass that represents this type parameter. For example:

 

<v:tel>
  <rdf:Description>  
    <rdf:value>+61 7 555 5555</rdf:value>
    <rdf:type rdf:resource="http://www.w3.org/2006/vcard/ns#Work"/>
    <rdf:type rdf:resource="http://www.w3.org/2006/vcard/ns#Cell"/>
    <rdf:type rdf:resource="http://www.w3.org/2006/vcard/ns#Pref"/>
  </rdf:Description>  
</v:tel>
v:tel
   [ a v:Work, v:Cell, v:Pref ;
     rdf:value "+61 7 5555 5555"
   ] 

NOTE on backwards compatibility: Some previous vCard/RDF documents have used a different method for specifying vCard’s type parameters. These used additional properties, such as fax, mobileTel, workAdr, as a solution. This Member Submission recognises that this approach has been deployed previously and considers these as “short-cut” properties to the more formal approach adopted here. Please see Appendix B for the list of “short-cut” properties. However, this Member Submission recommends the approach described in this section for vCard typed parameters.

3.3 Structured Properties

A number of vCard properties define sub-structure. For example, the “n” property has Family Name and Given Names. It is important to preserve and express this structure and it is fully-supported in the RDF model. For example:

   <v:n>
     <rdf:Description>  
       <v:family-name>Crystal</v:family-name>
       <v:given-name>Corky</v:given-name>
       <v:additional-name>Jacky</v:additional-name>
       <v:honorific-prefix>Dr</v:honorific-prefix>
       <v:honorific-suffix>III</v:honorific-suffix>
     </rdf:Description>  
   </v:n>
  v:n
   [ v:family-name "Crystal" ;
     v:given-name "Corky" ;
     v:additional-name "Jacky" ;
     v:honorific-prefix "Dr" ;
     v:honorific-suffix "III"
   ]  

 

3.4 Binary Values

A number of vCard properties allow for inline binary values (encoded in BASE64) or external references via a URI. These include:

  • photo
  • logo
  • sound
  • key

In the case of inline binary values, we recommend the use of the Data URI [DATAURI] to represent the property value. For example:

<v:photo rdf:resource="data:image/gif;base64,MSJD9s9DS@93299..." />
v:photo <data:image/gif;base64,MSJD9s9DS@93299..." />

And in the case of an external URI reference:

  <v:photo rdf:resource="http://example.com/me.gif"/>
  v:photo <http://example.com/me.gif>

3.5 Agent Property

The Agent property allows the specification or identification of another vCard resource. RDF allows for the Agent vCard resource to be inline with an existing vCard resource. For example:

  <v:fn>Corky Crystal</v:fn>
  <v:title>Research Director</v:title>
  <v:agent>
    <rdf:Description>  
      <v:fn>Billie Kaur</v:fn>
      <v:title>Personal Assistant</v:title>
      <v:email rdf:resource="mailto:billie@example.com"/>
    </rdf:Description>  
  </v:agent>
 
  v:fn "Corky Crystal" ;
  v:title "Research Director" ;
  v:agent
     [ v:fn "Billie Kaur" ;
       v:title "Personal Assistant" ;
       v:email <mailto:billie@example.com>
     ] 

To refer to an external identifier (via a URI) of the Agent resource:

  <v:fn>Corky Crystal</v:fn>
  <v:agent rdf:resource="http://example.com/staff/billie/"/>
  v:fn "Corky Crystal" ;
  v:agent <http://example.com/staff/billie/> ;     

3.6 Geo Property

The RFC2426 vCard Geo Property typically takes a “lat,long” as a literal value. We recommend the use of new latitude and longitude data properties to capture these values explicitly. See Section 4 for an example.

4. RDF vCard Examples

The following is a complete example of an RDF personal vCard.

<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:v="http://www.w3.org/2006/vcard/ns#">
           
  <v:VCard rdf:about = "http://example.com/me/corky" >
    <v:fn>Corky Crystal</v:fn>
    <v:nickname>Corks</v:nickname>
    <v:tel>
      <rdf:Description>  
        <rdf:value>+61 7 5555 5555</rdf:value>
        <rdf:type rdf:resource="http://www.w3.org/2006/vcard/ns#Home"/>
        <rdf:type rdf:resource="http://www.w3.org/2006/vcard/ns#Voice"/>
      </rdf:Description>  
    </v:tel>
    <v:email rdf:resource="mailto:corky@example.com"/>
    <v:adr>
      <rdf:Description>  
        <v:street-address>111 Lake Drive</v:street-address>
        <v:locality>WonderCity</v:locality>
        <v:postal-code>5555</v:postal-code>
        <v:country-name>Australia</v:country-name>
        <rdf:type rdf:resource="http://www.w3.org/2006/vcard/ns#Home"/>
      </rdf:Description>  
    </v:adr>
  </v:VCard>
</rdf:RDF>
  @prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
  @prefix v:  <http://www.w3.org/2006/vcard/ns#> .

  <http://example.com/me/corky> a v:VCard ;
     v:fn "Corky Crystal" ;
     v:nickname "Corks" ;
     v:tel
         [ a v:Home, v:Voice ;
             rdf:value "+61 7 5555 5555"
         ] ; 
     v:email  <mailto:corky@example.com> ;
     v:adr
         [ a v:Home ;
             v:country-name "Australia" ;
             v:locality "WonderCity" ;
             v:postal-code "5555" ;
             v:street-address "111 Lake Drive"
         ] .

The following is a complete example of an RDF organisational vCard including a Geo location.

<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:v="http://www.w3.org/2006/vcard/ns#">
           
  <v:VCard rdf:about = "http://example.com/" >
    <v:fn>Example.Com LLC</v:fn>
    <v:org>
      <rdf:Description>  
        <v:organisation-name>Example.Com LLC</v:organisation-name>
        <v:organisation-unit>Corporate Division</v:organisation-unit>
      </rdf:Description>  
    </v:org>
    <v:adr>
      <rdf:Description>  
        <v:street-address>33 Enterprise Drive</v:street-address>
        <v:locality>WonderCity</v:locality>
        <v:postal-code>5555</v:postal-code>
        <v:country-name>Australia</v:country-name>
        <rdf:type rdf:resource="http://www.w3.org/2006/vcard/ns#Work"/>
      </rdf:Description>  
    </v:adr>
    <v:geo>
      <rdf:Description>  
        <v:latitude>43.33</v:latitude>
        <v:longitude>55.45</v:longitude>
      </rdf:Description>  
    </v:geo>     
    <v:tel>
      <rdf:Description>  
        <rdf:value>+61 7 5555 0000</rdf:value>
        <rdf:type rdf:resource="http://www.w3.org/2006/vcard/ns#Fax"/>
        <rdf:type rdf:resource="http://www.w3.org/2006/vcard/ns#Work"/>
      </rdf:Description>  
    </v:tel>
    <v:email rdf:resource="mailto:info@example.com"/>
    <v:logo rdf:resource="http://example.com/logo.png"/>   
  </v:VCard>
</rdf:RDF>
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix v: <http://www.w3.org/2006/vcard/ns#> .

  <http://example.com/> a v:VCard ;
     v:fn "Example.Com LLC" ;
     v:org
         [   v:organisation-name "Example.Com LLC" ;
             v:organisation-unit "Corporate Division"
         ] ;
     v:adr
         [ a v:Work ;
             v:country-name "Australia" ;
             v:locality "WonderCity" ;
             v:postal-code "5555" ;
             v:street-address "33 Enterprise Drive"
         ] ;
     v:geo
         [ v:latitude "43.33" ;
             v:longitude "55.45"
         ] ;
     v:tel
         [ a v:Fax, v:Work ;
             rdf:value "+61 7 5555 0000"
         ] ; 
     v:email <mailto:info@example.com> ;
     v:logo <http://example.com/logo.png> .

5. RDFa vCard Examples (Informative)

The following is a sample encoding the first example in Section 4 in [RDFa] for inclusion in HTML pages, such as the GoodRelations Ontology for e-commerce product information.

<div xmlns="http://www.w3.org/1999/xhtml"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     xmlns:v="http://www.w3.org/2006/vcard/ns#">
    
   <div about="http://example.com/me/corky" typeof="v:VCard">
     <span property="v:fn">Corky Crystal</span>, also known as 
     <span property="v:nickname">Corks</span>, lives at
     <div rel="v:adr">
         <div typeof="v:Address v:Home">
            <span property="v:street-address">111 Lake Drive</span>, 
            <span property="v:locality">WonderCity</span>, 
            <span property="v:postal-code">5555</span>, 
            <span property="v:country-name">Australia</span>.
         </div>
      </div>
     You can contact her home voice telephone: 
     <div rel="v:tel">
         <div typeof="v:Tel v:Home">
            <span property="rdf:value">+61 7 555 5555</span>
         </div>
      </div>
      or send her an email:
      <a rel="v:email" href="mailto:corky@example.com">corky@example.com</a>.
   </div>
</div>

Appendix A – RDF vCard Ontology Reference

http://www.w3.org/TR/vcard-rdf/
Download PDF XSD

Leave a comment