Saturday, September 25, 2004

allValuesFrom in iTQL

I like this query because:
* It shows what NOT is (basically allows you to say things like "give me all the states that are not Alabama").
* Uses the new HAVING clause.
* Seems to be a nice use case for count and/or subqueries i.e. the ability to execute an outer query and plug the results into the inner query finally makes sense.
select $s $p $x count (

select $type
from <rmi://.../server1#foo>
where $s $p $type
and not($type <rdf:type> $x ))
from <rmi://.../server1#foo>
where $r <rdf:type> <owl:Restriction>
and $r <owl:onProperty> $p
and $r <owl:allValuesFrom> $x
and $s $p $o2
having $k0 <tucana:occursMoreThan> '0'^^<xmlschema:nonNegativeInteger>
order by $s ;

$k0 is the variable binding for the COUNT - we should offer a way to explicitly bind aggregates to a variable.

Another new feature that Paul's been working on, querying only URIs, makes use of virtual graphs and magical predicates like our data typing support.
Post a Comment