The occurrence and checklist functions include the parameters flags and exclude. Implicit logic for using these parameters isn't well-documented. Here is what I've found for beefing up the docs:
-
Works as expected: A single flag returns all occurrences that have that flag. These occurrences may have more flags.
occurrence(datasetid = 'f5a4799e-dc24-4807-89d9-01da47d52e3b', flags = c('NO_ACCEPTED_NAME'))
-
flag has implicit AND: multiple flags passed in the query contain an implicit AND. I was expecting it to be an implicit OR. For example, this query returns 0 results when there are 193 occurrences flagged as ON_LAND and 1312 with NO_ACCEPTED_NAME:
occurrence(datasetid = 'f5a4799e-dc24-4807-89d9-01da47d52e3b', flags = c('NO_ACCEPTED_NAME', 'ON_LAND'))
-
exclude has implicit OR: multiple exclude values passed in the query contain an implicit OR. This is what I would expect but I was uncertain because of flags testing. Not a big deal, but I think it would be useful to users to document it more explicitly. Example:
occurrence(datasetid = 'f5a4799e-dc24-4807-89d9-01da47d52e3b', exclude = c('NO_ACCEPTED_NAME', 'ON_LAND'))
I also think it would be useful to include a helper function to list all the possible flags, like I've suggested for the field selection in #108
The
occurrenceandchecklistfunctions include the parametersflagsandexclude. Implicit logic for using these parameters isn't well-documented. Here is what I've found for beefing up the docs:Works as expected: A single flag returns all occurrences that have that flag. These occurrences may have more flags.
occurrence(datasetid = 'f5a4799e-dc24-4807-89d9-01da47d52e3b', flags = c('NO_ACCEPTED_NAME'))flag has implicit AND: multiple flags passed in the query contain an implicit AND. I was expecting it to be an implicit OR. For example, this query returns 0 results when there are 193 occurrences flagged as
ON_LANDand 1312 withNO_ACCEPTED_NAME:occurrence(datasetid = 'f5a4799e-dc24-4807-89d9-01da47d52e3b', flags = c('NO_ACCEPTED_NAME', 'ON_LAND'))exclude has implicit OR: multiple exclude values passed in the query contain an implicit OR. This is what I would expect but I was uncertain because of flags testing. Not a big deal, but I think it would be useful to users to document it more explicitly. Example:
occurrence(datasetid = 'f5a4799e-dc24-4807-89d9-01da47d52e3b', exclude = c('NO_ACCEPTED_NAME', 'ON_LAND'))I also think it would be useful to include a helper function to list all the possible flags, like I've suggested for the field selection in #108