Issue 12526

Occurrence search: standardize parameter names

12526
Reporter: kbraak
Assignee: kbraak
Type: Bug
Summary: Occurrence search: standardize parameter names
Priority: Minor
Resolution: Fixed
Status: Closed
Created: 2012-12-11 15:21:00.156
Updated: 2013-09-30 16:48:15.569
Resolved: 2013-01-14 15:47:12.259
        
Description: This is a complete list of occurrence search filters:

Scientific name (TAXON_KEY)
location (BOUNDING_BOX)
collector (COLLECTOR_NAME)
basis of record (BASIS_OF_RECORD)
collection date (DATE)
catalog number (CATALOG_NUMBER)

dataset (datasetKey)

Notice datasetKey is the only parameter in lower/camelCase.

What is our convention for parameter names? Registry web services appear to use lower/camelCase: http://dev.gbif.org/wiki/display/POR/Webservice+API



]]>
    


Author: mdoering@gbif.org
Created: 2012-12-11 15:25:19.649
Updated: 2012-12-11 15:25:19.649
        
we said we use lower camel case all over and also need to make sure the same parameters are called the same everywhere.
See http://dev.gbif.org/issues/browse/POR-363
    


Author: kbraak@gbif.org
Created: 2013-01-14 15:47:12.285
Updated: 2013-01-14 15:47:12.285
        
Lower camel case is used all over. This is our established convention now for parameter naming.

The parameter names, based on ENUMs, can be case insensitive, ignore whitespaces, underscores and dashes. This is thanks to the lookup done in VocabularyUtils: http://code.google.com/p/gbif-common-resources/source/browse/gbif-api/trunk/src/main/java/org/gbif/api/util/VocabularyUtils.java

Therefore, regardless of whether we use datasetKey, DATASET_KEY, dataset_key, or dataset-key in an occurrence search, the parameter name is looked up against the OccurrenceSearchParameter ENUM: http://code.google.com/p/gbif-common-resources/source/browse/gbif-api/trunk/src/main/java/org/gbif/api/model/occurrence/search/OccurrenceSearchParameter.java

Using any of those different parameter names, http://api.gbif.org/dev/occurrence/search?datasetKey=7b5d6a48-f762-11e1-a439-00145eb45e9a returns the same.

All we need to do now, is ensure the web application uses lower camel case when generating URIs. I'll create a separate issue for this. 
    


Author: mdoering@gbif.org
Comment: Can you make sure we document the lowerCamelCase version in our API wiki?
Created: 2013-01-14 16:22:02.719
Updated: 2013-01-14 16:22:02.719


Author: kbraak@gbif.org
Comment: The API wiki is now up to date, using the lower camel case across all parameter names for all services.
Created: 2013-01-14 16:36:14.101
Updated: 2013-01-14 16:36:14.101