[xquery-talk] Geospatial and XQuery?

Michael Kay mhk at mhk.me.uk
Tue Oct 4 23:22:10 PDT 2005


Have you looked at Dimitre Novatchev's library of higher-order functions
implemented in XSLT?
 
See http://fxsl.sourceforge.net/
 
Dimitre discovered a neat way of implementing higher-order functions by
exploiting the apply-templates capability. Sadly there is no equivalent in
standard XQuery. I do have an extension that enables it in Saxon, however:
see
 
http://www.saxonica.com/documentation/extensions/functions/function.html
 
I'm hoping at some stage to provide the ability for XQuery to call XSLT
function libraries. Saxon already offers the reverse, which is less useful,
because there are a lot more XSLT libraries currently in existence.
 
Michael Kay
http://www.saxonica.com/


  _____  

From: Xia Li [mailto:xli at galdosinc.com] 
Sent: 04 October 2005 21:30
To: Paul Cotton; Michael Kay; kfandre at netbox.com; talk at xquery.com
Subject: RE: [xquery-talk] Geospatial and XQuery?



I guess it depends on the strategies to extend a query language to support
graph operations. The approach I have chosen is to specify a graph
explicitly and provide special graph operations. Here is the case where a
higher order function is needed,

 

shortestPath(graph, point1, point2, cost)

 

The function is to compute the shortest path between two pointes in the
graph. The graph is represented as a sequence of GML Edge objects. The
fourth parameter "cost" is required to be a function that maps an edge to a
numeric value as being of the cost of the edge. 

 

Not only this one, many network analysis queries, such as circle, nearest
neighbors, need higher order functions.

 

 

Lisa

 

  

 


  _____  


From: Paul Cotton [mailto:Paul.Cotton at microsoft.com] 
Sent: Tuesday, October 04, 2005 10:47 AM
To: Xia Li; Michael Kay; kfandre at netbox.com; talk at xquery.com
Subject: RE: [xquery-talk] Geospatial and XQuery?

 

>Another thing I found is that to support spatial network query, one have to
extend XQuery into a high order functional language. 

 

This is surprising since was not necessary to add spatial functionality to
SQL engines.  Can you give your rationale?

 

/paulc

 

 

Paul Cotton, Microsoft Canada
17 Eleanor Drive, Nepean, Ontario K2E 6A3
Tel: (613) 225-5445 Fax: (425) 936-7329
mailto:Paul.Cotton at microsoft.com

 


  _____  


From: talk-bounces at xquery.com [mailto:talk-bounces at xquery.com] On Behalf Of
Xia Li
Sent: October 4, 2005 2:06 PM
To: Michael Kay; kfandre at netbox.com; talk at xquery.com
Subject: RE: [xquery-talk] Geospatial and XQuery?

 

I did a bit exploration for extending XQuery to support query on spatial,
spatial temporal and spatial network data types defined in GML (Geographic
Markup Language) last year and an experimental implementation study on a
particular XQuery engine Saxon. I chose to add all operations and functions
defined for the GML types to the system built-in function library. The way
to achieve this in Saxon is to register those functions and bind those
function definitions with the function call in query so that these function
will be processed just like any other system built-in functions. I remember
one advantage of this approach is that once integrating the functions into
the existing architecture we can focus on the implementation of computation
logic of the function itself and do not need to pay attention to do the type
checking for the parameters of the functions which requires the entire
implementation of XQuery sequence type matching. 

 

Another thing I found is that to support spatial network query, one have to
extend XQuery into a high order functional language. 

 

 

Lisa

 

 


  _____  


From: talk-bounces at xquery.com [mailto:talk-bounces at xquery.com] On Behalf Of
Michael Kay
Sent: Tuesday, October 04, 2005 9:06 AM
To: kfandre at netbox.com; talk at xquery.com
Subject: RE: [xquery-talk] Geospatial and XQuery?

 

Good point: though I don't think it proves that you need such functions in
the core (standardized) language, only that you need the XQuery engine to be
aware of the functions so that it can optimize them.

 

Michael Kay

http://www.saxonica.com/ 

Without a standard how would an XQuery optimizer know how to deal with a
third-party geospatial function? Execution plans would differ drastically
depending on the cost or absence of spatial indexes, etc.  I recall seeing a
sepecialized XQuery extension standard for text search. It seems like
there's an opprotunity to do the same with geospatial data, especially if it
was written w.r.t common XML geospatial data formats.

 

-Kevin



 

On 10/4/05, Martin Probst <martin at x-hive.com> wrote: 

Real-To:  Martin Probst <martin at x-hive.com>
Real-Cc:   talk at xquery.com <mailto:talk at xquery.com> 

Hi,

> If so, what would the geospatial functions look like in a query?

> Have any of the XQuery or XML database products (commercial or open-
> source) implemented geospatial functions ahead of the spec? If so, 
> what do these look like?

X-Hive/DB is used by Galdos (http://www.galdosinc.com/) in Cartalinea.
They did not need custom functions that much as fast range queries on 
XML attributes, e.g. to find certain specific elements that are within
(in the spatial, not in the XML sense) a set of coordinates.

So basically they needed fast range index lookups on XQuery, XPointer
and XPath queries. 

I don't think there is a need for a standardisation on specific
geospatial functions, especially as you can extend nearly every XQuery
implementation with your own custom functions so you can use these
custom functions as an adaptor-like wrapper around a library in e.g.
Java.

Martin

_______________________________________________
talk at xquery.com
http://xquery.com/mailman/listinfo/talk
<http://xquery.com/mailman/listinfo/talk> 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://xquery.com/pipermail/talk/attachments/20051004/828dfae2/attachment.htm


More information about the talk mailing list