- From: Manu Sporny <msporny@digitalbazaar.com>
- Date: Sun, 13 Dec 2009 22:21:52 -0500
- To: "public-html@w3.org" <public-html@w3.org>
Ennals, Robert wrote: > <div about="_:bnode" vocab="whatever"> > <span property="name">Rob</span> > <div rel="knows" typeof="Person"> > <span property="name">Manu</span> > <span property="special-power">RDFa wizardry</span> > </div> > </div> > > ... then it doesn't work, the link between me and > Manu isn't made, and we need the indirection node again. > > RDFa makes my head hurt... I've always found that slamming my forehead repeatedly into my monitor can numb the pain of learning RDFa. :) <--- joking Here's something that might help: ----------------------------------------------------------------------- Almost everything in RDFa happens in this order - subject - predicate - object In order to do anything in RDFa - you must have a subject. Use @about or @typeof on an element to set the subject. In order to link two things together, you must have a predicate. Use @rel/@rev or @property on an element to set the predicate. The final piece is the object. If you want to link to another URL, use @rel/@rev for the predicate and @href or @resource for the object. If you want text, use @property on an element and the text contents of the element for the object. ----------------------------------------------------------------------- That's the basics of RDFa in roughly two paragraphs of text. So, let's apply this to your markup. The reason that you're probably expecting _:bnode to link with foaf:knows to _:bnode (typeof: Person) is because you think that the @rel applies before the @typeof. > <div about="_:bnode" vocab="whatever"> > <span property="name">Rob</span> > <div rel="knows" typeof="Person"> So, you think the order of processing in the above snippet is this: @vocab, @about, @property, "Rob", @rel, @typeof when in reality it is this: @vocab, @about, @property, "Rob", @typeof, @rel and that is because "Almost everything in RDFa happens in this order - subject - predicate - object". So, to reformulate a bit, you think this is happening: vocab, subject, predicate, object, predicate, subject when in reality, this is happening: vocab, subject, predicate, object, subject, predicate Since subject is almost always processed first, then @about and @typeof will always be processed before @rel, @rev and @property (which are used to set predicates). I realize that this is a somewhat strange way to explain this, so if you'd like it explained in a different way, we can try something different. The core of the issue, though, is that you may think that RDFa's processing order is more complicated than it is. -- manu -- Manu Sporny (skype: msporny, twitter: manusporny) President/CEO - Digital Bazaar, Inc. blog: Bitmunk 3.2 Launched - The Legal P2P Music Network http://blog.digitalbazaar.com/2009/11/30/bitmunk-3-2-launched/
Received on Monday, 14 December 2009 03:22:28 UTC