[Versa] Question about query

Chimezie Ogbuji chimezie at gmail.com
Sun Sep 4 12:02:15 MDT 2005


On 9/4/05, Michael Olson <Mike.Olson at fourthought.com> wrote:
> >> My question, is what if this is the top level expression and executed
> >> on an empty model.  What are the results of the expression?
> >>
> >> Is it a boolean?
> >>
> >> Is it null because the resource does not exist?
> >>
> >> Is it just the resource's URI regardless of whether or not it exists?
> >
> > Yes.
> >
> >> I think it should be the empty set.
> >
> > Why?
> >
> 
> Be cause it is a "query".  So I guess my feeling is if we want to
> express
> 
> <http://foo.com>
> 
> as a versa query, then it needs to be a query.
> 
> Same with
> 
> true
> 
> and to me it is a query of whether or not that resource exists in the
> model.
> 
> If we don't want it to be  query, but a "pattern", then we would have
> to change the spec so the above two queries are not valid as top level
> queries, but only valid in filter, traverse, and function calls.
> 
> 
> As I said in a previous email, it is on my "need" list to support these
> queries.  If we remove them, then I will have to use an extension
> function.


I don't think you would need an extension function to do "'foo'" to
return all strings in the model that are 'foo', you could do:

filter(type(xsd:string),"contains('foo')")

I think of resource patterns as different from literals (resource
patterns are names for resources you are matching against in the graph
or the name of a resource resulting from evaluating an expression,
while a literal is an actual literal value in the query processor
space) and I don't really see the need for a literal pattern, since
you have string comparison functions to filter on literals in the
model (which you can reach directly with type(xsd:*)

So

resource-query ::= node-query 
node-query ::= uri-query | qname-query
uri-query  ::= uriref

type(xsd:*) covers most of what you would need from a literal-query



More information about the Versa mailing list