Home | Index

SearchMonkey Guide

Examples

Business Addresses and Reviews

This section shows examples of how to represent address information for persons and organizations using VCard. More advanced business listings might use SearchMonkey Commerce and RDF Review.

Components

To mark up a local business listing:

  • Initial declaration: Start with a dc:subject with a type of vcard:VCard and commerce:listingType, where listingType can be Restaurant, Hotel, or the catch-all, Business.

    <y:adjunct version="1.0" name="local" xmlns:y="http://search.yahoo.com/datarss/">
      <y:item rel="dc:subject" resource="http://local.yahoo.com/resource/restaurant/Parcel_104">
        <y:type typeof="vcard:VCard commerce:Restaurant">
    ...

    The resource attribute identifies the business as a URL resource. If present, this URL should not be retrievable or provide a 303 redirect.

  • Address, Telephone, and Website: Add the business's physical address using a vcard:Address block. Both the URL to the website and the telephone number should lie outside the block. The URL should represent the business's actual website, not a 3rd-party listing page for the business. The telephone number should conform to an international format.

    <y:item rel="vcard:adr">
      <y:type typeof="vcard:Address">
        <y:meta property="vcard:street-address">2700 Mission College Blvd</y:meta>
        <y:meta property="vcard:locality">Santa Clara</y:meta>
        <y:meta property="vcard:region">CA</y:meta>
        <y:meta property="vcard:postal-code" datatype="xsd:integer">95054</y:meta>
        <y:meta property="vcard:country-name">United States</y:meta>
      </y:type>
    </y:item>
    
    <y:item rel="vcard:url" resource="http://www.parcel104.com"/>
    <y:meta property="vcard:tel">+1 408 970-6104</y:meta>

    If the address is not available in parsed form, use an rdfs:label to contain the address as a generic string.

    <y:item rel="vcard:adr">
      <y:item typeof="vcard:Address">
        <y:meta property="rdfs:label">2700 Mission College Blvd, Santa Clara, CA 95054</y:meta>
      </y:item>
    </y:item>

    If you have geolocation coordinates for the business, you can specify this information using a vcard:geo block.

    <y:item rel="vcard:geo">
      <y:meta property="vcard:latitude" datatype="xsd:float">...</y:meta>
      <y:meta property="vcard:longitude" datatype="xsd:float">...</y:meta>
    </y:item>
  • Commercial Information: Use the SearchMonkey Commerce vocabulary to provide as much commercial information as you can:

    <y:meta property="commerce:priceRange">3</y:meta>
    <y:meta property="commerce:priceRangeHighest">5</y:meta>
    <y:meta property="commerce:paymentOptions">Credit Cards</y:meta>
    <y:meta property="commerce:parkingOptions">Valet parking &amp; parking lot</y:meta>
    <y:meta property="commerce:attire">Business casual</y:meta>
    <y:meta property="commerce:businessCategory">Restaurants, American Restaurants</y:meta>
    <y:meta property="commerce:cuisine">American</y:meta>
  • Reviews: Create a review block. Start with a review:hasReview with a type of review:Review.

    <y:item rel="review:hasReview">
      <y:type typeof="review:Review">

    Describe the reviewer with a review:reviewer block:

    <y:item rel="review:reviewer">
      <y:type typeof="vcard:VCard foaf:Person">
        <y:meta property="vcard:fn foaf:nickname">shopper</y:meta>
        <y:item rel="vcard:url foaf:homepage"
          resource="http://local.yahoo.com/profile?target=a_kKONumAdupvEtcqxHGYOiuSPxvaXDIUidcI/"/>
      </y:type>
    </y:item>

    Provide the review title and text content. If necessary, escape the review text with a CDATA block.

    <y:meta property="review:title"> A real treat! </y:meta>
    <y:meta property="review:text"> Parcel 104 is a real treat! The food is
    fantastic, and it is nice not to be buried in tons of food that is too much
    for one meal. The quality of food is great, and is a real foodie's delight!
    Yes, it is pricey, but worth it! The service is also fantastic. If you've
    never been there, I recommend you give it a try. </y:meta>

    Alternatively, you can provide a link to the review text:

    <y:item rel="rdfs:seeAlso" resource="http://upcoming.yahoo.com/event/790775#eventComments"/>

    The review's timestamp should be a valid xsd:dateTime.

    <y:meta property="dc:date" datatype="xsd:dateTime">2008-06-05T04:05:06+07:00</y:meta>

    Specify the actual review value along with the maximum and minimum value for that rating. In SearchMonkey and other standard Yahoo! rating systems, standard ratings are measured in stars from 1 to 5, with half star ratings allowed in between. Thus, you should provide a rating between 1 and 5. If your rating falls outside this range, you must remember to scale it when displaying it as a graphical star rating.

    <y:meta property="review:rating" datatype="xsd:integer">5</y:meta>
    <y:meta property="review:minRating" datatype="xsd:integer">1</y:meta>
    <y:meta property="review:maxRating" datatype="xsd:integer">5</y:meta>

    If the system supports "reviews of the reviews", as in "12 of 13 users found this review helpful", use review:positiveVotes and review:totalVotes.

    <y:meta property="review:positiveVotes" datatype="xsd:integer">12</y:meta>
    <y:meta property="review:totalVotes" datatype="xsd:integer">13</y:meta>

    When describing an aggregate review, include the number of reviewers:

    <y:meta property="review:totalRatings" datatype="xsd:integer">1</y:meta>

Simple Local Listing Example

The following example is of a simple local listing, including the business's name, address, telephone number, and website.

<y:adjunct version="1.0" name="local-simple" xmlns:y="http://search.yahoo.com/datarss/">
  <y:item rel="dc:subject">
    <y:type typeof="vcard:VCard commerce:Restaurant">
      <y:meta property="vcard:fn">Parcel 104</y:meta>
      <y:item rel="vcard:adr">
        <y:meta property="vcard:street-address">2700 Mission College Blvd</y:meta>
        <y:meta property="vcard:locality">Santa Clara</y:meta>
        <y:meta property="vcard:region">CA</y:meta>
        <y:meta property="vcard:postal-code" datatype="xsd:integer">95054</y:meta>
        <y:meta property="vcard:country-name">United States</y:meta>
      </y:item>
      <y:item rel="vcard:geo">
        <y:meta property="vcard:latitude" datatype="xsd:float">...</y:meta>
        <y:meta property="vcard:longitude" datatype="xsd:float">...</y:meta>
      </y:item>
      <y:item rel="vcard:url" resource="http://www.parcel104.com"/>
      <y:meta property="vcard:tel">(408) 970-6104</y:meta>
      <y:meta property="commerce:cuisine">American</y:meta>
    </y:type>
  </y:item>
</y:adjunct>

Advanced Local Listing Example

The following example is of a more complex local listing, including business reviews.

<y:adjunct version="1.0" name="local-advanced" xmlns:y="http://search.yahoo.com/datarss/">
    <!-- Resource attribute is optional: it identifies the restaurant as a resource.
	     If provided, it should not be retrievable OR provide 303 redirect.
	 -->
    <y:item rel="dc:subject">
        <y:type typeof="vcard:VCard commerce:Restaurant">

            <y:meta property="rdfs:label vcard:fn">Parcel 104</y:meta>

            <y:meta property="rdfs:comment"> A collaborative venture of renowned chefs, Bradley
                Ogden and Robert Sapirman. The American-themed menu celebrates seasonal delights and
                showcases the finest efforts of local growers, ranches and dairies. </y:meta>

            <y:meta property="commerce:hoursOfOperation"> Breakfast daily, Lunch Mon.-Fri., Dinner
                Mon.-Sat. </y:meta>

            <!-- Lowest price range is 1 -->
            <y:meta property="commerce:priceRange">3</y:meta>
            <y:meta property="commerce:priceRangeHighest">5</y:meta>

            <y:meta property="commerce:paymentOptions">Credit Cards</y:meta>
            <y:meta property="commerce:parkingOptions">Valet parking &amp; parking lot</y:meta>

            <y:meta property="commerce:attire">Business casual</y:meta>

            <y:meta property="commerce:businessCategory">Restaurants, American Restaurants</y:meta>

            <y:meta property="commerce:cuisine">American</y:meta>

            <!-- If address is not available in parsed form, use
                        <y:item rel="vcard:adr">
                            <y:item typeof="vcard:Address">
                    		     <y:meta property="rdfs:label">2700 Mission College Blvd, Santa Clara, CA 95054</y:meta>
                            </y:item>
                    	</y:item>
                     	-->

            <y:item rel="vcard:adr">
                <y:type typeof="vcard:Address">
                    <y:meta property="vcard:street-address">2700 Mission College Blvd</y:meta>
                    <y:meta property="vcard:locality">Santa Clara</y:meta>
                    <y:meta property="vcard:region">CA</y:meta>
                    <y:meta property="vcard:postal-code" datatype="xsd:integer">95054</y:meta>
                    <y:meta property="vcard:country-name">United States</y:meta>
                </y:type>
            </y:item>

            <y:item rel="vcard:geo">
                <y:meta property="vcard:latitude" datatype="xsd:float">...</y:meta>
                <y:meta property="vcard:longitude" datatype="xsd:float">...</y:meta>
            </y:item>

            <y:item rel="vcard:url" resource="http://www.parcel104.com"/>

            <!-- Provide phone in international format -->
            <y:meta property="vcard:tel">+1 408 970-6104</y:meta>

            <!-- See the following documentation for more vcard properties: 
                        
                            http://www.w3.org/2006/vcard/ns
                            
                        -->

            <y:item rel="action:sendToPhone" resource="http://local.yahoo.com/sendtophone.php"/>

            <!-- Review -->
            <y:item rel="review:hasReview">
                <y:type typeof="review:Review">

                    <y:item rel="review:reviewer">
                        <y:type typeof="vcard:VCard foaf:Person">
                            <y:meta property="vcard:fn foaf:nickname">shopper</y:meta>
                            <y:item rel="vcard:url foaf:homepage"
                                resource="http://local.yahoo.com/profile?target=a_kKONumAdupvEtcqxHGYOiuSPxvaXDIUidcI/"
                            />
                        </y:type>
                    </y:item>

                    <y:meta property="review:title"> A real treat! </y:meta>

                    <y:meta property="review:text"> Parcel 104 is a real treat! The food is
                        fantastic, and it is nice not to be buried in tons of food that is too much
                        for one meal. The quality of food is great, and is a real foodie's delight!
                        Yes, it is pricey, but worth it! The service is also fantastic. If you've
                        never been there, I recommend you give it a try. </y:meta>

                    <!-- Alternatively, link to the webpage or fragment of page where the review is provided. 
                                    <y:item rel="rdfs:seeAlso" resource="http://upcoming.yahoo.com/event/790775#eventComments"/>
                                -->
                    <!-- Review image such as an image showing the number of stars or thumbs up/down.
                                    <y:item rel="rdfs:seeAlso media:image" resource="http://example.org/stars"/>
                                -->

                    <y:meta property="dc:date" datatype="xsd:dateTime">2008-06-05T04:05:06+07:00</y:meta>

                    <y:meta property="review:rating" datatype="xsd:integer">5</y:meta>
                    <y:meta property="review:minRating" datatype="xsd:integer">1</y:meta>
                    <y:meta property="review:maxRating" datatype="xsd:integer">5</y:meta>
                    <!-- Include the number of reviewers when describing an aggregate review 
                                    <y:meta property="review:totalRatings" datatype="xsd:integer">1</y:meta>
                                -->

                    <!-- Include the number of positive and total usefulness votes when available
                                    <y:meta property="review:positiveVotes" datatype="xsd:integer">12</y:meta>                 
                                    <y:meta property="review:totalVotes" datatype="xsd:integer">13</y:meta>
                                -->

                    <!-- See the following vocabulary for more review properties 
                                    
                                    http://www.purl.org/stuff/rev#
                                -->
                </y:type>
            </y:item>
        </y:type>
    </y:item>
</y:adjunct>