[Versa] DOT
Uche Ogbuji
uche.ogbuji at fourthought.com
Tue Sep 27 11:15:02 MDT 2005
On Mon, 2005-09-26 at 21:03 -0600, Michael Olson wrote:
> I had a thought that I think would prove useful WRT dots in expressions.
>
> Currently, you can do
>
> all() - ns:age -> . < 18
>
> and "." is replaced with the current object of each statement that
> matches the subject and predicate patterns
>
> Now, with first class statement datatypes, do we want to allow access
> to the statement. I guess what I envision is a dot path that allows
> access to more objects through a "dot-stack"
>
> Here are some examples
>
> all() - * -> ft:statement-uri(./..) == "http://foo.com"
>
> The "./.." would be the parent "dot" which would be set to the
> statement itself during a traversal. In this case, a made up function
> call would use the statement object to get its URI and return it.
It's strange that the meaning of this dot path stuff is based on a
temporary nesting of intermediate contexts rather than something in the
underlying model. I think this blows the XPath and UNIX file system
comparison and makes this really hard to intuitively understand.
I would prefer to have a special, named variable set up to represent the
statement
all() - * -> ft:statement-uri($versa:current-statement) ==
"http://foo.com"
> or
>
> all() - (./../.. |- rdf:type -> owl:ObjectProperty) -> *
>
> In this, the dot path would represent "the predicate of the statement
> being evaluated in the outer traversal". Or, the first "." would be
> the subject of the inner filter, then the first ".." would be the
> statement of the inner filter, and finally the next ".." would be the
> predicate of the outer traversal
Hmm. Even with your explanation this takes me a lot of squinting to
grok.
I'd personally end to break such a query down by composition, even if I
had this dot trick available.
> The first use case I see as much more useful. Especially when you
> start doing logic based on other pieces of the statement at different
> locations of a traversal. Ex,
>
> all() |- *:age -> (predicate(./..) == ns1:age & . == "fifteen") |
> (predicate(./..) == ns2:age & . == 15)
Ditto above statement. Seems a pretty heavy syntactic/conceptual load
to give such an atypical use-case (again I think I'd prefer to use query
composition in such cases even if the above syntax were legal).
--
Uche Ogbuji Fourthought, Inc.
http://uche.ogbuji.net http://fourthought.com
http://copia.ogbuji.net http://4Suite.org
Articles: http://uche.ogbuji.net/tech/publications/
More information about the Versa
mailing list