- From: Stephane Fellah <stephanef@imagemattersllc.com>
- Date: Wed, 20 Apr 2005 11:31:09 -0400
- To: <public-rdf-dawg-comments@w3.org>
- Cc: <harryc@imagem.cc>, "'Yaser Bishr'" <yaserb@imagem.cc>
- Message-Id: <E1DOaJf-0006a1-KK@wiggum.w3.org>
Hi, I am currently trying to create user-defined spatial operators for SPARQL. For example, I would like to define the following operator: withinDistance(G1,G2,d,uom) G1 and G2 are instance of rdf:type geo:Geometry d is a distance uom is a Unit of Measure (but optional argument). I have found a number of issues by trying to use the current specification. I will try to explain through a use-case that does not seem to be captured in RDF Data Access Use <http://www.w3.org/TR/rdf-dawg-uc/> Cases and Requirements ). Let's suppose the user wants to find all the instances of Geometry within a user defined Polygon p1 (subclass of Geometry) and returns the complete description of Geometry) The query will look like more or less like this: PREFIX user: <http://www.foo.org/userdefined#> PREFIX geo: <http://www.opengis.org/geometry#> PREFIX uom: <http://www.foo.org/uom#> PREFIX fn: <http://my.example.org/geo/functor#> DESCRIBE ?g WHERE { ?g1 rdf:type <http://www.foo.org/geometry#Geometry> . FILTER fn:withinDistance(?g1, <http://www.foo.org/userdefined#p1>,10, <http://www.foo.org/uom#meter>) } ISSUE1: PREMISES TRIPLES It seems to me that the current specification does not provide a way to pass the description of p1 in the query: Using the SPARQL triple syntax, p1 could be defined by the user like the following: I assume geo:SimplePolygon to be a subclass of geo:Geometry and is already known by the server. I also assume that geo:coordinates is a datatype defined by the ontology and understood by the server. { <http://www.foo.org/userdefined#p1> rdf:type <http://www.opengis.org/geometry#SimplePolygon> , <http://www.foo.org/userdefined#p1> geo:crs <http://www.epsg.org#_4326> , <http://www.foo.org/userdefined#p1> geo.exterior <http://www.foo.org/userdefined#lr1> , <http://www.foo.org/userdefined#lr1> geo.coordinates "0,0 0,10 10,10 0,10"^^geo:coordinates } To support this query, SPARQL needs a mechanism to pass the user defined triples, so they could be added as premises in the query engine (DQL is using such concept) prior to the evaluation on any graph. The handling of the premises would be pretty straightforward to implement by any SPARQL query engine. I propose to add a new keyword in the language called PREMISES to support my use case. This would look like this: PREFIX user: <http://www.foo.org/userdefined#> PREFIX geo: <http://www.opengis.org/geometry#> PREFIX uom: <http://www.foo.org/uom#> PREFIX fn: <http://my.example.org/geo/functor#> PREMISES: { <http://www.foo.org/userdefined#p1> rdf:type <http://www.opengis.org/geometry#SimplePolygon> , <http://www.foo.org/userdefined#p1> geo:crs <http://www.epsg.org#_4326> , <http://www.foo.org/userdefined#p1> geo.exterior <http://www.foo.org/userdefined#lr1> , <http://www.foo.org/userdefined#lr1> rdf:type <http://www.opengis.org/geometry#LinearRing> <http://www.foo.org/userdefined#lr1> geo.coordinates "0,0 0,10 10,10 0,10"^^geo:coordinates. } DESCRIBE ?g WHERE { ?g1 rdf:type <http://www.foo.org/geometry#Geometry> . FILTER fn:withinDistance(?g1, <http://www.foo.org/userdefined#p1>,10, <http://www.foo.org/uom#meter>) } ISSUE 2: OPTIONAL OR NULL PARAMETERS. The other issue is how optional or null parameter are set in the functions. I can see two alternatives: using null or using blank parameter Using null, FILTER fn:withinDistance(?g1, <http://www.foo.org/userdefined#p1>,10, null) Using blank: FILTER fn:withinDistance(?g1, <http://www.foo.org/userdefined#p1>,10, ) (note the comma after 10). ISSUE 3: DESCRIPTION OF SUPPORTED FUNCTIONS IN SPARQL PROTOCOL. The SPARQL <http://www.w3.org/TR/rdf-sparql-protocol/> Protocol for RDF document is not clear how the ServiceDescription describes the supported functions and operations by the SPARQL Service. For client operations, it is important not only to know the URI of the functions and operations but also to get a description of their arguments types, cardinality and order. An additional optional query type could be added to describe Functions and Operands such GetOperationDescription and takes an optional parameter name which can take a list of operand or function uri, http://www.foo.com/sqs?query=GetOperationDescription&name=http://my.example. org/geo/functor#WithinDistance, http://my.example.org/geo/functor#Intersects The response should be in RDF format. This assumes an ontology for functors and operands needs to be elaborated. In conclusion, I would like the DAWG elaborates more the section 11.3 of the current SPARQL Query Language for RDF document, because I anticipate many user-defined functions would be defined in the future. I am looking forward to get feedback on this topic. Best regards Stephane Fellah Image Matters LLC
Received on Thursday, 21 April 2005 11:57:55 UTC