WebSchemas/MultipleTypesSDO

From W3C Wiki
Jump to: navigation, search

Multi-Type Entities (MTEs) and their properties via schema.org

Case

Types & properties as defined in this document

  • schema.org/Product and schema.org/Service have been combined to form one entity so to provide access to the properties of both types.
  • External enumerations, global & fragment identifiers and an extra ontology (productontology.org) have been added to provide more specific data about certain entities.

Issues

  • Markup validators by schema.org's sponsors Yandex & Google do not seem to support Multi Type Entities as their reports show markup errors.
  • Support for Global Identifiers is inconsistent.
  • Google's Webmaster Tools seems to pick up MTEs but reports about each type used separately, meaning an MTE consisting out of 2 types will generate 2 'data type' entries, which should be in fact a single 'MTE'.


Examples

A business making an offer for Repair Services in an area, as a business function

<div itemscope itemtype="http://schema.org/LocalBusiness">
    <h1>
        <a itemprop="url" href="http://example.com/johns-quick-repair">
            <span itemprop="name">John's Quik Repair</span>
        </a>
    </h1>
    <img itemprop="logo" src="http://example.com/johns-quik-repair-logo.jpg" alt="John's Quik Repair logo" title width="60" height="60" />
    <div itemprop="makesOffer" itemscope itemtype="http://schema.org/Offer">
        <div itemprop="businessFunction" itemscope itemtype="http://schema.org/BusinessFunction">
            <link itemprop="url" href="http://purl.org/goodrelations/v1#Repair" />
        </div>
        <div itemprop="itemOffered" itemscope itemtype="http://schema.org/Product http://schema.org/Service">
            <p>
                <img itemprop="image" src="http://example.com/drywall-repair.jpg" alt="Drywall Repair" title width="120" height="120" />
                <span itemprop="serviceArea" itemscope itemtype="http://schema.org/AdministrativeArea">
                    <span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
                        <span itemprop="addressLocality">Dallas</span> - <span itemprop="addressLocality">Fort Worth</span>, 
                        <span itemprop="addressRegion">Texas</span>, <span itemprop="addressCountry">USA</span>
                    </span>
                </span><br />
                Service Type: <span itemprop="name serviceType">Drywall Repair</span>
            </p>
            <p itemprop="description">
                Placerat magnis vut tempor? Nisi auctor sit massa, etiam nunc sed augue aenean in, 
                eu diam, elit est, dis placerat, arcu augue nascetur, facilisis, sit in.
            </p>
        </div> 
    </div>
</div>


An offer for Repair Services in an area, as a business function, including a seller

<div itemscope itemtype="http://schema.org/Offer">
    <div itemprop="seller" itemscope itemtype="http://schema.org/LocalBusiness">
        <h1>
            <a itemprop="url" href="http://example.com/johns-quick-repair">
                <span itemprop="name">John's Quik Repair</span>
            </a>
        </h1>
        <img itemprop="logo" src="http://example.com/johns-quik-repair-logo.jpg" alt="John's Quik Repair logo" title width="60" height="60" />
    </div>
    <div itemprop="businessFunction" itemscope itemtype="http://schema.org/BusinessFunction">
        <link itemprop="url" href="http://purl.org/goodrelations/v1#Repair" />
    </div>
    <div itemprop="itemOffered" itemscope itemtype="http://schema.org/Product http://schema.org/Service">
        <p>
            <img itemprop="image" src="http://example.com/drywall-repair.jpg" alt="Drywall Repair" title width="120" height="120" />
            <span itemprop="serviceArea" itemscope itemtype="http://schema.org/AdministrativeArea">
            <span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
                <span itemprop="addressLocality">Dallas</span> - <span itemprop="addressLocality">Fort Worth</span>, 
                <span itemprop="addressRegion">Texas</span>, <span itemprop="addressCountry">USA</span>
            </span>
            </span><br />
            Service Type: <span itemprop="name serviceType">Drywall Repair</span>
        </p>
        <p itemprop="description">
            Placerat magnis vut tempor? Nisi auctor sit massa, etiam nunc sed augue aenean in, 
            eu diam, elit est, dis placerat, arcu augue nascetur, facilisis, sit in.
        </p>
    </div>
</div>


Repair Services as a business function in an area, including a provider, being offered

<div itemscope itemtype="http://schema.org/Product http://schema.org/Service">
    <div itemprop="provider" itemscope itemtype="http://schema.org/LocalBusiness">		
        <h1>
            <a itemprop="url" href="http://example.org/johns-quick-repair">
                <span itemprop="name">John's Quik Repair</span>
            </a>
        </h1>
        <img itemprop="logo" src="http://example.org/johns-quik-repair-logo.jpg" alt="John's Quik Repair logo" title width="60" height="60" />
    </div>
    <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
        <span itemprop="businessFunction" itemscope itemtype="http://schema.org/BusinessFunction">
            <link itemprop="url" href="http://purl.org/goodrelations/v1#Repair" />
        </span>
    </div>
    <p>
        <img itemprop="image" src="http://example.org/drywall-repair.jpg" alt="Drywall Repair" title width="120" height="120" />
        <span itemprop="serviceArea" itemscope itemtype="http://schema.org/AdministrativeArea">
            <span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
                <span itemprop="addressLocality">Dallas</span> - <span itemprop="addressLocality">Fort Worth</span>, 
                <span itemprop="addressRegion">Texas</span>, <span itemprop="addressCountry">USA</span>
            </span>
        </span><br />
        Service Type: <span itemprop="name serviceType">Drywall Repair</span>
    </p>
    <p itemprop="description">
        Placerat magnis vut tempor? Nisi auctor sit massa, etiam nunc sed augue aenean in, 
        eu diam, elit est, dis placerat, arcu augue nascetur, facilisis, sit in.
    </p>
</div>


All in one Linked Data solution

In microdata (by using @itemid)

<div itemid="#LocalBusiness" itemscope itemtype="http://schema.org/LocalBusiness">
    <h1>
        <a itemprop="url" href="http://example.org/johns-quick-repair">
            <span itemprop="name">John's Quik Repair</span>
        </a>
    </h1>
    <img itemprop="logo" src="http://example.com/johns-quik-repair-logo.jpg" alt="John's Quik Repair logo" title width="60" height="60" />
    <div itemid="#Offer" itemprop="makesOffer" itemscope itemtype="http://schema.org/Offer">
        <link itemprop="seller" href="#LocalBusiness" />
        <div itemprop="businessFunction" itemscope itemtype="http://schema.org/BusinessFunction">
            <link itemprop="url" href="http://purl.org/goodrelations/v1#Repair" />
        </div>
        <div itemid="#ProductService" itemprop="itemOffered" itemscope itemtype="http://schema.org/Product http://schema.org/Service">
            <link itemprop="provider" href="#LocalBusiness" />
            <p>
                <img itemprop="image" src="http://example.com/drywall-repair.jpg" alt="Drywall Repair" title width="120" height="120" />
                <span itemprop="serviceArea" itemscope itemtype="http://schema.org/AdministrativeArea">
                    <span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
                        <span itemprop="addressLocality">Dallas</span> - <span itemprop="addressLocality">Fort Worth</span>, 
                        <span itemprop="addressRegion">Texas</span>, <span itemprop="addressCountry">USA</span>
                    </span>
                </span><br />
                Service Type: <span itemprop="name serviceType">Drywall Repair</span>
            </p>
            <p itemprop="description">
                Placerat magnis vut tempor? Nisi auctor sit massa, etiam nunc sed augue aenean in, 
                eu diam, elit est, dis placerat, arcu augue nascetur, facilisis, sit in.
            </p>
        </div> 
    </div>
</div>


In RDFa (by using @resource)

<div vocab="http://schema.org/" resource="#LocalBusiness" typeof="LocalBusiness">
    <h1>
        <a property="url" href="http://example.com/johns-quick-repair">
            <span property="name">John's Quik Repair</span>
        </a>
    </h1>
    <img property="logo" src="http://example.com/johns-quik-repair-logo.jpg" alt="John's Quik Repair logo" title width="60" height="60" />
    <div resource="#Offer" property="makesOffer" typeof="Offer">
        <link property="seller" href="#LocalBusiness" />
        <div property="businessFunction" typeof="BusinessFunction">
            <link property="url" href="http://purl.org/goodrelations/v1#Repair" />
        </div>
        <div resource="#ProductService" property="itemOffered" typeof="Product Service">
            <link property="provider" href="#LocalBusiness" />
            <p>
                <img property="image" src="http://example.com/drywall-repair.jpg" alt="Drywall Repair" title width="120" height="120" />
                <span property="serviceArea" typeof="AdministrativeArea">
                    <span property="address" typeof="PostalAddress">
                        <span property="addressLocality">Dallas</span> - <span property="addressLocality">Fort Worth</span>, 
                        <span property="addressRegion">Texas</span>, <span property="addressCountry">USA</span>
                    </span>
                </span><br />
                Service Type: <span property="name serviceType">Drywall Repair</span>
            </p>
            <p property="description">
                Placerat magnis vut tempor? Nisi auctor sit massa, etiam nunc sed augue aenean in, 
                eu diam, elit est, dis placerat, arcu augue nascetur, facilisis, sit in.
            </p>
        </div> 
    </div>
</div>


Structured Data Testing Tools Offered as Free Global Services

Google's Structured Data Testing Tool (in microdata)

<div itemid="https://developers.google.com/structured-data/testing-tool/" itemscope itemtype="http://schema.org/Product http://schema.org/Service">
    <link itemprop="additionalType" href="http://www.productontology.org/id/Validator">
    <link itemprop="additionalType" href="http://www.productontology.org/id/Semantic_publishing">
    <a itemprop="url" href="https://developers.google.com/structured-data/testing-tool/">
        <span itemid="http://www.google.com" itemprop="brand manufacturer provider" itemscope itemtype="http://schema.org/Corporation">
            <span itemprop="name">Google</span>
            <link itemprop="makesOffer" href="#Offer">
        </span> 
        <span itemprop="name">Structured Data Testing Tool</span>
    </a>
    <span itemprop="serviceArea" itemscope itemtype="http://schema.org/AdministrativeArea">
        <span itemid="http://en.wikipedia.org/wiki/Earth" itemprop="geo" itemscope itemtype="http://schema.org/GeoShape">
            <meta itemprop="name" content="Earth">
            <link itemprop="sameAs" href="http://dbpedia.org/page/Earth">
            <link itemprop="sameAs" href="http://www.freebase.com/m/02j71">
            <link itemprop="sameAs" href="http://www.wikidata.org/wiki/Q2">
        </span>
    </span>
    <span itemid="#Offer" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
        <link itemprop="itemOffered" href="https://developers.google.com/structured-data/testing-tool/">
        <link itemprop="seller" href="http://www.google.com">
        <span itemprop="businessFunction" itemscope itemtype="http://schema.org/BusinessFunction">
            <link itemprop="url" href="http://purl.org/goodrelations/v1#ProvideService">
        </span>
        <link itemprop="eligibleRegion" href="http://en.wikipedia.org/wiki/Earth">
        <meta itemprop="priceCurrency" content="USD">
        <meta itemprop="price" content="0">
    </span>
</div>


Yandex's Structured Data Validator (in RDFa)

<div vocab="http://schema.org/" prefix="pto: http://www.productontology.org/id/" resource="https://webmaster.yandex.com/microtest.xml" 
typeof="Product Service pto:Validator pto:Semantic_publishing">
     <a property="url" href="https://webmaster.yandex.com/microtest.xml">
        <span resource="https://www.yandex.com/" property="brand manufacturer provider" typeof="Corporation">
            <span property="name">Yandex</span>
            <link property="makesOffer" href="#Offer">
        </span>
        <span property="name">Structured Data Validator</span>
    </a>
    <span property="serviceArea" typeof="AdministrativeArea">
        <span resource="http://en.wikipedia.org/wiki/Earth" property="geo" typeof="GeoShape">
            <meta property="name" content="Earth">
            <link property="sameAs" href="http://dbpedia.org/page/Earth">
            <link property="sameAs" href="http://www.freebase.com/m/02j71">
            <link property="sameAs" href="http://www.wikidata.org/wiki/Q2">
        </span>
    </span>
    <span resource="#Offer" property="offers" typeof="Offer">
        <link property="itemOffered" href="https://webmaster.yandex.com/microtest.xml">
        <link property="seller" href="https://www.yandex.com/">
        <span property="businessFunction" typeof="BusinessFunction">
            <link property="url" href="http://purl.org/goodrelations/v1#ProvideService">
        </span>
        <link property="eligibleRegion" href="http://en.wikipedia.org/wiki/Earth">
        <meta property="priceCurrency" content="USD">
        <meta property="price" content="0">
    </span>
</div>


Structured Data Initiative's Structured Data Linter (in JSON-LD)

<script type="application/ld+json">
{
    "@context":"http://schema.org",
    "@id":"http://linter.structured-data.org/",
    "@type":["Product","Service","http://www.productontology.org/id/Validator","http://www.productontology.org/id/Semantic_publishing"],
    "url":"http://linter.structured-data.org/",
    "brand":{
        "@id":"http://structured-data.org/",
        "@type":"Organization",
        "name":"Structured Data Initiative",
        "makesOffer":"http://example.com/#Offer"
    },
    "manufacturer":"http://structured-data.org/",
    "provider":"http://structured-data.org/",
    "name":"Structured Data Linter",
    "serviceArea":{
        "@type":"AdministrativeArea",
        "geo":{
            "@id":"http://en.wikipedia.org/wiki/Earth",
            "@type":"GeoShape",
            "name":"Earth",
            "sameAs":["http://dbpedia.org/page/Earth","http://www.freebase.com/m/02j71","http://www.wikidata.org/wiki/Q2"]
        }
    },
    "offers":{
        "@id":"http://example.com/#Offer",
        "@type":"Offer",
        "itemOffered":"http://linter.structured-data.org/",
        "seller":"http://structured-data.org/",
        "businessFunction":{
            "@type":"BusinessFunction",
            "url":"http://purl.org/goodrelations/v1#ProvideService"
        },
        "eligibleRegion":"http://en.wikipedia.org/wiki/Earth",
        "priceCurrency":"USD",
        "price":"0"
    }
}
</script>