Re: Support of lists in PRD

On Fri, 10 Apr 2009 13:48:40 -0400
Sandro Hawke <sandro@w3.org> wrote:

> 
> > This is to express my high-level opinion about the support of lists in PRD.
> > Maybe we have a slot to discuss this during the F2F. I put this in itemized
> > form to be more synthetic.
> > 
> > ·        The notion of field typed as a list (or a collection) should exist.
> > ·        For a list or a collection, it would be good to have indication about
> > the cardinality (min and max), and the type of element. The information is very
> > useful in authoring the rules.
> > ·        PRD 1.0 should support simply operators like:
> > *        Length: take the length and write tests on it.
> > *        Contains: does the list contain such and such element?
> > *        Equality: Equality between 2 lists
> > *        Extraction of elements, like getFirst(), getElement(n), getLast().
> > ·        Later on (for PRD 2.0?), we could use the list / collection as a
> > support for aggregates, like üthe average revenue of all the customers in the
> > list, and in the action part have a construct to loop on the elements of the
> > lists.
> > 
> > Every serious data model or object model have lists and collections, so PRD
> > should definitely support the lists / collections, with the simple operations
> > described above.
> 
> Some follow-up questions...
> 
> Can lists contain other lists?

yes

> Can lists contain objects?  (eg rif:local and rif:iri consts that
> represent frames, or something?)

yes

> If so, would expect some kind of type/class constraints on these objects?

BLD does not have any kind of type constraints (or any kind of constraints at
all).

> Can lists contain variables?  For example, the list [1, ?x, 3], with a
> variable in it, can "contain" anything, but once it does and ?x is
> bound, then it only contains 1, 3, and that thing.

Yes.

>  This is Prolog's
> list behavior, and people on the telecon the other day said it was fine
> for PRD, but I suspect on closer inspection it will turn out to be a
> real problem.

If it is a problem for core or prd then they can restrict what can occur in the
lists.

> 
> Can you construct a list?     Something like:
>          if p(?x) and q(?y) 
>          then 
>             create new list x : [?x ?y]
>             assert pq(x)

In PRD? I suppose yes.

> In terms of functions/operators (getFirst, ...) how does this look:
>      http://www.w3.org/TR/xpath-functions/#sequence-functions

In BLD these functions are not needed, but they might be needed in PRD.

michael


-- 
    -- michael

Received on Saturday, 11 April 2009 03:40:57 UTC