How to query associated resources? SOLVED

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to query associated resources? SOLVED

sulu
This post was updated on .
Hi.

I would like to query associated resources dor dataset metadata.
e. g. Ass. resources for Dataset-UUID(XXXX) yields: UUID-YYYY, UUID-ZZZZ,
....
oder none if there aren't any.

For service-metadata one can look for SV_CoupledResource in the
metadata-xml.
But where are associations stored for dataset metadata?

I cannot find anything in my geonetwork-DB (postgres)

Thanks
Andy



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoNetwork-users-f3860293.html


_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
Reply | Threaded
Open this post in threaded view
|

Re: How to query associated resources?

Francois Prunayre
Hi,

you can use the API
https://vanilla.geocat.net/geonetwork/doc/api/index.html#/records/getAssociated
Relations are indexed but not stored in specific tables in the DB.

HTH
Francois

Le mer. 5 févr. 2020 à 11:19, sulu <[hidden email]> a écrit :

> Hi.
>
> I would like to query associated resources dor dataset metadata.
> e. g. Ass. resources for Dataset-UUID(XXXX) yields: UUID-YYYY, UUID-ZZZZ,
> ....
> oder none if there aren't any.
>
> For service-metadata one can look for SV_CoupledResource in the
> metadata-xml.
> But where are associations stored for dataset metadata?
>
> I cannot find anything in my geonetwork-DB (postgres)
>
> Thanks
> Andy
>
>
>
> --
> Sent from:
> http://osgeo-org.1560.x6.nabble.com/GeoNetwork-users-f3860293.html
>
>
> _______________________________________________
> GeoNetwork-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geonetwork-users
> GeoNetwork OpenSource is maintained at
> http://sourceforge.net/projects/geonetwork
>

_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
Reply | Threaded
Open this post in threaded view
|

Re: How to query associated resources?

sulu
Hi Francois.

Thanks. So i'll try to use the API.

Unfortunately i seem incapable to obtain a result.

Thats what i tried:
Get me a token:
rm -f /tmp/cookie; curl -c /tmp/cookie
http://localhost:8900/geonetwork/srv/eng/info?type=me -X POST ; cat
/tmp/cookie

Query the API:
curl -v -X GET
"http://localhost:8900/geonetwork/api/0.1/records/8f68ae99-cfc6-4239-88b7-ace57af6e3cc/related"
-H "X-XSRF-TOKEN: XXXXXXXXXX" --user YYYYY:ZZZZ -b /tmp/cookie


The API then refuses me an answer:
...
< HTTP/1.1 302
* Added cookie JSESSIONID="DB5AE289D342D34C838EA6C4810A1885" for domain
cnvbrwgdi8.net.vlr.gv.at, path /geonetwork, expire 0
< Set-Cookie: JSESSIONID=DB5AE289D342D34C838EA6C4810A1885; Path=/geonetwork;
HttpOnly
< Location:
/geonetwork/accessDenied.jsp/eng/service-not-allowed?referer=/geonetwork/api/0.1/records/8f68ae99-cfc6-4239-88b7-ace57af6e3cc/related

I most likely did something wrong. But what?

Merci
Andy










--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoNetwork-users-f3860293.html


_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
Reply | Threaded
Open this post in threaded view
|

Re: How to query associated resources?

Francois Prunayre
Hi,
http://localhost:8900/geonetwork/api/0.1/records/8f68ae99-cfc6-4239-88b7-ace57af6e3cc/related

should be
http://localhost:8900/geonetwork/srv/api/0.1/records/8f68ae99-cfc6-4239-88b7-ace57af6e3cc/related

Cheers.

Le lun. 10 févr. 2020 à 09:17, sulu <[hidden email]> a écrit :

> Hi Francois.
>
> Thanks. So i'll try to use the API.
>
> Unfortunately i seem incapable to obtain a result.
>
> Thats what i tried:
> Get me a token:
> rm -f /tmp/cookie; curl -c /tmp/cookie
> http://localhost:8900/geonetwork/srv/eng/info?type=me -X POST ; cat
> /tmp/cookie
>
> Query the API:
> curl -v -X GET
> "
> http://localhost:8900/geonetwork/api/0.1/records/8f68ae99-cfc6-4239-88b7-ace57af6e3cc/related
> "
> -H "X-XSRF-TOKEN: XXXXXXXXXX" --user YYYYY:ZZZZ -b /tmp/cookie
>
>
> The API then refuses me an answer:
> ...
> < HTTP/1.1 302
> * Added cookie JSESSIONID="DB5AE289D342D34C838EA6C4810A1885" for domain
> cnvbrwgdi8.net.vlr.gv.at, path /geonetwork, expire 0
> < Set-Cookie: JSESSIONID=DB5AE289D342D34C838EA6C4810A1885;
> Path=/geonetwork;
> HttpOnly
> < Location:
>
> /geonetwork/accessDenied.jsp/eng/service-not-allowed?referer=/geonetwork/api/0.1/records/8f68ae99-cfc6-4239-88b7-ace57af6e3cc/related
>
> I most likely did something wrong. But what?
>
> Merci
> Andy
>
>
>
>
>
>
>
>
>
>
> --
> Sent from:
> http://osgeo-org.1560.x6.nabble.com/GeoNetwork-users-f3860293.html
>
>
> _______________________________________________
> GeoNetwork-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geonetwork-users
> GeoNetwork OpenSource is maintained at
> http://sourceforge.net/projects/geonetwork
>

_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
Reply | Threaded
Open this post in threaded view
|

Re: How to query associated resources?

sulu
In reply to this post by Francois Prunayre
Hi Francois.

Please don't bother.

My URL was incomplete.

This query tells me something:

 curl -X GET
"http://localhost:8900/geonetwork/srv/api/0.1/records/81be102a-f5bb-4e36-95e7-84afa238df71/related?start=1&rows=100"
-H  "accept: application/xml" -H "X-XSRF-TOKEN: ${XSRFTOKEN}"

Thanks again
Andy




--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoNetwork-users-f3860293.html


_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork