[Versa] Issue 3
Uche Ogbuji
uche.ogbuji at fourthought.com
Tue Aug 16 09:56:21 MDT 2005
On Mon, 2005-08-15 at 12:13 -0400, Chimezie Ogbuji wrote:
> I'll assume by #1 - #3 you are referring to (Uche's points on SPFs):
>
> 1. If the SPF is *, it is resolved into a pattern that matches anything
> 2. If the SPF is a primitive scalar, datatyped literal or resource, it is
> resolved into a pattern that must match that string or resource exactly
> 3. If the SPF is a list or set, it is resolved into a pattern that must
> match one of the items in the list or set exactly
> 4. If the SPF is a function, f, then it is a special filtering function
> pattern, and the pattern is equivalent to the resulting list from
> filter(<all possible values>, f). (This means that the function must
> take each item to be filtered as its first parameter)
>
> > I wonder what we need to change so much syntactically?
> >
> > Why can't "all() - B -> we("'foo') return statements. Then use
> > "object(expression)" or "subject (expression)" to filter the results.
>
> (Just thinking out loud) would that make traversal expessions even
> more verbose?:
>
> Consider the query from Versa by Example (to get the labels of all
> rdfs:Classes):
>
> (rdfs:Class <- rdf:type - *) - rdfs:label -> *
>
> If traversal operators returned statements (instead of their parts)
> you would have to write this as:
>
> objects(subjects(rdfs:Class <- rdf:type - *) - rdfs:label -> *)
>
> > As far is "SPF"s. Isn't "all()" equivalent to "*" already?
>
> '*' is a synonym for true.
Yes. It's a predicate rather than a function (that returns a list).
> > qname("foo",union("a",b")) - map(properties(<rdfs:class>),{. -
> > rdfs:subPropertyOf *}), gt("1"^^"xsd:int")
> >
> > So, using many new ideas
> >
> > "Give me, all _statements_ where the subject us the URI from the
> > expanded prefix "foo" and the local name of "a" or "b".
>
> I'm not sure how your suggesting the qname function would work, but do you mean:
>
> qname(prefix,localNameSet ) => set(prefix:localName1,prefix:localName2,..)
>
> That is, it builds a resource from a single prefix and a *set* of
> localNames? That would also be very useful (although I'm not sure why
> you are using union in that part of the example)
OK. You got more out of it than I did. If you're right, I suspect Mike
meant "set", not "union".
Side note: we're talking about using { ... } in various ways. It's the
mathematical notation for set, so we'd want a note to make sure there is
no confusion over this.
> > The predicate
> > is one of the subProperties of any property that is used on the
> > resource "rdfs:Class" and the object is the integer value greater then
> > one.
>
> If we adopted the way Notation3/Turtle addresses uri's then you
> wouldn't need to surround the rdfs:Class with '<' .. '>' since qnames
> work the same in both Versa and Notation3/Turtle.
>
> So, assuming we also adopted '>' as syntactic shorthand for gt (which
> *might* clash with using '<' .. '>' for explicit Uris - I'm not
> comfortable enough with the grammer to know if thihs would be the case
> if we adopted both) the query would be?:
>
> qname("foo",set("a",b")) - map(properties(rdfs:Class),{. -
> rdfs:subPropertyOf *}) -> > "1"^^xsd:int
>
> To return the 'statements' that match that criteria?
Well a grammar could probably handle that, especially with () around the
object part. I'm more worried about *people* trying to avoid adjusting
their spectacles :-)
--
Uche Ogbuji Fourthought, Inc.
http://uche.ogbuji.net http://fourthought.com
http://copia.ogbuji.net http://4Suite.org
Use CSS to display XML, part 2 - http://www-128.ibm.com/developerworks/edu/x-dw-x-xmlcss2-i.html
XML Output with 4Suite & Amara - http://www.xml.com/pub/a/2005/04/20/py-xml.html
Use XSLT to prepare XML for import into OpenOffice Calc - http://www.ibm.com/developerworks/xml/library/x-oocalc/
Schema standardization for top-down semantic transparency - http://www-128.ibm.com/developerworks/xml/library/x-think31.html
More information about the Versa
mailing list