Skip to content

occ_download with pred_not(pred_notnull("<>")) #452

@jhnwllr

Description

@jhnwllr

There is a way on GBIF to get NULL (empty values) by running a sort of hack (not not null).
example here: https://www.gbif.org/occurrence/download/0131893-200613084148143

I think this actually works with occ_download if you run something like this

occ_download_prep(
type="or",
pred_lt("coordinateUncertaintyInMeters",10000),
pred_not(pred_notnull("coordinateUncertaintyInMeters")),
format = "SIMPLE_CSV",
user=user,pwd=pwd,email=email
)

<<gbif download - prepared>>
Username: jwaller
E-mail: jwaller@gbif.org
Format: SIMPLE_CSV
Request:
type: or
predicates:
> type: lessThan, key: COORDINATE_UNCERTAINTY_IN_METERS, value(s): 10000
> type: not
predicate:

this also works

occ_download_prep(
type="or",
pred_lt("coordinateUncertaintyInMeters",10000),
pred_not(pred_notnull("coordinateUncertaintyInMeters")),
pred_and(
pred("basisOfRecord", "FOSSIL_SPECIMEN")
),
format = "SIMPLE_CSV",
user=user,pwd=pwd,email=email
)

However, it fails if I try to do it with pred_not...

occ_download_prep(
type="or",
pred_lt("coordinateUncertaintyInMeters",10000),
pred_not(pred_notnull("coordinateUncertaintyInMeters")),
pred_and(
pred_not(pred("basisOfRecord", "FOSSIL_SPECIMEN"))
),
format = "SIMPLE_CSV",
user=user,pwd=pwd,email=email
)

Error in pred_factory("=")(key, value) :
argument "value" is missing, with no default
Calls: occ_download_prep ... parse_predicates -> pred_and -> -> pred ->
Execution halted

Wondering if you know what is happening here? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions