W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > November 2011

Re: Behavior of @property with @typeof and incomplete triples

From: Gregg Kellogg <gregg@kellogg-assoc.com>
Date: Sat, 12 Nov 2011 13:09:00 -0500
To: Ivan Herman <ivan@w3.org>
CC: RDFa WG <public-rdfa-wg@w3.org>
Message-ID: <46096CD4-9F7B-43ED-B3FD-B99FF34B58F2@greggkellogg.net>
On Nov 12, 2011, at 12:28 AM, Ivan Herman wrote:

> Gregg,
> 
> I have not looked at the details of the processing steps, just at my implementation. I am looking at what I would expect here to happen...
> 
> First, let us look at an RDF 1.0 case, and using @rel instead of @property; also, put @typeof aside, using a @resource instead:
> 
> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:foaf="http://xmlns.com/foaf/0.1/" version="XHTML+RDFa 1.0">
> <head>
>   <title>Test 0058</title>
> </head>
> <body>
>   <div about="http://www.example.org/#ben" rel="foaf:knows">
>     <p rel="foaf:homepage" resource="http://www.ex.org/">Mark Birbeck</p>
>     <p rel="foaf:homepage" resource="http://www.ex1.org/">Ivan Herman</p>
>   </div>
> </body>
> </html>
> 
> What we get in 1.0:
> 
> @prefix foaf: <http://xmlns.com/foaf/0.1/> .
> @prefix ns1: <http://www.example.org/#> .
> 
> ns1:ben foaf:knows [ foaf:homepage <http://www.ex.org/>,
>                <http://www.ex1.org/> ] .
> 
> (This is how RDFa 1.0 solves the case of 'double' chaining in some way. I checked your distiller, it produces the same thing!)
> 
> If I switch to 1.1, the difference is minimal (removing xmlns) :
> 
> <html xmlns="http://www.w3.org/1999/xhtml" version="XHTML+RDFa 1.1">
> <head>
>   <title>Test 0058</title>
> </head>
> <body>
>   <div about="http://www.example.org/#ben" rel="foaf:knows">
>     <p rel="foaf:homepage" resource="http://www.ex.org/">Mark Birbeck</p>
>     <p rel="foaf:homepage" resource="http://www.ex1.org/">Ivan Herman</p>
>   </div>
> </body>
> </html>
> 
> The generated RDF is the same.

This is certainly what I would expect. But, just because @property is now much like @rel, doesn't mean that use cases with hanging rels and @property should be treated equivalently. Admittedly, this is a grey area, and certainly not something that could come up in RDFa Lite scenarios.

> Now I exchange to property:
> 
> <html xmlns="http://www.w3.org/1999/xhtml" version="XHTML+RDFa 1.1">
> <head>
>   <title>Test 0058</title>
> </head>
> <body>
>   <div about="http://www.example.org/#ben" rel="foaf:knows">
>     <p property="foaf:homepage" resource="http://www.ex.org/">Mark Birbeck</p>
>     <p property="foaf:homepage" resource="http://www.ex1.org/">Ivan Herman</p>
>   </div>
> </body>
> </html>
> 
> And the generated RDF is still the same! Great, this is what we wanted...
> 
> Now I can add @typeof. The philosophy is that, in presence of @property, the @typeof is bound to the resource. So if I take:
> 
> <html xmlns="http://www.w3.org/1999/xhtml" version="XHTML+RDFa 1.1">
> <head>
>   <title>Test 0058</title>
> </head>
> <body>
>   <div about="http://www.example.org/#ben" rel="foaf:knows">
>     <p property="foaf:homepage" resource="http://www.ex.org/" typeof="schema:Thing">Mark Birbeck</p>
>     <p property="foaf:homepage" resource="http://www.ex1.org/"  typeof="schema:Thing">Ivan Herman</p>
>   </div>
> </body>
> </html>
> 
> I get: 
> 
> @prefix foaf: <http://xmlns.com/foaf/0.1/> .
> @prefix ns1: <http://www.example.org/#> .
> @prefix schema: <http://schema.org/> .
> 
> ns1:ben foaf:knows [ foaf:homepage <http://www.ex.org/>,
>                <http://www.ex1.org/> ] .
> 
> <http://www.ex.org/> a schema:Thing .
> 
> <http://www.ex1.org/> a schema:Thing .
> 
> and, I believe, this is what one would expect! Finally, I remove the @resource; again, the philosophy is that @typeof would create a bnode; in effect, a @typeof alone is a shorthand for a @resource="_:a":
> 
> <html xmlns="http://www.w3.org/1999/xhtml" version="XHTML+RDFa 1.1">
> <head>
>   <title>Test 0058</title>
> </head>
> <body>
>   <div about="http://www.example.org/#ben" rel="foaf:knows">
>     <p property="foaf:homepage" typeof="schema:Thing">Mark Birbeck</p>
>     <p property="foaf:homepage" typeof="schema:Thing">Ivan Herman</p>
>   </div>
> </body>
> </html>
> 
> And I get:
> 
> @prefix foaf: <http://xmlns.com/foaf/0.1/> .
> @prefix ns1: <http://www.example.org/#> .
> @prefix schema: <http://schema.org/> .
> 
> ns1:ben foaf:knows [ foaf:homepage [ a schema:Thing ],
>                [ a schema:Thing ] ] .
> 
> Which still looks o.k. to me!
> 
> The bottom line is that in the new setup the original test would create a backward compatibility issue. Yes, that is a pain. But I am not sure that we have to go out of our way to handle that case when, I believe, the current rule is consistent.
> 
> Your turn to convince me:-)

It's always difficult to determine author's intent. My typically use of hanging @rel is to reduce repetition, particularly in the case where no new HTML markup is required. Consider for example:

<div>Editors:
  <li rel="bibo:editor" property="foaf:name" typeof="foaf:Person">Gregg Kellogg</li>,
  <li rel="bibo:editor" property="foaf:name" typeof="foaf:Person">Ivan Herman</li>
</div>

Hanging rels allow me to by more DRY by promoting @rel:

<div rel="bibo:editor">Editors:
  <li property="foaf:name" typeof="foaf:Person">Gregg Kellogg</li>,
  <li property="foaf:name" typeof="foaf:Person">Ivan Herman</li>
</div>

If this is indeed a common pattern (and figuring out a regexp to test for it will be somewhat challenging), then we'd introduce breakage. Ideally, we'd be able to look at the range of the property to determine intent, but we really can't.

In any case, it's certainly a judgement call which way to go. When I was looking at test-suite failures, it struck me as being odd, but your examples are really just as convincing. I can really go either way, just wanted to raise the issue for discussion.

> What actually makes me think: I think somebody (you? Toby?) should probably create a separate W3C Note on the backward compatiblity/incompatibility issues. 

Yes, we do need something like this. I'd be happy to help put something like this together, but I'm a bit over committed to do it on my own right now.

Gregg

> Ivan
> 
> 
> 
> 
> On Nov 11, 2011, at 21:24 , Gregg Kellogg wrote:
> 
>> No surprisingly, there's a bit more to this.
>> 
>> In Step 5, the first option should be:
>> 
>> [[[
>> 1. If the current element contains the @property attribute, but does not contains neither the @content nor @datatype attributes and the  incomplete triples within the current context is empty, then ...
>> ]]]
>> 
>> Additionally in Step 11, the case where a resource attribute is present also needs to ensure that there are no incomplete triples.
>> 
>> Gregg
>> 
>> On Nov 11, 2011, at 11:58 AM, Gregg Kellogg wrote:
>> 
>>> As I mentioned before, the new @property/@typeof rules break some tests, including 0058. This one is interesting, because it involves the use of both hanging @rels, @typeof and @property.
>>> 
>>> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:foaf="http://xmlns.com/foaf/0.1/" version="XHTML+RDFa 1.1">
>>> <head>
>>>  <title>Test 0058</title>
>>> </head>
>>> <body>
>>>  <div about="http://www.example.org/#ben" rel="foaf:knows">
>>>    <p typeof="foaf:Person" property="foaf:name">Mark Birbeck</p>
>>>    <p typeof="foaf:Person" property="foaf:name">Ivan Herman</p>
>>>  </div>
>>> </body>
>>> </html>
>>> 
>>> The new rules say that because both <p> elements have a @typeof and @property, it results in chaining to a new BNode. This is in Step 5 (part 1). In Step 11, the "otherwise, if @typeof is present ..." causes "typed resource" to be used as the @property value. But, the existence of incomplete triples is intended to pick up these new objects. I think we need to revise this step:
>>> 
>>> [[[
>>> 11.
>>> ...
>>> otherwise, if @typeof is present and @about is not and the  incomplete triples within the current context is empty, the value of typed resource.
>>> ]]]
>>> 
>>> This also applies to test 0078, 0081, and 0082.
>>> 
>>> Gregg
>>> 
>>> 
>> 
>> 
> 
> 
> ----
> Ivan Herman, W3C Semantic Web Activity Lead
> Home: http://www.w3.org/People/Ivan/
> mobile: +31-641044153
> FOAF: http://www.ivan-herman.net/foaf.rdf
> 
> 
> 
> 
> 
Received on Saturday, 12 November 2011 18:10:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 27 April 2012 04:55:18 GMT