OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

regrep-comment message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [regrep-comment] [Fwd: To support OGC GetRecords/Filter ...]


Hi Peter,

Your proposed solution to issue http://wxforge.wx.ll.mit.edu:8080/jira/browse/REGREPTC-128:

    Need template feature in ebRS function feature

sounds very reasonable and it is very likely that RegRep TC will adopt the solution as proposed
and incorporate it in the next draft  (ebRS 4.0 CD 4).

Thank you for your valuable input.


Panagiotis (Peter) A. Vretanos wrote:
4B0ADE15.8020804@cubewerx.com" type="cite">



Subject:
To support Filter ...
From:
"Panagiotis (Peter) A. Vretanos" <pvretano@cubewerx.com>
Date:
Thu, 19 Nov 2009 12:30:44 -0500
To:
"Farrukh S. Najmi" <farrukh@wellfleetsoftware.com>
To:
"Farrukh S. Najmi" <farrukh@wellfleetsoftware.com>

Farrukh,

To support filter I think you would need to make the following changes ...

Right now the spatialFilter() function has the following prototype:

spatialFilter( propertyName string, spatialOperator string,
               geometry GEOMETRY, delimieter string)

To support filter you need to add one more parameter:


spatialFilter( propertyName string, spatialOperator string,
               geometry GEOMETRY, delimiter string,
               template string )

A "template" is a string that is used verbatim by the function to generate each return value.  The notation ${id} is used to indicate where the return identifier should be substituted in the template string.

The way the function works is as follows:

1) If a delimiter is specified then each return value is separated using the specified delimiter.

2) The default delimiter is comma (,).

3) The value of delimited can be NULL or "" meaning that no separator is used.

3) The delimiter can be escaped values like "\n" for newline or "\t" for tab, etc.

4) If a template argument is specified then each return id value is substituted into the template and the resulting string is then appended to the return string using the specified delimiter (if one is specified) to separate each return value.

Here are some example ...

Example 1:
   spatialFilter("myGeom","Intersects","<gml:Polygon>...")
would return:
   id1,id2,id3,id4,....

Example 2:
   spatialFilter("myGeom","Intersects","<gml:Polygon>...","|")
would return :
   id1|id2|id3|id4|...

Example 3:
   spatialFilter("myGeom","Intersects","<gml:Polygon>...","\n",
                 "<ogc:RecordId rid=\"${id}\"/>");
would return:
   <ogc:RecordId rid="id1"/>
   <ogc:RecordId rid="id2"/>
   <ogc:RecordId rid="id3"/>
   <ogc:RecordId rid="id4"/>

So, f we wanted to add an ad-hoc query example to the document that uses CSW GetRecords as the query expression, we could add:

<query:QueryRequest ...>
   ...
   <query:Query queryDefinition="urn:oasis:names:tc:ebxmlregrep:query:AdhocQuery">
      <rim:Slot name="queryLanguage">
         <rim:ValueList>
            <rim:ValueListItem xsi:type="StringValueType"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<rim:Value>urn:oasis:names:tc:ebxmlregrep:QueryLanguage:CSW-Query</rim:Value>
            </rim:ValueListItem>
         </rim:ValueList>
      </rim:Slot>
      <rim:Slot name="queryExpression">
         <rim:ValueList>
            <rim:ValueListItem xsi:type="StringValueType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
               <rim:Value>
#@
<csw:GetRecords
   service="CSW"
   version="2.0.2"
   maxRecords="5"
   startPosition="1"
   resultType="results"
   outputFormat="application/xml"
   outputSchema="http://www.opengis.net/cat/csw/2.0.2"
   xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
   xmlns:ogc="http://www.opengis.net/ogc"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2
                       ../../../csw/2.0.2/CSW-discovery.xsd">
   <csw:Query typeNames="csw:Record">
      <csw:ElementSetName>brief</csw:ElementSetName>
      <csw:Constraint version="1.1.0">
         <ogc:Filter>
@#
ogc:spatialFilter(“headquarters”,“contains”,“<gml:Envelope srsName=\"urn:ogc:def:crs:OGC:2:WGS84\"><gml:lowerCorner>0 0</gml:lowerCorner><gml:upperCorner>30 30</gml:upperCorner></gml:Envelope>”,NULL,"<RecordId rid=\"${id}\"/>")
#@
         </ogc:Filter>
      </csw:Constraint>
   </csw:Query>
</csw:GetRecords>
@#
               </rim:Value>
            </rim:ValueListItem>
         </rim:ValueList>
      </rim:Slot>
   </query:Query>
</query:QueryRequest>

Of course I would need to escape the GetRecords XML string but you get the idea.

Comments?

Ciao.



-- 
Regards,
Farrukh

Web: http://www.wellfleetsoftware.com



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]