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

Trying to convert an EML to ISO: Error in as(f, "ISOMetadata"): no method or default for coercing “character” to “ISOMetadata” #208

Open
yvanlebras opened this issue Jun 19, 2024 · 2 comments

Comments

@yvanlebras
Copy link
Contributor

yvanlebras commented Jun 19, 2024

Hi Emmanuel,

I am trying things ;) And notably to convert an EML metadata file into ISOMetadata object so I can look at the ISO19139 resulting metadata file.

Trying with this code (my original EML metadata document PATH is in "file_path" variable):

install.packages("devtools")
devtools::install_github("ropensci/emld")
f <- system.file(file_path, package="emld")
library("geometa")
my_geometa_object <- as(f, "ISOMetadata")

I have an error message:

Error in as(f, "ISOMetadata"): no method or default for coercing “character” to “ISOMetadata”
Traceback:

1. as(f, "ISOMetadata")
2. stop(gettextf("no method or default for coercing %s to %s", dQuote(thisClass), 
 .     dQuote(Class)), domain = NA)

For sure I made something wrong, sorry if really stupid....

Wishing you a very good end of week,

Cheers

@eblondel
Copy link
Owner

You can look at https://github.com/eblondel/geometa/blob/master/tests/testthat/test_geometa_mapping.R#L311

Here used it directly on a file f, you should first read the file as emld object, after that you can convert it to ISOMetadata. This said, this mapping stuff was highly experimental, although it was working at that time, I didn't try since a loooong time..

@yvanlebras yvanlebras changed the title Traying to convert an EML to ISO: Error in as(f, "ISOMetadata"): no method or default for coercing “character” to “ISOMetadata” Trying to convert an EML to ISO: Error in as(f, "ISOMetadata"): no method or default for coercing “character” to “ISOMetadata” Jun 19, 2024
@yvanlebras
Copy link
Contributor Author

Oh, sorry, really stupid ;) My EML is not an emld object...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants