Re: ISSUE-29: Re: When is equal and when is it nonequal (eg, the IRI interface)

Manu Sporny wrote:
> On 08/01/2010 10:20 PM, Nathan wrote:
>> Now - apologies in advance for this...
>>
>> What's the use-case for having the origin/source?
> 
> http://www.w3.org/2010/02/rdfa/drafts/2010/ED-rdfa-api-20100801/#the-source-pointer
> 
>> What's the use-case for having store.createIRI(iri,origin);?
>>  (and all related)
> 
> That's a bug in the API, it should've read:
> 
> store.createIRI(iri,info);
> 
> 'info' is an attempt to generalize the storage of developer-specified
> information along with the IRI. It would allow developers to use a
> single attribute as a point of extension if it is desired. This would
> allow innovation outside of the core RDF triples and outside of the RDFa
> API.
> 
>> If you have some use-case(s), can they be handled by functions like
>> document.getElementsBySubject(type) or not?
> 
> Not as far as the community has discovered thus far. There needs to be a
> way for developers to understand where triples originated in the
> document. It makes it very easy to modify the DOM based on the data it
> contains. One can easily imagine highlighting foaf:name values in a
> page, or placing phone dialing icons beside vcard:tel numbers. Without a
> link from the RDF data back to the DOM, doing this in a way that is
> deterministic is difficult.
> 
> If we can figure out a better way to do this, that would be wonderful.
> The mechanism Toby outlined (placing the info object on the RDFTriple)
> is one such possibility.

I follow and see the need :) - questions and notes:

1: note that given:
var ivan = document.getItemBySubject("http://www.ivan-herman.net/foaf#me");
var val = ivan.get("foaf:name");

then 'val' won't have any way to get back to the DOMNode to do anything 
with it if you move the source property to the triple.

side point: am I to assume that a subject can only appear once in the 
subject position in a document - getItemBySubject() seems to infer this 
whereas with my limited RDFa knowledge I'd assumed that I could have 
several elements all @about the same thing - used 'ass'ume because I may 
be making an ass of myself with this aside!

2: I was genuinely surprised when I saw the definition of 
getElementsByProperty(property,value), and that value is not optional - 
I perhaps foolishly assumed that I would be able to simply specify the 
property/predicate only.

3: Would a simple method on the document to return elements by filtering 
not suffice
   document.getElementsByFilter( subject, predicate, object );
where each param is optional and where at least one is required.
or
  document.getElementByTriple( RDFTriple triple );
again where 1 or more properties of the triple would need to be set.

Best,

Nathan

Received on Tuesday, 3 August 2010 03:29:47 UTC