Re: Some thoughts on the RDFa DOM API document

On 04/27/2010 08:38 AM, Shane McCarron wrote:
>> For not confusing developers with RDF internal definition,
>> I would say a pragmatic solution would cover the following Blank Node
>> management:
>> - If two or more documents are processed with the RDFa DOM API,
>>  it has to be assured that comparing Blank Nodes from different documents
>>  never result true. (this means, the Node document has to be an part
>> of the comparision)
>> - Blank Nodes from a single document should preserve the same ID as
>> used in the document.
>>  If no ID is given or exists, a unique number is generated as ID.
> 
> Agreed.  However, that unique number would be persistent for the life of
> the current document.rdfa object, right?

Yes.

>> So I would propose to set
>>
>> (Plain|Typed)Literal.value := (Plain|Typed)Literal.element.nodeValue
>> This solves Manu's example:
>>
>> <div property="ex:name" datatype="">Shane <em>halindrome</em>
>> McCarron</div>
>>
>> gives this triple:
>>
>> <> ex:name "Shane halindrome McCarron" .
> 
> Yes.  And citing Manu's item about the node that defines this.... isn't
> it the div?

Err, this doesn't work, does it? The element.nodeValue for the <div> is
always going to return NULL in DOM Level 2? There are four nodes in that
<div> - three Text nodes ("Shane ", "halindrome", and " McCarron" and
one Element node "<em>...</em>".

http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-F68D080

>>>   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?
>> Blank Nodes as predicates? This is not allowed in RDF. (see definition
>> in http://www.w3.org/TR/rdf-concepts/#section-triples)
> 
> Really?  Ok, never mind then.

Hey! That's convenient! :)

Good catch, Benjamin... I wonder why Blank Nodes aren't allowed as
predicates?

>>>   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.
>> Can you give an example Shane?
>> If you mean that the iterated hierarchy of DOM nodes starts inside an
>> RDFa chain,
>> I would propose to generate BlankNodes for incomplete triples with
>> missing subjects .
> 
> I had assumed that.  When I reviewed the text I was worried that the
> processor was being invoked on the tree.  However, I think now that the
> processor is only invoked once, and that the API operates on the output
> of the processor.  If that is true, then I am happy.

The processor is not necessarily invoked only once. In the case of an
RDFTripleIterator, Benjamin and I had discussed that an implementer that
is concerned about memory usage could use the RDFTripleIterator to
"stream" triples to the developer and thus cut down on memory usage.

For example, if you have a document with over a million triples, and you
want to process it on hardware that doesn't have a great deal of working
memory (like a cell phone), one could eschew the use of rdfa.filter()
and rdfa.projection() and instead rely solely on rdfa.iterate().

-- 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 13:43:04 UTC