W3C home > Mailing lists > Public > public-sparql-dev@w3.org > July to September 2006

Assigning values to variables

From: Luke Steller <Luke.Steller@infotech.monash.edu.au>
Date: Wed, 23 Aug 2006 20:46:29 +1000
Message-ID: <761d7eaa0608230346t2732df08m9b52117380823b38@mail.gmail.com>
To: public-sparql-dev@w3.org

Hi All,

Is it possible to assign a value to a variable, apart from using
pattern matching? More specifically, for instance is it possible to
assign a literal - say a double returned by a function (custom
function) to a variable, which in turn is returned by the query. For
me it would be useful to have a query like:

PREFIX myfn: <java:com.luke.distance.>
PREFIX ps: <http://luke#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?printer ?distance
WHERE
{
    ?printer rdf:type ps:InkJetPrinterOperational.
    ?distance = myfn:LatLongDistance("-38.15291", "145.135775",
"-38.152197", "154.135783", "K")
}

which returns the printer individual URI and the distance (a double).


Is anything like this possible?


Thanks,



-- 
Luke Steller
PhD Candidate
Faculty of Information Technology
Monash University
A U S T R A L I A
=============================
Received on Wednesday, 23 August 2006 10:46:38 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:17:05 GMT