Re: RDFa API - uniting bnode, uri and projected objects

On Tue, 27 Apr 2010 09:23:04 +0100
Toby Inkster <tai@g5n.co.uk> wrote:

> For want of a better term, I'll call this superclass "Resource" as
> it's analogous to an rdfs:Resource.

Expanding on this a little...

	var x = new URI("#foo");
	var y = new URI("#foo");

	if (x == y) { this_should_work(); }

So, in particular:

	<span about="#foo" predicate="ex:test" href="#bar"></span>
	<span about="#foo" predicate="ex:test" href="#baz"></span>

	<script type="text/javascript">
	  var triple_list = rdfa.filter();
	  var t0 = triple_list[0];
	  var t1 = triple_list[1];

	  // the subjects are the same
	  if (t0.subject == t1.subject)
	  {
	    // this should work
	  }
	</script>

But t0.subject.element doesn't make sense now. t0.subject and
t1.subject are the same resource, but have different elements.

So, further to my previous proposal we should extend the current
RDFTriple interface to include three additional readonly attributes:

	readonly attribute Node subjectElement;
	readonly attribute Node predicateElement;
	readonly attribute Node objectElement;

-- 
Toby A Inkster
<mailto:mail@tobyinkster.co.uk>
<http://tobyinkster.co.uk>

Received on Tuesday, 27 April 2010 13:18:03 UTC