[Mulgara-dev] Query Evaluation - binding variables
Alex Hall
alexhall at revelytix.com
Tue Apr 22 22:59:35 UTC 2008
I'm trying to write a TQL query to traverse an RDF list using the walk
function. I would like to express the anchor for the walk function as a
variable that is bound by another constraint in the query. So my TQL
command looks like this:
select $x $value from <rmi://localhost/server1#model>
where $x <rdf:type> <owl:AllDifferent>
and $x <owl:distinctMembers> $y
and walk($y <rdf:rest> $node and $z <rdf:rest> $node)
and $node <rdf:first> $value;
However, when I execute this query, I get an error message,
"org.mulgara.query.QueryException: The subject: $y and the object: $node
are invalid, one must be a variable and the other a fixed value around a
predicate." I know that this can be worked around by using a subquery,
but I'm hoping to avoid a subquery. It seems there should be some way
to force Mulgara to evaluate the first two constraints and bind the
variable $y to a value before evaluating the walk function. Am I
mistaken here? Any suggestions?
Regards,
Alex
More information about the Mulgara-dev
mailing list