Aleksander Gralak
Aleksander Gralak

Reputation: 1509

Structured data in HTML - schema.org or GoodRelations

Has anyone some experience and can explain how to use properly structure data in HTML pages. Simple things are easy, but how to perform difficult ones? Is it possible to use different standards like schema.org and GoodRelations.

I would like to have following structures:

A person, whose profession is a doctor with a medicine title. The specialization is neurology and pediatric.

This one is easy (probably there are some mistakes):

<div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Person">
  <span property="v:title" content="dr. medicine"></span>
  <span property="v:name" content="Real Name"></span>
  <span property="v:role" content="neurology"></span>
  <span property="v:role" content="pediatric"></span>
</div>

What about next section? This person works in three different places:

In each place the person is present in different times and days. Each place has different phone no and different geo location. The person has different roles in each place:

And here I am getting confused. How to map all the relations between the person and places? Is it possible to place structure data on different web pages? If so how to reference them.

The organisation snippet (probably many mistakes as well):

<div xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns="http://www.w3.org/1999/xhtml" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:gr="http://purl.org/goodrelations/v1#" xmlns:vcard="http://www.w3.org/2006/vcard/ns#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
  <div about="#poffice" typeof="gr:LocationOfSalesOrServiceProvisioning">
    <div property="rdfs:label" content="Private office"></div>
    <div rel="vcard:adr">
      <div typeof="vcard:Address">
        <div property="vcard:country-name" content="US"></div>
        <div property="vcard:locality" content="New York"></div>
        <div property="vcard:postal-code" content="22 222"></div>
        <div property="vcard:street-address" content="W 4th, 80"></div>
      </div>
     </div>
     <div property="vcard:tel" content="22 222 222 222"></div>
     <div rel="foaf:depiction" resource="http://niceURL/logo.png"></div>
     <div rel="vcard:geo">
      <div>
        <div property="vcard:latitude" content="00.000000" datatype="xsd:float"></div>
        <div property="vcard:longitude" content="00.000000" datatype="xsd:float"></div>
      </div>
     </div>
     <div rel="gr:hasOpeningHoursSpecification">
       <div about="#mon_fri" typeof="gr:OpeningHoursSpecification">
         <div property="gr:opens" content="14:00:00" datatype="xsd:time"></div>
         <div property="gr:closes" content="20:00:00" datatype="xsd:time"></div>
         <div rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Friday"></div>
         <div rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Thursday"></div>
         <div rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Wednesday"></div>
         <div rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Tuesday"></div>
         <div rel="gr:hasOpeningHoursDayOfWeek" resource="http://purl.org/goodrelations/v1#Monday"></div>
       </div>
       <div rel="foaf:page" resource=""></div>
     </div>
  </div>
</div>

Upvotes: 2

Views: 1139

Answers (3)

Martin Hepp
Martin Hepp

Reputation: 1595

Note that as of November 2012, you can use the full GoodRelations conceptual model directly from the schema.org namespace, see

http://wiki.goodrelations-vocabulary.org/Cookbook/Schema.org

See e.g. the following example:

<div itemscope itemtype="http://schema.org/Offer" itemid="#offer">
  <div itemprop="name">Hepp Personal SCSI Controller Card</div>
  <div itemprop="description">The Hepp Personal SCSI is a 16-bit add-on card that allows
attaching up to seven SCSI devices to your computer.</div>
  <link itemprop="businessFunction"
        href="http://purl.org/goodrelations/v1#Sell" />
<!-- Unit price -->
  <div itemscope itemprop="priceSpecification"
       itemtype="http://schema.org/UnitPriceSpecification">Price:
    <meta itemprop="priceCurrency" content="EUR">Euro:
    <span itemprop="price">99.99</span>
    <time itemprop="validThrough"
          datetime="2012-11-30T23:59:59Z"></time>
  </div>
<!-- Shipment fees -->
  Delivery costs to
  <div itemscope itemprop="priceSpecification"
       itemtype="http://schema.org/DeliveryChargeSpecification">
    <meta itemprop="eligibleRegion" content="DE">Germany:
    <meta itemprop="priceCurrency" content="EUR">Euro:
    <span itemprop="price">10.00</span>
    <link itemprop="appliesToDeliveryMethod"
          href="http://purl.org/goodrelations/v1#UPS" />(via UPS)
  </div>
<!-- other offer properties follow here -->
...
</div>

Note that some property names differ slightly between the GoodRelations namespace and the schema.org namespace:

Classes

schema:Offer = gr:Offering
schema:IndividualProduct = gr:Individual
schema:ParcelService = gr:DeliveryModeParcelService
schema:Place = gr:Location
schema:ProductModel = gr:ProductOrServiceModel
schema:CreditCard = gr:PaymentMethodCreditCard
schema:Product = gr:ProductOrService
schema:SomeProducts = gr:SomeItems

Object Properties

schema:priceSpecification = gr:hasPriceSpecification
schema:businessFunction = gr:hasBusinessFunction
schema:eligibleCustomerType = gr:eligibleCustomerTypes
schema:manufacturer = gr:hasManufacturer
schema:warrantyScope = gr:hasWarrantyScope
schema:inventoryLevel = gr:hasInventoryLevel
schema:dayOfWeek = gr:hasOpeningHoursDayOfWeek
schema:brand = gr:hasBrand
schema:itemOffered = gr:includes
schema:makesOffer = gr:offers
schema:availableDeliveryMethod = gr:availableDeliveryMethods
schema:openingHoursSpecification = gr:hasOpeningHoursSpecification
schema:eligibleQuantity = gr:hasEligibleQuantity
schema:warranty = gr:hasWarrantyPromise
schema:image = http://xmlns.com/foaf/0.1/depiction
schema:acceptedPaymentMethod = gr:acceptedPaymentMethods

A special case is schema:durationOfWarranty

This used to be gr:durationOfWarrantyInMonths in GoodRelations but will be updated to match the new name and range from schema.org shortly.

Datatype Properties

schema:minPrice = gr:hasMinCurrencyValue
schema:unitCode = gr:hasUnitOfMeasurement
schema:isicV4 = gr:hasISICv4
schema:gtin8 = gr:hasGTIN-8
schema:maxPrice = gr:hasMaxCurrencyValue
schema:gtin14 = gr:hasGTIN-14
schema:maxValue = gr:hasMaxValue
schema:mpn = gr:hasMPN
schema:value = gr:hasValue
schema:model = gr:hasMakeAndModel
schema:gtin13 = gr:hasEAN_UCC-13
schema:globalLocationNumber = gr:hasGlobalLocationNumber
schema:naics = gr:hasNAICS
schema:priceCurrency = gr:hasCurrency
schema:sku = gr:hasStockKeepingUnit
schema:duns = gr:hasDUNS
schema:minValue = gr:hasMinValue
schema:eligibleRegion = gr:eligibleRegions

Upvotes: 1

Antoine Zimmermann
Antoine Zimmermann

Reputation: 5485

You can use the terms from schema.org in RDFa, and your GoodRelations example is in RDFa too. So use both. One advantage of RDFa is that it is extensible and open ended.

Upvotes: 1

Mildred Tinney
Mildred Tinney

Reputation: 21

Schema.org provides you the different types of data types for structural representation. Visit their website and check for the available data types. There is simple procedure on the website to add the schema.

Upvotes: 2

Related Questions