W3C home > Mailing lists > Public > public-vocabs@w3.org > September 2012

Re: Updated Microdata to RDF Working Draft

From: Gregg Kellogg <greggkellogg@gmail.com>
Date: Wed, 26 Sep 2012 11:40:07 -0700
Cc: Semantic Web <semantic-web@w3.org>, "public-html-data-tf@w3.org WG" <public-html-data-tf@w3.org>, "public-vocabs@w3.org Vocabularies" <public-vocabs@w3.org>
Message-Id: <EBD86FF9-2F47-4252-B32D-9447E201DA56@gmail.com>
To: Adrian Giurca <giurca@tu-cottbus.de>
On Sep 26, 2012, at 6:28 AM, Adrian Giurca <giurca@tu-cottbus.de> wrote:

> Hi Gregg and all,

What Dan wrote is fine about microdata itself, but I believe we can still inovate on how we interpret that microdata when converting it to RDF, which is the spirit of the draft update to the note.

> A large work on Vocabulary Expansion described in Section 4 of the working draft work [1] is based on some constraints of the Microdata specification [7]:
> 
> Microdata requires that all values of @itemtype come from the same vocabulary. This is required as @itemprop values are resolved relative to that vocabulary

To be clear, only non-URL elements of @itemprop are resolved to @itemtype. You can still have URL elements to @itemprop and have them come from a different vocabulary.

> I slightly changed your Example 13 from [1]  to allow two types and two properties:
> 
> <div itemscope itemtype="http://schema.org/Person"
> >
>   <link itemprop="additionalType" href=
> "http://xmlns.com/foaf/0.1/Person"
>  />
>   <p itemprop="
> email">mail@gmail.com
> </p>
> </div>	
> 
> I would like to use foaf:mbox on the above example and it seems to me that following the current spec [7] is difficult if not impossible. Possible solutions such as:
> <meta content="mailto:mail@gmail.com" itemprop="http://xmlns.com/foaf/0.1/mbox"
> />
> 
> may don't work as a processor may relate http://xmlns.com/foaf/0.1/mbox to http://schema.org/Person and not to the "additional type".

A microdata to RDF processor will not relate foaf:mbox to schema.org; that is only done for values of @itemprop which are tokens.

From Generate Predicate URI:
[[[
1) if _name_ is an absolute URL, return _name_ as a URI reference.
]]]

You can do this using a single element (although I'd tend to use an anchor for the email addresses). For example:

<div itemscope itemtype="http://schema.org/Person">
  <link itemprop="additionalType" href="http://xmlns.com/foaf/0.1/Person"/>
  <a itemprop="email http://xmlns.com/foaf/0.1/mbox" href="mailto:mail@gmail.com">mail@gmail.com</a>
</div>

results in the following:

<> md:item ([ a schema:Person,
         foaf:Person;
       schema:additionalType foaf:Person;
       schema:email <mailto:mail@gmail.com>;
       foaf:mbox <mailto:mail@gmail.com>]);
   rdfa:usesVocabulary schema: .

schema:additionalType rdfs:subPropertyOf rdf:type .

>  (the original example with GoodRelations was somehow different as any GoodRelation Product is subclass of http://schema.org/Product therefore the @name property is  inherited by Goodrelations Product)
> 
> I kindly ask you, also people from the HTML data task force as well as Microdata spec editors about rationales behind the actual Microdata specification [7] . I understand the concern of using namespaces but still is not enough clear why @itemtype and @itemprop does not allow items from different vocabularies.

Again, the restriction is on @itemtype having values from multiple vocabularies. This is because if they are from multiple vocabularies it is not clear what vocabulary @itemprop property names should be related to, unless they are absolute URIs. I believe this is consistent against both microdata JSON and microdata RDF interpretations.

> Indeed, allowing multiple vocabularies  using only @itemtype and @itemprop attributes and no namespaces requires processors to relate to schemas of these vocabularies and may also introduce name ambiguity (as schema does not provide URI for properties). 

Within schema.org, I believe, properties are defined to be in a flat namespace within http://schema.org/, as are types. This is the interpretation of the _vocabulary_ URI generation scheme.

> In any case adding @additionalType may not be the most elegant solution as it appears  not solving the problem of multiple vocabularies.

From an RDF perspective, and particularly given the new vocabulary expansion rules, this does generate appropriate RDF. For microdata JSON interpretation, it is intended to be up to the vocabulary as to how to interpret properties and values, and they have defined additionalType to be a way to extend @itemtype.

Gregg

> Thank you,
> Adrian Giurca
> 
> [7] http://www.whatwg.org/specs/web-apps/current-work/multipage/microdata.html
> 
> On 9/20/2012 8:22 AM, Gregg Kellogg wrote:
>> I've prepared an updated Microdata to RDF Working Draft for review [1]. Please note that, as this is a Note of the Semantic Web Interest Group, and the HTML Data Task Force is complete, the official place for feedback is semantic-web@w3.org
>> .
>> 
>> This update adds support for vocabulary expansion, principally to support features such as schema:additionalType. Microdata vocabulary expansion is a subset of RDFa vocabulary expansion, and is fully compatible with RDFa, such that toolsets which process both RDFa 1.1 and Microdata to RDF can use a single vocabulary expansion algorithm, although its use in Microdata is mandatory, whereas it is optional in RDFa 1.1.
>> 
>> To support vocabulary expansion, additional features are added to the registry: within a vocabulary, a property can be either specified as "equivalentProperty" of another IRI, or "subPropertyOf" another IRI, to use either owl:equivalentProperty or rdfs:subPropertyOf expansion rules. The default registry has been updated for additionalType as follows:
>> 
>> {
>>   
>> "http://schema.org/"
>> : {
>>     ...
>>     "properties": {
>>       "additionalType": {"subPropertyOf": 
>> "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
>> }
>>       ...
>>     }
>> }
>> 
>> Note that the current published registry [2] has not been updated. The version of the registry used for this working draft is available in the supplement [3], and in the mercurial repository [4].
>> 
>> Additionally, when a vocabulary is detected, an rdfa:usesVocabulary triple is generated, which enables the RDFa 1.1 vocabulary expansion toolchain. If at some point schema.org includes OWL2 expansion rules supported by RDFa within the vocabulary definition, this will allow full use of this through RDFa tool chains which support Microdata to RDF.
>> 
>> The draft references the test-suite [5], which now has a number of tests (currently 74) available to help developers check processor conformance. This includes all of the current schema.org microdata examples.
>> 
>> After a reasonable feedback period, this working draft will update the current published note [6].
>> 
>> Thanks to Ivan for invaluable help in preparing this update.
>> 
>> Gregg Kellogg
>> 
>> gregg@greggkellogg.net
>> 
>> 
>> [1] 
>> http://dvcs.w3.org/hg/htmldata/raw-file/default/ED/microdata-rdf/20120919/
>> 
>> [2] 
>> http://www.w3.org/ns/md
>> 
>> [3] 
>> https://dvcs.w3.org/hg/htmldata/raw-file/default/microdata-supplement/index.html
>> 
>> [4] 
>> https://dvcs.w3.org/hg/htmldata/raw-file/default/microdata-namespace/ns.json
>> 
>> [5] 
>> http://dvcs.w3.org/hg/htmldata/raw-file/default/microdata-rdf/tests/
>> 
>> [6] 
>> http://www.w3.org/TR/2012/NOTE-microdata-rdf-20120308/
>> 
>> 
>> 
> 
Received on Wednesday, 26 September 2012 18:40:40 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 26 September 2012 18:40:40 GMT