Re: htmldata-ISSUE-4 (Property as subject): Should the registry allow a property name or URI to be used as an alias for @itemid [Microdata to RDF]

Gregg,

this line of adding more and more behavioural constraints into that registry becomes more and more complex to me. The other issue I have with this particular problem is that this would also mean a complication for the reproduction of the schema.org patterns in RDFa; indeed, the registry feature below would not work for RDFa, ie, schema.org examples encoded in RDFa would look quite different from their microdata equivalent. Not good. 

I was wondering whether a totally different approach would not be better and more appropriate. Namely:

- there is one, canonical, mapping from microdata to RDF. For practical purposes, to make the mapping as close to the biggest microdata usage, namely schema.org, let us make it as close as possible to what schema.org proposes.
- there would be a registry for vocabularies defining some rules that can transform RDF to RDF; application may, if necessary, make use of these rules.

The caveat is that, unfortunately, there is no real rule engine syntax well accepted by the RDF community. Except that we can use SPARQL CONSTRUCT queries for that purpose. The extra bonus is that converters may use SPARQL engines to get the conversion done, for example. Using this, I believe what you describe in the current issue is:

CONSTRUCT {
  ?uri a ?t ;
       ?p ?o .
}
WHERE {
  ?b a ?t ;
     schema:uri ?uri ;
     ?p ?o .
  FILTER( ?p != schema.uri && ?p != rdf:type )
}

Thoughts?

Ivan


On Nov 5, 2011, at 19:21 , HTML Data Task Force Issue Tracker wrote:

> 
> htmldata-ISSUE-4 (Property as subject): Should the registry allow a property name or URI to be used as an alias for @itemid [Microdata to RDF]
> 
> http://www.w3.org/2011/htmldata/track/issues/4
> 
> Raised by: Gregg Kellogg
> On product: Microdata to RDF
> 
> Schema.org provides a 'url' property which, in practice, is used to set the subject for an item. Moreover, in many examples, the property is used with a literal content model, rather than a URI content model.
> 
> For example, the following use case is common in schema.org examples:
> 
> 
> <div itemprop="tracks" itemscope itemtype="http://schema.org/MusicRecording">
>   <span itemprop="name">Rope</span>
>   <meta itemprop="url" content="foo-fighters-rope.html">
>   ...
> </div>
> 
> In this case the @content attribute is used where the value is expected to be a URI. And, it is clear that this URI is intended as the subject of the item.
> 
> A registry entry could be created which would affect processing of a microdata processor by specifying a content model for the property (URI reference) and that it is to be used as the subject of an item. Note, that there is a special case where the item already has an @itemid attribute, or there are more than one 'url' property values. This could be resolved by using the first property value only if the item has no @itemid.
> 
> The suggested behavior would be to use the first 'url' property value both as the item subject and as a property and subsequent values as a property only.
> 
> For example, the previous microdata would produce the following Turtle:
> 
> <foo-fighers-rope.html> a schema:MusicRecording;
>  schema:name "Rope";
>  schema:url <foo-fighters-rope.html> .
> 
> A possible JSON representation of a registry that identifies this could be the following:
> 
> {
>  "http://schema.org/": {
>    "propertyURI": "vocabulary",
>    "multipleValues": "unordered",
>    "@context": {
>      "url": { "@datatype": ["@subject", "@uri"]},
>      "dateCreated": {"@datatype": "http://www.w3.org/2001/XMLSchema#date"},
>      ...
>    }
>  }
> }
> 
> This notation borrows some concepts from the JSON-LD context, but it is intended for discussion and is not proposed as a repository syntax. As the range is described, any use of this property would treat the value as a URI reference. As a by-product, this can be used for URIs (or IRIs) which are not URLs.
> 
> The 'url' refers to http://schema.org/url, and is defined both as having a URI reference data range, and to be used as an alias for the item subject. In contrast, http://schema.org/dateCreated is defined as having an xsd:date range, which would cause the resulting literal to have the associated datatype.
> 
> 
> 
> 


----
Ivan Herman, W3C Semantic Web Activity Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
PGP Key: http://www.ivan-herman.net/pgpkey.html
FOAF: http://www.ivan-herman.net/foaf.rdf

Received on Sunday, 6 November 2011 10:14:29 UTC