Hello,

There is a problem in the SPIN API with printing an ORDER BY expression that 
contains a query variable.

Let's say I have the following SPIN description of a SPARQL query with an 
ORDER BY clause:

_:myQuery
         rdf:type sp:Select ;
         # ...
         sp:orderBy ( [sp:varName "dep"^^xsd:string] ) .

When I print this query with the SPIN API using the class 'StringPrintContext' 
I would expect to get something like:

SELECT ... {
 ...
}
ORDER BY ?dep

but what I get is

SELECT ... {
 ...
}
ORDER BY (sp:Variable())

I tried to track this problem down. It seems to be in the method 
'printOrderByExpression' of class 'QueryImpl'. This method is called with a 
Resource which is of rdf:type sp:Variable and it represents the variable. The 
first thing 'printOrderByExpression' with this Resource, it tries to cast it to 
a 'FunctionCall' which works. Therefore, it tries to print the variable as if 
it were a 'FunctionCall'.
I think this problem can be fixed by trying to cast the Resource to a 
'Variable' before casting it to a 'FunctionCall' and if it turns out to be a a 
variable (i.e. if the cast works) then use the functionality to print 
variables.

Greetings,
Olaf

----------------------
 Olaf Hartig (http://olafhartig.de)
   Database and Information Systems Research Group
   Department of Computer Science
   Humboldt-Universität zu Berlin

-- 
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en

Reply via email to