Re: Some thoughts on the RDFa DOM API document

On 04/26/2010 12:49 PM, Shane McCarron wrote:
>   1. Rather than defer to RDF-CONCEPTS for the definition of a language
>      tag, I think we should refer to IETF BCP 47 - that's what the I18N
>      WG likes people to use these days.

Agreed. Done (for the sections I've edited thus far - still need to go
back through and double-check).

>   2. I assume that the designation of BlankNodes are constant for the
>      lifetime of a specific document instance.  In otherwords, if I
>      process a page and start using it, depending upon blank node names
>      like '_:123' , that designator will refer to the same node at
>      least until the next time the page is processed.  We should make
>      this explicit if it is true.

Agreed... will try to remember to include it when I make the final pass.

>   3. PlainLiteral and TypedLiteral return both a Node (in element) and
>      the Node contents (in value).  RDFa requires that value of a
>      Literal be extracted in a pretty special way.  We should probably
>      indicate that the 'value' reflects the result of extracting the
>      Literal from the DOM.  In other words, that it is very different
>      than just looking at the content of the Node reflected by element.

Agreed about 'value'. There is also an issue about the Node that is
referenced... it must be the first node in the list of nodes that
constitute the literal, or we may have to return a list of nodes in the
future (all nodes that went into creating the literal). Here's the problem:

<div property="ex:name" datatype="">Shane <em>halindrome</em> McCarron</div>

gives this triple:

<> ex:name "Shane halindrome McCarron" .

Which HTML node is associated with the PlainLiteral object?

>   4. Rather than defer to RDF-CONCEPTS for the definition of URI, I
>      think we should refer to the IRI (RFC 3987) specification.  The
>      algorithm described in RDF-CONCEPTS is nice, but it could conflict
>      with IRI and IRI is what RDFa Core refers to.

Agreed, done (for the sections I've edited thus far - still need to go
back through and double-check).

>   5. I confess that I don't understand the URI Mapping stuff.  In RDFa
>      URI mappings are done in the context of a Node.  It doesn't make
>      any sense to me to have a global mapping class.  I know that
>      people don't generally override the mappings throughout a
>      document, but still... they could, and I don't see what value
>      having global mappings has?

Will have to explain it more clearly.

>   6. RDFTriple has a complex constructor definition.  However, what I
>      don't see in there is the ability to use a BlankNode as a
>      predicate.  Within the context of a single document, I think it is
>      perfectly reasonable to define a hybrid type as a BlankNode and
>      then cite it as a predicate for other triples.  Isn't it?

That's crazy, but legal. Will try to think about it while working on the
document.

>   7. In the RDF Triple Iterator, if I specify a root attribute that is
>      some Node in the tree, and the triples in that hierarchy refer to
>      other triples outside of the hierarchy...  I assume its all fine,
>      but it is not clear to me how I would follow that chain.

Same way you would follow the chain if you did rdfa.filter() or
rdfa.project(), right? You would just call rdfa.filter() for what you're
looking for (the subject, for instance)? Perhaps, I don't understand the
question?

>   8. RDF Triple Projection: First, the title of section 2.7 needs
>      spaces in it to be consistent with the rest of the document.     
>      Second, and this might be a global comment, the use of the RDF
>      term 'object' is confusing when it is comingled with the
>      programming term 'Object' as used in WebIDL.  I don't know how to
>      fix it.  But it is confusing.

Agreed. That is confusing - will try to fix it when I update that
section tomorrow.

>   9. In section 3.2 and 3.3, the predicate in the various method is
>      limited to a URI.  Can't it also be a bnode (see above)?  Also,
>      and I know this contradicts what I said above about prefix
>      mappings, it would be nice to be able to filter using CURIEs as
>      well as URIs.

Again, crazy but legal. Will try to re-work the API to support
bnodes-as-predicates.

As for filtering based on CURIES, would this work for you (the second
argument is the important one):

var triples = rdfa.filter(rdfa.ANY, rdfa.foaf.name);

-- manu

-- 
Manu Sporny (skype: msporny, twitter: manusporny)
President/CEO - Digital Bazaar, Inc.
blog: PaySwarming Goes Open Source
http://blog.digitalbazaar.com/2010/02/01/bitmunk-payswarming/

Received on Tuesday, 27 April 2010 05:45:53 UTC