[RIL] Syntactic sugar for filter?

Uche Ogbuji uche.ogbuji@fourthought.com
Wed, 08 May 2002 19:09:50 -0600


I sort of felt this when we first came up with traversal expressions, but I'd 
be in favor of a bit more syntactic sugar.

all() -> dc:title -> eq("Mister")

Gets all objects of dc:title predicates that are equal to "Mister".

But in such cases, one almost alwasy wants the subjects, not the objects.

Right not you do this by:

filter(all(), '. - dc:title -> eq("Mister")')

Which is a bit clumsy for such a common operation.

It so happens that in this case, you can also do

all()[. - dc:title -> eq("Mister")]

But I find it just as common to want to start with, say, type(x:Person) as 
all(), so I'd like more general sugar than the all()[] form.

So, my proposal is a form of the traversal expression which selects the 
subject rather than the predicate.  I like the following form:

VIP-020508-2:  Add the following form of traversal expression that selects the 
subject

all() | -> dc:title -> eq("Mister")

This could also be used with backward traversals:

all() | <- rdf:type - starts-with('http://')

i.e. get me all types of HTTP resources in the model.

Thoughts?


-- 
Uche Ogbuji                                    Fourthought, Inc.
http://uche.ogbuji.net    http://4Suite.org    http://fourthought.com
Track chair, XML/Web Services One (San Jose, Boston): 
http://www.xmlconference.com/
DAML Reference - http://www.xml.com/pub/a/2002/05/01/damlref.html
RDF Query using Versa - http://www-106.ibm.com/developerworks/xml/library/x-thi
nk10/index.html
XML, The Model Driven Architecture, and RDF @ XML Europe - 
http://www.xmleurope.com/2002/kttrack.asp#themodel