[Versa] function objects
Uche Ogbuji
uche.ogbuji at fourthought.com
Thu Sep 22 15:21:22 MDT 2005
On Thu, 2005-09-22 at 09:57 -0600, Michael Olson wrote:
> > On Wed, 2005-09-21 at 19:58 -0600, Michael Olson wrote:
> >> To revisit this, I like the idea, but syntactically I think we need a
> >> symbol to differentiate these from a qname pattern. There is no
> >> difference, from the grammars POV between
> >>
> >> ground(rdf:type)
> >>
> >> and
> >>
> >> map(ns:func_name)
> >>
> >> Maybe kinda C'ish and make it
> >>
> >> map (&ns:func_name)
> >>
> >> thoughts?
> >
> > I guess in my thinking of this as a simple function there was no need
> > to
> > distinguish between the argument to ground. The argument is just a
> > resource URI, expressed literally, or in qname form. I would therefore
> > expect to be able to do:
> >
> > ground(uri("http://" + "example" + ".org"))
> >
> > Assuming that we have a conversion function uri() in Versa 2.0 that can
> > convert strings (and other data types?) to a URI.
> >
> > Short answer, I'd expect it to be
> >
> > ground(rdf:type)
> >
> > Maybe I'm missing something?
> >
>
> I guess I asked the question poorly. I'm OK with how ground works in
> the example, what I think we need is a symbol to distinguish a
> qname-pattern from a function-reference in the grammar because the
> grammar cannot tell the difference between
>
> rdf:type
>
> which, as a writer of a query, probably means a qname pattern, and
>
> versa:ground
>
> which, as a writer of a query, most likely means a function-references.
>
> What I propose is not change anything about the qname-pattern, but add
> the symbol "&" to the front of function-references so the last example
> would be
>
> &versa:ground
Ah. Gotcha. And ooh, good call.
Personally, I think we should disambiguate in the other direction. Now
that we've committed to the idea of functions as first-class objects
(yaay!), I think that the use of qnamed predicates as functions is more
of the special case. So I would leave function references "bare", and
use a symbol to mark qnamed predicate functions.
Maybe:
@dc:title(<http://foo.com/bar>)
We can reuse @ here without ambiguity, I think.
--
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