[GeoNetwork-users] CSW queries for Protocol and Name

Hi List,

Maybe Mathieu Coudert is the best person to ask this since he has recently worked on CSW Improvements.

In Geonetwork CSW service is there a way to query an IsoRecord based on the value of one the following xpaths:
"gmd:distributionInfo/gmd:MD_Distribution/gmd:transferOptions/gmd:MD_DigitalTransferOptions/gmd:onLine/gmd:CI_OnlineResource/gmd:protocol/gco:CharacterString"
"gmd:distributionInfo/gmd:MD_Distribution/gmd:transferOptions/gmd:MD_DigitalTransferOptions/gmd:onLine/gmd:CI_OnlineResource/gmd:name/gco:CharacterString"?

I can query the topicCategory with the following query. So, I want to be able to query the protocol too.
<?xml version="1.0"?>
<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2&quot; service="CSW" version="2.0.2"
    resultType="results" outputSchema="csw:IsoRecord">
    <csw:Query typeNames="gdm:MD_Metadata">
        <csw:Constraint version="1.1.0">
            <Filter xmlns="http://www.opengis.net/ogc&quot; xmlns:gml="http://www.opengis.net/gml&quot;&gt;
               <PropertyIsLike wildCard="*" singleChar="#" escapeChar="!">
                  <PropertyName>topicCat</PropertyName>
                  <Literal>#*</Literal>
               </PropertyIsLike>
            </Filter>
        </csw:Constraint>
    </csw:Query>
</csw:GetRecords>

So, if I update the following files (Config-csw.xml and Index-Fields.xsl) with the correct tag mapping and xpath, would it work? or am I missing something.

Regards,
Abdi Jama

Hi Abdi,
On Thu, Jul 16, 2009 at 10:55 AM, <Abdi.Jama@anonymised.com> wrote:

Hi List,

Maybe Mathieu Coudert is the best person to ask this since he has recently
worked on CSW Improvements.

In Geonetwork CSW service is there a way to query an IsoRecord based on the
value of one the following xpaths:

"gmd:distributionInfo/gmd:MD_Distribution/gmd:transferOptions/gmd:MD_DigitalTransferOptions/gmd:onLine/gmd:CI_OnlineResource/gmd:protocol/gco:CharacterString"

There is a lucene field for the protocol. However there is not for the name
of the online resource.
In fact these fields (ie topicCat, protocol) are not defined as queryable
properties for CSW ISO profile but you could use them in CSW queries cause
they are directly lucene index fields.

So if you want to be able to query the name of the online resource, you just
have to define a new index field in the index-fields.xsl file (for the
specific schema).

"gmd:distributionInfo/gmd:MD_Distribution/gmd:transferOptions/gmd:MD_DigitalTransferOptions/gmd:onLine/gmd:CI_OnlineResource/gmd:name/gco:CharacterString"?

I can query the topicCategory with the following query. So, I want to be
able to query the protocol too.
<?xml version="1.0"?>
<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2&quot;
service="CSW" version="2.0.2"
   resultType="results" outputSchema="csw:IsoRecord">
   <csw:Query typeNames="gdm:MD_Metadata">
       <csw:Constraint version="1.1.0">
           <Filter xmlns="http://www.opengis.net/ogc&quot; xmlns:gml="
http://www.opengis.net/gml&quot;&gt;
              <PropertyIsLike wildCard="*" singleChar="#" escapeChar="!">
                 <PropertyName>topicCat</PropertyName>
                 <Literal>#*</Literal>
              </PropertyIsLike>
           </Filter>
       </csw:Constraint>
   </csw:Query>
</csw:GetRecords>

So, if I update the following files (Config-csw.xml and Index-Fields.xsl)
with the correct tag mapping and xpath, would it work? or am I missing
something.

In the config-csw.xml file you could define additional queryable properties
for your lucene field you just add to the index if you want these fields
descibed in CSW GetCapabilites operation.

HTH,

Cheers,

Mathieu

Hi Abdi.Jama,

Did you resolve this problem? Can you search by PropertyIsLike but the
literal is not "#*"? I tried to find with literal 'OGC:WMS*' but the service
return no result but it should return 2 results as expected.

Here is my filter query:

<Filter xmlns="http://www.opengis.net/ogc&quot;
xmlns:gml="http://www.opengis.net/gml&quot;&gt;
    <PropertyIsLike wildCard="*" singleChar="#" escapeChar="!"
matchCase="false">
        <PropertyName>protocol</PropertyName>
        <Literal>OGC:WMS*</Literal>
    </PropertyIsLike>
</Filter>
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/CSW-queries-for-Protocol-and-Name-tp3270840p5102298.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.

The problem may be that there is no standard URI to identify the protocol that is used in the metadata.
steve

On 5/26/2010 12:50 AM, t800t8 wrote:

Hi Abdi.Jama,

Did you resolve this problem? Can you search by PropertyIsLike but the
literal is not "#*"? I tried to find with literal 'OGC:WMS*' but the service
return no result but it should return 2 results as expected.

Here is my filter query:

<Filter xmlns="http://www.opengis.net/ogc&quot;
xmlns:gml="http://www.opengis.net/gml&quot;&gt;
     <PropertyIsLike wildCard="*" singleChar="#" escapeChar="!"
matchCase="false">
         <PropertyName>protocol</PropertyName>
         <Literal>OGC:WMS*</Literal>
     </PropertyIsLike>
</Filter>
   
--
Stephen M. Richard
Section Chief, Geoinformatics
Arizona Geological Survey
416 W. Congress St., #100
Tucson, Arizona, 85701 USA

Phone:
Office: (520) 209-4127
Reception: (520) 770-3500
FAX: (520) 770-3505

email: steve.richard@anonymised.com

Hi,

I found that PropertyIsLike filter doesn't work correctly all the time, but if you use a PropertyIsEqualTo filter like the one below and your Literal is the complete value of what you are looking for, then you will get all the records that match it.

<Filter xmlns="http://www.opengis.net/ogc&quot; xmlns:gml="http://www.opengis.net/gml&quot;&gt;
  <PropertyIsEqualTo>
    <PropertyName>protocol</PropertyName>
    <Literal>OGC:WMS-1.1.1-http-get-map</Literal>
  </PropertyIsEqualTo>
</Filter>

Make sure the following line is in the config-csw.xml:
<parameter name="Protocol" field="protocol" type="AdditionalQueryables" />

Regards,
Abdi

-----Original Message-----
From: Stephen M Richard [mailto:steve.richard@anonymised.com]
Sent: Wednesday, 26 May 2010 11:43 PM
To: geonetwork-devel@lists.sourceforge.net
Subject: Re: [GeoNetwork-devel] CSW queries for Protocol and Name

The problem may be that there is no standard URI to identify the
protocol that is used in the metadata.
steve

On 5/26/2010 12:50 AM, t800t8 wrote:

Hi Abdi.Jama,

Did you resolve this problem? Can you search by PropertyIsLike but the
literal is not "#*"? I tried to find with literal 'OGC:WMS*' but the service
return no result but it should return 2 results as expected.

Here is my filter query:

<Filter xmlns="http://www.opengis.net/ogc&quot;
xmlns:gml="http://www.opengis.net/gml&quot;&gt;
     <PropertyIsLike wildCard="*" singleChar="#" escapeChar="!"
matchCase="false">
         <PropertyName>protocol</PropertyName>
         <Literal>OGC:WMS*</Literal>
     </PropertyIsLike>
</Filter>
   
--
Stephen M. Richard
Section Chief, Geoinformatics
Arizona Geological Survey
416 W. Congress St., #100
Tucson, Arizona, 85701 USA

Phone:
Office: (520) 209-4127
Reception: (520) 770-3500
FAX: (520) 770-3505

email: steve.richard@anonymised.com

------------------------------------------------------------------------------

_______________________________________________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Hi Abdi.Jama,

Thanks for your answer, I already use PropertyIsEqualTo.

About adding "<parameter name="Protocol" field="protocol"
type="AdditionalQueryables" />" to config-csw.xml, seems it's only necessary
if you want to query by CQL.
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/CSW-queries-for-Protocol-and-Name-tp3270840p5111428.html
Sent from the GeoNetwork developer mailing list archive at Nabble.com.

Hi Abdi and t800t8,

I had a look at this particular case (still interested to hear about the others Abdi!). The problem is that the wild card query text (in this case OGC:WMS*) is being converted to lower case by the lucene query builder in src/org/fao/geonetwork/search/LuceneSearcher.java (makeQuery method). This is unfortunate because the protocol field against which this query is being run in Lucene is not tokenized (which is correct) and the protocol strings are all in upper case.

Cheers,
Simon

t800t8 wrote:

Hi Abdi.Jama,

Did you resolve this problem? Can you search by PropertyIsLike but the
literal is not "#*"? I tried to find with literal 'OGC:WMS*' but the service
return no result but it should return 2 results as expected.

Here is my filter query:

<Filter xmlns="http://www.opengis.net/ogc&quot;
xmlns:gml="http://www.opengis.net/gml&quot;&gt;
    <PropertyIsLike wildCard="*" singleChar="#" escapeChar="!"
matchCase="false">
        <PropertyName>protocol</PropertyName>
        <Literal>OGC:WMS*</Literal>
    </PropertyIsLike>
</Filter>