Re: Support of lists in PRD

> 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?

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

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

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.  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.

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

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

Thanks.

     - Sandro

Received on Friday, 10 April 2009 18:02:09 UTC