Mapping_Microdata_to_RDF 19.2 KB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" dir="ltr">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<meta name="generator" content="MediaWiki 1.15.5" />
		<meta name="keywords" content="Mapping Microdata to RDF,Html-data-tf" />
		<link rel="shortcut icon" href="/favicon.ico" />
		<link rel="search" type="application/opensearchdescription+xml" href="/wiki/opensearch_desc.php" title="W3C Wiki (en)" />
		<link rel="alternate" type="application/rss+xml" title="W3C Wiki RSS feed" href="/wiki/index.php?title=Special:RecentChanges&amp;feed=rss" />
		<link rel="alternate" type="application/atom+xml" title="W3C Wiki Atom feed" href="/wiki/index.php?title=Special:RecentChanges&amp;feed=atom" />
		<title>Mapping Microdata to RDF - W3C Wiki</title>
		<link rel="stylesheet" href="/wiki/skins/common/shared.css?207" type="text/css" media="screen" />
		<link rel="stylesheet" href="/wiki/skins/common/commonPrint.css?207" type="text/css" media="print" />
		<link rel="stylesheet" href="/wiki/skins/w3cmonobook/main.css?207" type="text/css" media="screen" />
		<!--[if lt IE 5.5000]><link rel="stylesheet" href="/wiki/skins/w3cmonobook/IE50Fixes.css?207" type="text/css" media="screen" /><![endif]-->
		<!--[if IE 5.5000]><link rel="stylesheet" href="/wiki/skins/w3cmonobook/IE55Fixes.css?207" type="text/css" media="screen" /><![endif]-->
		<!--[if IE 6]><link rel="stylesheet" href="/wiki/skins/w3cmonobook/IE60Fixes.css?207" type="text/css" media="screen" /><![endif]-->
		<!--[if IE 7]><link rel="stylesheet" href="/wiki/skins/w3cmonobook/IE70Fixes.css?207" type="text/css" media="screen" /><![endif]-->
		<link rel="stylesheet" href="/wiki/index.php?title=MediaWiki:Common.css&amp;usemsgcache=yes&amp;ctype=text%2Fcss&amp;smaxage=18000&amp;action=raw&amp;maxage=18000" type="text/css" />
		<link rel="stylesheet" href="/wiki/index.php?title=MediaWiki:Print.css&amp;usemsgcache=yes&amp;ctype=text%2Fcss&amp;smaxage=18000&amp;action=raw&amp;maxage=18000" type="text/css" media="print" />
		<link rel="stylesheet" href="/wiki/index.php?title=MediaWiki:W3cmonobook.css&amp;usemsgcache=yes&amp;ctype=text%2Fcss&amp;smaxage=18000&amp;action=raw&amp;maxage=18000" type="text/css" />
		<link rel="stylesheet" href="/wiki/index.php?title=-&amp;action=raw&amp;maxage=18000&amp;gen=css" type="text/css" />
		<!--[if lt IE 7]><script type="text/javascript" src="/wiki/skins/common/IEFixes.js?207"></script>
		<meta http-equiv="imagetoolbar" content="no" /><![endif]-->

		<script type= "text/javascript">/*<![CDATA[*/
		var skin = "w3cmonobook";
		var stylepath = "/wiki/skins";
		var wgArticlePath = "/wiki/$1";
		var wgScriptPath = "/wiki";
		var wgScript = "/wiki/index.php";
		var wgVariantArticlePath = false;
		var wgActionPaths = {};
		var wgServer = "http://www.w3.org";
		var wgCanonicalNamespace = "";
		var wgCanonicalSpecialPageName = false;
		var wgNamespaceNumber = 0;
		var wgPageName = "Mapping_Microdata_to_RDF";
		var wgTitle = "Mapping Microdata to RDF";
		var wgAction = "view";
		var wgArticleId = "6023";
		var wgIsArticle = true;
		var wgUserName = null;
		var wgUserGroups = null;
		var wgUserLanguage = "en";
		var wgContentLanguage = "en";
		var wgBreakFrames = false;
		var wgCurRevisionId = 55481;
		var wgVersion = "1.15.5";
		var wgEnableAPI = true;
		var wgEnableWriteAPI = true;
		var wgSeparatorTransformTable = ["", ""];
		var wgDigitTransformTable = ["", ""];
		var wgRestrictionEdit = [];
		var wgRestrictionMove = [];
		/*]]>*/</script>

		<script type="text/javascript" src="/wiki/skins/common/wikibits.js?207"><!-- wikibits js --></script>
		<!-- Head Scripts -->
		<script type="text/javascript" src="/wiki/skins/common/ajax.js?207"></script>
		<link rel="alternate" type="application/rdf+xml" title="Mapping Microdata to RDF" href="/wiki/index.php?title=Special:ExportRDF/Mapping_Microdata_to_RDF&amp;xmlmime=rdf" />
		<script type="text/javascript" src="/wiki/index.php?title=-&amp;action=raw&amp;gen=js&amp;useskin=w3cmonobook"><!-- site js --></script>
	</head>
<body class="mediawiki ltr ns-0 ns-subject page-Mapping_Microdata_to_RDF skin-w3cmonobook">
	<div id="globalWrapper">
		<div id="column-content">
	<div id="content">
		<a id="top"></a>
				<h1 id="firstHeading" class="firstHeading">Mapping Microdata to RDF</h1>
		<div id="bodyContent">
			<h3 id="siteSub">From W3C Wiki</h3>
			<div id="contentSub"></div>
									<div id="jump-to-nav">Jump to: <a href="#column-one">navigation</a>, <a href="#searchInput">search</a></div>			<!-- start content -->
			<p>This page describes how microdata content can be consumed by a consumer whose back-end systems are based on an RDF (or RDF-like) model, as part of the work of the <a href="/wiki/Html-data-tf" title="Html-data-tf">HTML Data TF</a>.
</p><p>Transformation description moved to <a href="https://dvcs.w3.org/hg/htmldata/raw-file/default/microdata-rdf/index.html" class="external text" title="https://dvcs.w3.org/hg/htmldata/raw-file/default/microdata-rdf/index.html" rel="nofollow">ReSpec document</a>
</p>
<table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1"><a href="#Property_URI_generation"><span class="tocnumber">1</span> <span class="toctext">Property URI generation</span></a>
<ul>
<li class="toclevel-2"><a href="#Vocabulary-specific_URI_generation"><span class="tocnumber">1.1</span> <span class="toctext">Vocabulary-specific URI generation</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="#Multiple_types_for_an_item"><span class="tocnumber">2</span> <span class="toctext">Multiple types for an item</span></a></li>
<li class="toclevel-1"><a href="#Examples"><span class="tocnumber">3</span> <span class="toctext">Examples</span></a></li>
</ul>
</td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
<a name="Property_URI_generation" id="Property_URI_generation"></a><h2> <span class="mw-headline"> Property URI generation </span></h2>
<p>Microdata allows properties to be specified as simple names, which then have a URI generation rule applied to them. As different vocabularies have different
requirements for property URIs, the idea is to provide a way to inform the processor of how to generate URIs, and have the processor fall back to a specific
URI generation strategy if no other information is available.
</p><p>There are  different strategies for generating property URIs from names:
</p>
<dl><dt>hashSlash
</dt><dd> Infer the vocabulary from the @itemtype, and append the name to the resulting vocabulary URI. This would take advantage of the typically RDF strategy of having a flat namespace for classes and properties, so that the class name could be removed from the @itemtype URI to which the name can be appended. For example, if the type were <code><a href="http://schema.org/Thing" class="external free" title="http://schema.org/Thing" rel="nofollow">http://schema.org/Thing</a></code> the property 'name' would be be <code><a href="http://schema.org/name" class="external free" title="http://schema.org/name" rel="nofollow">http://schema.org/name</a></code>. Types are inherited by items without an @itemtype. Items without a type (explicit or inherited) append the name to the document base URI, in the case that the item has no type. For example, if the document had a base of <code><a href="http://example.com/doc" class="external free" title="http://example.com/doc" rel="nofollow">http://example.com/doc</a></code>, name could be appended along with a '#', yielding <code><a href="http://example.com/doc#name" class="external free" title="http://example.com/doc#name" rel="nofollow">http://example.com/doc#name</a></code>
</dd><dt>fragID
</dt><dd> Append the name to the @itemtype URI. For example, given the URI <code><a href="http://microformats.org/profile/hcard" class="external free" title="http://microformats.org/profile/hcard" rel="nofollow">http://microformats.org/profile/hcard</a></code> as the type, the property 'fn' would result in the following URI: <code><a href="http://microformats.org/profile/hcard#fn" class="external free" title="http://microformats.org/profile/hcard#fn" rel="nofollow">http://microformats.org/profile/hcard#fn</a></code>. Note this is only possible if the type does not include a '#', which would result in an error and/or no generated property URI.
</dd><dt>contextual
</dt><dd> Append the name to a combination of @itemtype and the property path, and ensure that property URIs generated from names are distinct from explicit property URIs. For example, given the type <code><a href="http://microformats.org/profile/hcard" class="external free" title="http://microformats.org/profile/hcard" rel="nofollow">http://microformats.org/profile/hcard</a></code>, the property 'fn' would result in <code><a href="http://www.w3.org/1999/xhtml/microdata#http://microformats.org/profile/hcard#:%23fn" class="external free" title="http://www.w3.org/1999/xhtml/microdata#http://microformats.org/profile/hcard#:%23fn" rel="nofollow">http://www.w3.org/1999/xhtml/microdata#http://microformats.org/profile/hcard#:%23fn</a></code>. However, if there is an intervening item without a type, it would construct a different URI. Assuming an intervening property 'foo', the resulting URI would be <code><a href="http://www.w3.org/1999/xhtml/microdata#http://microformats.org/profile/hcard#:%23foo%20fn" class="external free" title="http://www.w3.org/1999/xhtml/microdata#http://microformats.org/profile/hcard#:%23foo%20fn" rel="nofollow">http://www.w3.org/1999/xhtml/microdata#http://microformats.org/profile/hcard#:%23foo%20fn</a></code>.
</dd></dl>
<p>These strategies can be the value of a _propertyURIGeneration_ parameter added to the initial evaluation context.
</p>
<a name="Vocabulary-specific_URI_generation" id="Vocabulary-specific_URI_generation"></a><h3> <span class="mw-headline"> Vocabulary-specific URI generation </span></h3>
<p>A registry may associate different vocabularies with property URI generation schemes, for example:
</p>
<pre>
&lt;http://schema.org/&gt; a&nbsp;:Vocabulary;&nbsp;:propertyURIscheme&nbsp;:slashHash .
&lt;http://microformats.org/profile/hcard&gt; a&nbsp;:Vocabulary;&nbsp;:propertyURIscheme&nbsp;:contextual .
</pre>
<p>A vocabulary-aware processor could then change URI generation schemes when encountering @itemtype URIs contained in the registry, and fallback to a default setting otherwise.
</p>
<a name="Multiple_types_for_an_item" id="Multiple_types_for_an_item"></a><h2> <span class="mw-headline"> Multiple types for an item </span></h2>
<p>TBD.
</p>
<a name="Examples" id="Examples"></a><h2> <span class="mw-headline"> Examples </span></h2>
<p>Additional examples can be added here.
</p><p>An example of a  a <a href="http://schema.org/Organization" class="external free" title="http://schema.org/Organization" rel="nofollow">http://schema.org/Organization</a> that is the provider, publisher and copyrightHolder of a <a href="http://schema.org/NewsArticle" class="external free" title="http://schema.org/NewsArticle" rel="nofollow">http://schema.org/NewsArticle</a>. 
When converting this sample to RDF, it might be interesting that the "itemid" of the Organization object happens to be the same URL that is used as a property expecting a URL (the "url" property of <a href="http://schema.org/Thing" class="external free" title="http://schema.org/Thing" rel="nofollow">http://schema.org/Thing</a> in this case) from the same object. The "url" property of <a href="http://schema.org/Thing" class="external free" title="http://schema.org/Thing" rel="nofollow">http://schema.org/Thing</a> is not meant to take a <a href="http://schema.org/Organization" class="external free" title="http://schema.org/Organization" rel="nofollow">http://schema.org/Organization</a> as a value, but a URL.    
</p>
<pre>
&lt;body itemscope=&quot;itemscope&quot; itemtype=&quot;http://schema.org/NewsArticle&quot;
  itemid=&quot;http://www.businesswire.com/news/home/20110106006854/en&quot;&gt;
...
&lt;span itemprop=&quot;provider publisher copyrightHolder&quot; itemscope=&quot;itemscope&quot;
          itemtype=&quot;http://schema.org/Organization&quot; itemid=&quot;http://businesswire.com&quot;&gt;
  &lt;meta itemprop=&quot;name&quot; content=&quot;Business Wire&quot;/&gt;
  &lt;a itemprop=&quot;url&quot; href=&quot;http://www.businesswire.com&quot;&gt;
     &lt;img itemprop=&quot;image&quot;
              src=&quot;http://www.businesswire.com/images/Powered-by-Business-Wire.gif&quot;
              title=&quot;Business Wire is the leading source for full-text breaking news and press releases, 
              multimedia and regulatory filings for companies and groups throughout the world&quot;
              alt=&quot;Powered by Business Wire&quot;/&gt;
  &lt;/a&gt;
&lt;/span&gt;
...
&lt;/body&gt;
</pre>
<p><br />
The resulting RDF from this example is:
</p>
<pre>
&lt;http://www.businesswire.com/news/home/20110106006854/en&gt; a schema:NewsArticle;
 schema:copyrightHolder &lt;http://www.businesswire.com&gt; .


&lt;http://businesswire.com&gt; a schema:Organization;
   schema:image &lt;http://www.businesswire.com/images/Powered-by-Business-Wire.gif&gt;;
   schema:name &quot;Business Wire&quot;;
   schema:url &lt;http://www.businesswire.com&gt; .
</pre>

<!-- 
NewPP limit report
Preprocessor node count: 14/1000000
Post-expand include size: 0/2097152 bytes
Template argument size: 0/2097152 bytes
Expensive parser function count: 0/100
-->

<!-- Saved in parser cache with key wikidb-esw_:pcache:idhash:6023-0!1!0!!en!2!edit=0 and timestamp 20120116024315 -->
<div id='RDFa' about='http://www.w3.org/wiki/Mapping_Microdata_to_RDF' xmlns:wiki_1='http://www.w3.org/wiki/index.php/'xmlns:wiki_1_property='http://www.w3.org/wiki/index.php/Property:'xmlns:wiki_1_category='http://www.w3.org/wiki/index.php/Category:' typeof='wiki_1_categoryHTML Data TF'>
<div property='wiki_1_property:Modification_date' content='21 October 2011 23:08:07'></div>
</div><div style='display:none' ></div><div class="printfooter">
Retrieved from "<a href="http://www.w3.org/wiki/Mapping_Microdata_to_RDF">http://www.w3.org/wiki/Mapping_Microdata_to_RDF</a>"</div>
			<div id='catlinks' class='catlinks'><div id="mw-normal-catlinks"><a href="/wiki/Special:Categories" title="Special:Categories">Category</a>:&#32;<span dir='ltr'><a href="/wiki/index.php?title=Category:HTML_Data_TF&amp;action=edit&amp;redlink=1" class="new" title="Category:HTML Data TF (page does not exist)">HTML Data TF</a></span></div></div>			<!-- end content -->
						<div class="visualClear"></div>
		</div>
	</div>
		</div>
		<div id="column-one">
	<div id="p-cactions" class="portlet">
		<h5>Views</h5>
		<div class="pBody">
			<ul>
	
				 <li id="ca-nstab-main" class="selected"><a href="/wiki/Mapping_Microdata_to_RDF" title="View the content page [c]" accesskey="c">Page</a></li>
				 <li id="ca-talk" class="new"><a href="/wiki/index.php?title=Talk:Mapping_Microdata_to_RDF&amp;action=edit&amp;redlink=1" title="Discussion about the content page [t]" accesskey="t">Discussion</a></li>
				 <li id="ca-viewsource"><a href="/wiki/index.php?title=Mapping_Microdata_to_RDF&amp;action=edit" title="This page is protected.&#10;You can view its source [e]" accesskey="e">View source</a></li>
				 <li id="ca-history"><a href="/wiki/index.php?title=Mapping_Microdata_to_RDF&amp;action=history" title="Past revisions of this page [h]" accesskey="h">History</a></li>			</ul>
		</div>
	</div>
	<div class="portlet" id="p-personal">
		<h5>Personal tools</h5>
		<div class="pBody">
			<ul>
				<li id="pt-login"><a href="/wiki/index.php?title=Special:UserLogin&amp;returnto=Mapping_Microdata_to_RDF" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o">Log in</a></li>
			</ul>
		</div>
	</div>
	<div class="portlet" id="p-logo">
		<a style="background-image: url(/Icons/w3c_home);" href="/wiki/Main_Page" title="Visit the main page [z]" accesskey="z"></a>
	</div>
	<script type="text/javascript"> if (window.isMSIE55) fixalpha(); </script>
	<div class='generated-sidebar portlet' id='p-navigation'>
		<h5>Navigation</h5>
		<div class='pBody'>
			<ul>
				<li id="n-mainpage"><a href="/wiki/Main_Page" title="Visit the main page">Main Page</a></li>
				<li id="n-Browse-categories"><a href="/wiki/Special:Categories">Browse categories</a></li>
				<li id="n-recentchanges"><a href="/wiki/Special:RecentChanges" title="The list of recent changes in the wiki [r]" accesskey="r">Recent changes</a></li>
				<li id="n-Help"><a href="http://www.mediawiki.org/wiki/Help:Contents">Help</a></li>
			</ul>
		</div>
	</div>
	<div id="p-search" class="portlet">
		<h5><label for="searchInput">Search</label></h5>
		<div id="searchBody" class="pBody">
			<form action="/wiki/index.php" id="searchform"><div>
				<input type='hidden' name="title" value="Special:Search"/>
				<input id="searchInput" name="search" type="text" title="Search W3C Wiki [f]" accesskey="f" value="" />
				<input type='submit' name="go" class="searchButton" id="searchGoButton"	value="Go" title="Go to a page with this exact name if exists" />&nbsp;
				<input type='submit' name="fulltext" class="searchButton" id="mw-searchButton" value="Search" title="Search the pages for this text" />
			</div></form>
		</div>
	</div>
	<div class="portlet" id="p-tb">
		<h5>Toolbox</h5>
		<div class="pBody">
			<ul>
				<li id="t-whatlinkshere"><a href="/wiki/Special:WhatLinksHere/Mapping_Microdata_to_RDF" title="List of all wiki pages that link here [j]" accesskey="j">What links here</a></li>
				<li id="t-recentchangeslinked"><a href="/wiki/Special:RecentChangesLinked/Mapping_Microdata_to_RDF" title="Recent changes in pages linked from this page [k]" accesskey="k">Related changes</a></li>
<li id="t-specialpages"><a href="/wiki/Special:SpecialPages" title="List of all special pages [q]" accesskey="q">Special pages</a></li>
				<li id="t-print"><a href="/wiki/index.php?title=Mapping_Microdata_to_RDF&amp;printable=yes" rel="alternate" title="Printable version of this page [p]" accesskey="p">Printable version</a></li>				<li id="t-permalink"><a href="/wiki/index.php?title=Mapping_Microdata_to_RDF&amp;oldid=55481" title="Permanent link to this revision of the page">Permanent link</a></li><li id="t-smwbrowselink"><a href="/wiki/Special:Browse/Mapping_Microdata_to_RDF" title="Special:Browse/Mapping Microdata to RDF">Browse properties</a></li>			</ul>
		</div>
	</div>
		</div><!-- end of the left (by default at least) column -->
			<div class="visualClear"></div>
			<div id="footer">
				<div id="f-poweredbyico"><a href="http://www.mediawiki.org/"><img src="/wiki/skins/common/images/poweredby_mediawiki_88x31.png" alt="Powered by MediaWiki" /></a></div>
			<ul id="f-list">
					<li id="lastmod"> This page was last modified on 16 November 2011, at 21:23.</li>
					<li id="viewcount">This page has been accessed 8,223 times.</li>
					<li id="privacy"><a href="/wiki/W3C_Wiki:Privacy_policy" title="W3C Wiki:Privacy policy">Privacy policy</a></li>
					<li id="about"><a href="/wiki/W3C_Wiki:About" title="W3C Wiki:About">About W3C Wiki</a></li>
					<li id="disclaimer"><a href="/wiki/W3C_Wiki:General_disclaimer" title="W3C Wiki:General disclaimer">Disclaimers</a></li>
			</ul>
		</div>
</div>

		<script type="text/javascript">if (window.runOnloadHook) runOnloadHook();</script>
<!-- Served in 0.245 secs. --></body></html>