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

INSPIRE metadata validator not working #196

Closed
georoen opened this issue Sep 1, 2022 · 3 comments
Closed

INSPIRE metadata validator not working #196

georoen opened this issue Sep 1, 2022 · 3 comments

Comments

@georoen
Copy link

georoen commented Sep 1, 2022

When testing the online INSPIRE metadata validator service, and after applying #174, I get the following error:

[geometa][INFO] Sending metadata file to INSPIRE metadata validation web-service... 
Error in strsplit(uploaded$testObject$id, "EID") : non-character argument

Any idea?

@georoen
Copy link
Author

georoen commented Sep 16, 2022

Hey,

... unfortunately, I still do not progress. It is not possible to execute the example stated in INSPIREMetadataValidator():

apiKey <- "xxxx"
inspireValidator <- INSPIREMetadataValidator$new(apiKey = apiKey)
inspireValidator$getValidationReport(obj = ISOMetadata$new())

> [geometa][INFO] Sending metadata file to INSPIRE metadata validation web-service... 
> Forbidden (HTTP 403).Error in inspireValidator$getValidationReport(obj = ISOMetadata$new()) :

Not being an expert for API interactions; I wondered if pasting the url provided by JRC-INSPIRE-SUPPORT along with the requested API Key would help, but get the error mentioned initially:

api_url <- "inspire.ec.europa.eu/validator/v2/"
inspireValidator = INSPIREMetadataValidator$new(url = api_url, apiKey = apiKey)
inspireValidator$getValidationReport(obj = ISOMetadata$new())

> [geometa][INFO] Sending metadata file to INSPIRE metadata validation web-service... 
> Error in strsplit(uploaded$testObject$id, "EID") : non-character argument

Having had the feeling of progress, I then looked into the source code of getValidationReport() and found the returned object of uploadFile() having an unexpected structure (nested list where out$EtfItemCollection$testObjects$TestObject contains 546 entries with an EID respectively). Strange enough, this response is also different to what was reproduced using the swagger-ui.

Thus, eventually, I am questioning myself whether it's an input error - or some changes in httr, the API, or something else...,? I do not know further and am stuck ^^

Sorry for the inconvenience!

@eblondel
Copy link
Owner

Sorry for the delay, i'm back from annual leave. From exchanges I had with the INSPIRE team in the past, we can't use the above URL for metadata validation. I was requested to use this URL: https://yzyiqfakm4.execute-api.eu-west-1.amazonaws.com/validator/v2 Just tested it with the API key I got from them and it works. Let me know if changing the URL works also for you.

@georoen
Copy link
Author

georoen commented Sep 22, 2022

THANK YOU VERY MUCH!

I had previously tested several URLs, but this one does finally work. That said, this is working code...:

apiKey <- "xxxx"
api_url <- "https://yzyiqfakm4.execute-api.eu-west-1.amazonaws.com/validator/v2"
inspireValidator = INSPIREMetadataValidator$new(url = api_url, apiKey = apiKey)
inspireValidator$getValidationReport(obj = ISOMetadata$new())

... and I am now closing this issue.

PS: Do you plan to update the respective URLs in R/INSPIREMetadataValidator.R?

@georoen georoen closed this as completed Sep 22, 2022
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

2 participants