Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GeoNode CSW catalog requires the dc:type=dataset filtert #103

Closed
giohappy opened this issue Mar 31, 2021 · 17 comments
Closed

GeoNode CSW catalog requires the dc:type=dataset filtert #103

giohappy opened this issue Mar 31, 2021 · 17 comments

Comments

@giohappy
Copy link

giohappy commented Mar 31, 2021

Services and maps are going to be exposed by the CSW catalogue.
To avoid listing these resources inside the MapStore client catalog a filter must be always included:

<csw:Constraint version="1.1.0">
  <Filter xmlns="http://www.opengis.net/ogc">
	<PropertyIsEqualTo>
	  <PropertyName>dc:type</PropertyName>
	  <Literal>dataset</Literal>
	</PropertyIsEqualTo>
  </Filter>
</csw:Constraint>

This must be positioned after csw:ElementSetName element

The expected results in catalog should be only layers (dc:type equal to dataset) but currently other resources are visible.
Below screenshot of the current Catalog showing resources different from layers.

image

Note: This issue needs to be fixed on MapStore first probably so we should do a quick investigation to understand which part of the code need to be fixed.

@giohappy
Copy link
Author

giohappy commented Mar 31, 2021

@allyoucanmap as confirmed by @etj we can safely adopt this filter upstream in MapStore.

@allyoucanmap
Copy link
Collaborator

connected to geosolutions-it/MapStore2#6813

@MuhweziDeo
Copy link

MuhweziDeo commented Apr 29, 2021

@giohappy @etj testing this filter in Mapstore

<csw:Constraint version="1.1.0">
 <Filter xmlns="http://www.opengis.net/ogc">
   <PropertyIsEqualTo>
     <PropertyName>dc:type</PropertyName>
     <Literal>dataset</Literal>
   </PropertyIsEqualTo>
 </Filter>
</csw:Constraint>.

It seems not to be working because responses received do not change I also noticed that the records returned even non-layers have dc:type === dataset. I do not know maybe there something I am missing but the final XML body constructed looks like this when there is no search text

<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
     xmlns:ogc="http://www.opengis.net/ogc"
     xmlns:gml="http://www.opengis.net/gml"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:dct="http://purl.org/dc/terms/"
     xmlns:gmd="http://www.isotc211.org/2005/gmd"
     xmlns:gco="http://www.isotc211.org/2005/gco"
     xmlns:gmi="http://www.isotc211.org/2005/gmi"
     xmlns:ows="http://www.opengis.net/ows" service="CSW" version="2.0.2" resultType="results" startPosition="${startPosition}" maxRecords="${maxRecords}">
     <csw:Query typeNames="csw:Record">
         <csw:ElementSetName>full</csw:ElementSetName>
         <csw:Constraint version="1.1.0">
             <ogc:Filter>
                 <ogc:PropertyIsEqualTo>
                     <ogc:PropertyName>dc:type</ogc:PropertyName>
                     <ogc:Literal>dataset</ogc:Literal>
                 </ogc:PropertyIsEqualTo>
             </ogc:Filter>
         </csw:Constraint>
     </csw:Query>
 </csw:GetRecords>

one of the records which are not layer includes the one below and you can see dc:type is dataset

Screenshot 2021-04-29 at 13 12 59

Screenshot 2021-04-29 at 13 13 06

@giohappy
Copy link
Author

@MuhweziDeo can you please report the CSW service URL that you used in your example?

@MuhweziDeo
Copy link

@MuhweziDeo can you please report the CSW service URL that you used in your example?

@giohappy this is the URL hit on GeoServer http://localhost:8000/catalogue/csw?service=CSW&version=2.0.2&request=

@giohappy
Copy link
Author

giohappy commented Apr 30, 2021

@MuhweziDeo so the record you are reporting is something in your local GeoNode. You say it's not a layer, what is it then?

@MuhweziDeo
Copy link

@MuhweziDeo so the record you are reporting is something in your local Geoserver. You say it's not a layer, what is it then?

it's a Map @giohappy

@giohappy
Copy link
Author

checking with @etj

@giohappy
Copy link
Author

giohappy commented Apr 30, 2021

The fact that resources different from layers are returned by the CSW Catalogue is a regression / side effect of a recent change to GeoNode.
https://github.com/geosolutions-it/C183-ALMAVIVA-2020-GeoNode-DEV/issues/210

When this will be fixed you should only get layers.

@MuhweziDeo
Copy link

@giohappy just to point this out. Within Mapstore2 the CSW catalog using this URL https://gs-stable.geo-solutions.it/geoserver/csw?service=CSW&version=2.0.2&request= returns empty response on applying the filter
<csw:Constraint version="1.1.0"> <Filter xmlns="http://www.opengis.net/ogc"> <PropertyIsEqualTo> <PropertyName>dc:type</PropertyName> <Literal>dataset</Literal> </PropertyIsEqualTo> </Filter> </csw:Constraint>
This because the dc:type being returned from current CSW Catalog response for mapstore2 is different. This is what it looks <dc:type>http://purl.org/dc/dcmitype/Dataset</dc:type>

ScreenShot
image_2021_05_03T08_57_35_995Z

So in conclusion for Mapstore2 this filter works okay <dc:type>http://purl.org/dc/dcmitype/Dataset</dc:type> while for geonode-mapstore-client the filter <dc:type>dataset</dc:type> doesnot not introduce any changes maybe pending the fix https://github.com/geosolutions-it/C183-ALMAVIVA-2020-GeoNode-DEV/issues/210.

@giohappy
Copy link
Author

giohappy commented May 3, 2021

I see @MuhweziDeo.
Thanks for the report. Let's wait @etj for inputs from him. I don't know if both the types of responses are correct and both should be expected....

@MuhweziDeo
Copy link

@giohappy With the latest fixes in the stable branch. Currently, all the responses are being returned without the non-layers. I applied the new filter but with or without the responses returned only have layer data. I believe no further is required even on https://master.demo.geonode.org/maps/1855/view#/ the responses only have layers from the catalog.

@giohappy
Copy link
Author

Yes @MuhweziDeo that's expected, since with a normal configuration GeoNode's CSW only returns layers. BTW there are contexts where services are also returned.

@MuhweziDeo
Copy link

Okay @giohappy Should we proceed to close this issue without any further action

@giohappy
Copy link
Author

Probably I didn't explain myself clearly @MuhweziDeo.
The filter MUST be set as said above. You won't see any difference when used with a normal GeoNode, but ti deosn't mean we don't need that filter.

@MuhweziDeo
Copy link

Probably I didn't explain myself clearly @MuhweziDeo.
The filter MUST be set as said above. You won't see any difference when used with a normal GeoNode, but ti deosn't mean we don't need that filter.

okay

@allyoucanmap
Copy link
Collaborator

@MuhweziDeo We should make a PR to geonode-mapstore-client branch 2.1.x with the MapStore2 submodule updated pointing to branch geonode-mapstore-client-2.1.x as soon as this fix has been backported and merged on the branch geonode-mapstore-client-2.1.x of MapStore2

allyoucanmap added a commit that referenced this issue May 18, 2021
…e submodule (#185)

* rename permissionsList to perms
* update submodule to include csw filter for layer
* update submodule to include unique interval classification in visual style editor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants