AtlasOfLivingAustralia / galah-R

Query living atlases from R
https://galah.ala.org.au
40 stars 2 forks source link

Error parsing urls with `galah_filter` #186

Closed mjwestgate closed 1 year ago

mjwestgate commented 1 year ago

Sometimes it might be desirable to pass taxon concept identifiers to galah_filter(), but sometimes these don't parse:

search_taxa("Chordata")$taxon_concept_id
[1] "https://biodiversity.org.au/afd/taxa/065f1da4-53cd-40b8-a396-80fa5c74dedd"

galah_filter(taxonConceptID == "https://biodiversity.org.au/afd/taxa/065f1da4-53cd-40b8-a396-80fa5c74dedd")
# A tibble: 1 × 4
  variable       logical value query                     
  <chr>          <chr>   <chr> <chr>                     
1 taxonConceptID ==      ...   "(taxonConceptID:\"...\")"

Precisely why this happens is unclear. It's not the presence of / or : because this url passes:

galah_filter(taxonConceptID == "https://ala.org.au")
# A tibble: 1 × 4
  variable       logical value              query                                    
  <chr>          <chr>   <chr>              <chr>                                    
1 taxonConceptID ==      https://ala.org.au "(taxonConceptID:\"https://ala.org.au\")"

This url passes...

galah_filter(taxonConceptID == "https://biodiversity.org.au/afd/taxa/012")
# A tibble: 1 × 4
  variable       logical value                                    query                                                          
  <chr>          <chr>   <chr>                                    <chr>                                                          
1 taxonConceptID ==      https://biodiversity.org.au/afd/taxa/012 "(taxonConceptID:\"https://biodiversity.org.au/afd/taxa/012\")"

...but fails if we add one more character...

galah_filter(taxonConceptID == "https://biodiversity.org.au/afd/taxa/012a")
# A tibble: 1 × 4
  variable       logical value query                     
  <chr>          <chr>   <chr> <chr>                     
1 taxonConceptID ==      ...   "(taxonConceptID:\"...\")"

...suggesting it might be due to string length.

mjwestgate commented 1 year ago

Closed as complete