Examples of querying the CSDMS model repository: Difference between revisions

From CSDMS
(Add the rest of the examples)
No edit summary
Line 39: Line 39:
|-
|-
| List all models (Category technique)
| List all models (Category technique)
| [http://csdms.colorado.edu/mediawiki/api.php?action=ask&query=%5B%5BCategory:Terrestrial%7C%7CCoastal%7C%7CMarine%7C%7CHydrology%7C%7CCarbonate%7C%7CClimate%5D%5D%7Climit=10000&format=jsonfm <nowiki>http://csdms.colorado.edu/mediawiki/api.php?action=ask&query=[[Category:Terrestrial||Coastal||Marine||Hydrology||Carbonate||Climate]]|limit=10000&format=jsonfm</nowiki>]
| [http://csdms.colorado.edu/mediawiki/api.php?action=ask&query=%5B%5BCategory:Terrestrial%7C%7CCoastal%7C%7CMarine%7C%7CHydrology%7C%7CCarbonates%5Fand%5FBiogenics%7C%7CClimate%5D%5D%7Climit=10000&format=jsonfm <nowiki>http://csdms.colorado.edu/mediawiki/api.php?action=ask&query=[[Category:Terrestrial||Coastal||Marine||Hydrology||Carbonates and Biogenics||Climate]]|limit=10000&format=jsonfm</nowiki>]
|}
|}


Python examples of these queries (and others) can be found in the GitHub repository https://github.com/csdms/ask-api-examples.
Python examples of these queries (and others) can be found in the GitHub repository https://github.com/csdms/ask-api-examples.

Revision as of 16:52, 4 November 2016

Here are some examples of queries into the CSDMS model repository.

Description Query URL
List all models created by the user with the last name Tucker http://csdms.colorado.edu/mediawiki/api.php?action=ask&query=[[Last+name::Tucker]]&format=json
List all models written in C http://csdms.colorado.edu/mediawiki/api.php?action=ask&query=[[Programming%20language::C]]&format=json
Really list all models written in C http://csdms.colorado.edu/mediawiki/api.php?action=ask&query=[[Programming%20language::C]]|limit=10000&format=json
List all models from user Tucker written in C http://csdms.colorado.edu/mediawiki/api.php?action=ask&query=[[Last+name::Tucker]][[Programming+language::C]]&format=json
List the first three models written by user Hutton http://csdms.colorado.edu/mediawiki/api.php?action=ask&query=[[Last+name::Hutton]]|limit=3&format=json
List five models written in C, starting at item 20 from the full list http://csdms.colorado.edu/mediawiki/api.php?action=ask&query=[[Programming+language::C]]|limit=5|offset=20
Search for models written a nonexistent programming language to see an error message http://csdms.colorado.edu/mediawiki/api.php?action=ask&query=[[Programming+language::xxyyzz]]&format=jsonfm
Find terrestrial models http://csdms.colorado.edu/mediawiki/api.php?action=ask&query=[[Category:Terrestrial]]&format=jsonfm
Locate a model by name http://csdms.colorado.edu/mediawiki/api.php?action=ask&query=[[Model:HydroTrend]]&format=json
List all models written in Fortran 77 or Fortran 90 http://csdms.colorado.edu/mediawiki/api.php?action=ask&query=[[Programming%20language::Fortran77||Fortran90]]|limit=10000&format=json
Find all models written by user Hutton, including (if available) the DOI and the source code repository for each model http://csdms.colorado.edu/mediawiki/api.php?action=ask&query=[[Last+name::Hutton]]|?DOI+model|?Source+web+address&format=jsonfm
List all models (Category technique) http://csdms.colorado.edu/mediawiki/api.php?action=ask&query=[[Category:Terrestrial||Coastal||Marine||Hydrology||Carbonates and Biogenics||Climate]]|limit=10000&format=jsonfm

Python examples of these queries (and others) can be found in the GitHub repository https://github.com/csdms/ask-api-examples.