Avoid setting href as new subject when no rel/rev is present

Hi,

I just found a bug in the RDF output generated on Drupal 7 frontpage [1].
This is the code of interest (cleaned up for clarity):

<div about="/node/12">
  <ul>
    <li>
      <a content="4" property="sioc:num_replies" href="/node/12#comments">4
comments</a>
    </li>
  </ul>
</div>

I initially thought it would create the triple
</node/12> sioc:num_replies "4" .
but it turns out the RDFa parser I use generates
</node/12#comments> sioc:num_replies "4" .

What's happening is that the href URI is set as new subject because there
are no rel/rev (due to the parsing rule 4 at [2]). Adding rel="" does the
trick and the Ubiquity-rdfa parser return the expected triple. Another
option would be to repeat about="/node/12" in the a tag, though I like the
empty rel better:

<div about="/node/12">
  <ul>
    <li>
      <a content="4" property="sioc:num_replies" rel=""
href="/node/12#comments">4 comments</a>
    </li>
  </ul>
</div>

I just wanted to check and make sure there is not problem in using the empty
rel hack, or whether there is a better way of working around this?

Steph.

[1] http://drupalrdf.openspring.net/
[2] http://www.w3.org/TR/rdfa-syntax/#sec_5.5.

Received on Thursday, 14 January 2010 18:56:52 UTC