- From: Ivan Herman <ivan@w3.org>
- Date: Tue, 23 Aug 2011 10:41:50 +0200
- To: Gregg Kellogg <gregg@kellogg-assoc.com>
- Cc: Jeni Tennison <jeni@jenitennison.com>, W3C RDFWA WG <public-rdfa-wg@w3.org>
On Aug 22, 2011, at 21:29 , Gregg Kellogg wrote: > I'm CCing the RDFa WG, as this suggests a possible issue with precedence of terms from the default profile and @vocab, which I believe has been discussed before. > Actually... yes, that is an issue but, in this particular case, there is another one. I think we have an action on Nathan that he would review the default HTML 'terms' (like 'first') to see whether these really make sense in a semantic sense. That action should determine which of these would be part of the default set of terms in HTML. Ivan >> Hi Gregg, >> >> I'm trying out mapping some microdata examples into RDFa, and came up with this RDFa to represent a list: >> >> <div vocab="#" typeof> >> <p>Flavors in my favorite ice cream:</p> >> <div rel="flavor"> >> <ul vocab="http://www.w3.org/1999/02/22-rdf-syntax-ns#" typeof="List"> >> <li property="first">Lemon sorbet</li> >> <li rel="rest"> >> <span typeof="List"> >> <span property="first">Apricot sorbet</span> >> <span rel="rest" resource="nil"></span> >> </span> >> </li> >> </ul> >> </div> >> </div> >> >> aiming to get: >> >> @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . >> [] >> <#flavor> [ >> a rdf:List ; >> rdf:first "Lemon sorbet" ; >> rdf:rest [ >> rdf:first "Apricot sorbet" ; >> rdf:rest rdf:nil ; >> ] ; >> ] ; >> . >> >> What I actually get with your RDF Distiller is: >> >> @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . >> >> <> <#flavor> [ a rdf:List], >> [ <#rest> [ <#first> "Apricot sorbet"; >> <#rest> <nil>; >> a <#List>]] . > > As previously mentioned, there is a special rule on the root element (and <head> and <body> with HTML+RDFa) in which @about="" is assumed, so this will not generate a BNode as the top subject. > > It's not parsing @resource="nil" as a vocab-expanded URI, but as a document-relative URI. This is because the rules for @resource don't include terms, and @vocab uses the same rules as term (SafeCURIEorCURIEorURI not TERMorCURIEorAbsURI). To make this work, you'll need to use a full URI or a CURIE. Using @resource="rdf:nil" should work, as the 'rdf' prefix is defined in the default profile. > > One more gotcha I discovered: If you process the document as HTML+RDFa, @property="first" doesn't generate rdf:first, as the @vocab might indicate; rather, it generate xhv:first; this is because the (X)HTML+RDFa spec defines "first" as a term in the default profile, which trumps @vocab. So, really, your example can only work reliably if you use rdf: prefixes throughout. It worked in the distiller, as it wasn't identified as being an HTML document. > > <div vocab="#" typeof> > <p>Flavors in my favorite ice cream:</p> > <div rel="flavor"> > <u typeof="rdf:List"> > <li property="rdf:first">Lemon sorbet</li> > <li rel="rdf:rest"> > <span typeof="rdf:List"> > <span property="rdf:first">Apricot sorbet</span> > <span rel="rdf:rest" resource="rdf:nil"></span> > </span> > </li> > </ul> > </div> > </div> > > Would you assume that @vocab should trump terms in the default profile (now renamed to something else, due to dropping @profile)? If so, please file a bug. > > Gregg > > On Aug 14, 2011, at 3:16 PM, Jeni Tennison wrote: > >> ... >> Cheers, >> >> Jeni >> -- >> Jeni Tennison >> http://www.jenitennison.com >> > > ---- 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 Tuesday, 23 August 2011 08:39:27 UTC