OpenKIM Query

Basic usage Specifying SI units Retrieving multiple keys

The following formats are accepted: CC_DDDDDDDDDDDD, TestName__CC_DDDDDDDDDDDD, CC_DDDDDDDDDDDD_VVV, TestName__CC_DDDDDDDDDDDD_VVV. Generally, the three digit version extension (VVV) should be omitted so that the latest version of the Test will be queried on. For more on KIM IDs, please refer to the Guide to KIM IDs.

Accepted formats are identical to those above and, similar to above, the three digit version extension should generally be omitted.

A square-bracketed, comma-separated list of quoted strings corresponding to standard elemental symbols (case sensitive). Test Results returned will be required to contain each element listed.

May be specified as either the short name of a Property Definition, e.g. structure-cubic-crystal-npt, or the full property ID, e.g.,2014-04-15:property/structure-cubic-crystal-npt. Only the short name should generally be used so that the latest version of the Property Definition is queried on. See here for a current list of Property Definitions.

Ordered array of keys specified as a square-bracketed, comma-separated list of quoted strings. The order of the keys must correspond to the order of the entries in the 'Units' field below.

A square-bracketed, comma-separated list of quoted strings indicating the desired units that the value of each key should be returned in. The order of the entries in this list should correspond to the order of the entries in the 'Keys' field above. Valid strings for units are any of those recognized by the GNU units utility, or the special string "SI". Keys which are unitless must have a value of null (case-sensitive and unquoted).

Example queries (click to try)
Get all jobs that are currently running Get all Test Drivers in the database Get all fcc Al lattice constants and the Model that ran them
Longest running Test name and time Get a 10 line tail of the logs Get the lowest energy crystal structure for each Model using Al

Things you want true, as a dictionary of key value pairs, e.g. {"type": "td"} makes sure that all objects are test drivers.

Things you want back, as a dictionary of booleans, e.g. {"type":1, "path":1} returns just type and path (and '_id')

A JavaScript function that operates to on the map portion of map-reduce. For more information, check the docs

A JavaScript function that operates to on the reduce portion of map-reduce. For more information, check the docs

Database you want, valid options are [obj, data, job, log, agent]

Things you want sorted on, as a string, or a list with direction, e.g. "kimcode" sorts on kimcode, [["kimcode", -1]] gives reverse kimcode

How many you want, an integer, how it stops, leave empty for all

How many you want to skip, relevant if ordered

Things you want distinct, just a key, e.g. "type" would return distinct type fields. Note, this doesn't play well with others.

Reduce result to an array where the columns are ordered by this list i.e. ["meta.kimcode", "crystal-structure.a.source-value"]. Implies flatten.

Whether or not to flatten the keys in the dictionary

Return full database history. By default, only returns latest data

Return only count of number results created by query


        "log": "2019-06-18 15:25:13,142 - INFO - pipeline.pipeline.gateway-0 - Gateway ready, waiting for message..."
        "log": "2019-06-18 15:25:07,018 - INFO - pipeline.pipeline.gateway-0 - Initializing KIM Gateway"
        "log": "2019-06-11 21:32:02,094 - INFO - pipeline.pipeline.director-0 - Got Test Result u'TE_091608566333_001-and-MO_071460865933_002-1560295471-tr', checking for downward dependents..."
        "log": "2019-06-11 21:32:02,074 - INFO - pipeline.pipeline.gateway-0 - Sending task 'pipeline.tasks.director_result' with contents {'status': u'approved', 'priority': 1000000, 'job': [u'StackingFaultFccCrystal_Ar_0bar__TE_091608566333_001', u'Morse_SigmoidalSmoothed_Jelinek_1972_Ar__MO_071460865933_002'], 'uuid': 'TE_091608566333_001-and-MO_071460865933_002-1560295471-tr', 'prompting_function': u'run', 'prompting_child': None, 'result_type': u'tr', 'prompting_parent': [u'LatticeConstantCubicEnergy_fcc_Ar__TE_206669103745_006', u'Morse_SigmoidalSmoothed_Jelinek_1972_Ar__MO_071460865933_002'], 'jobid': u'TE_091608566333_001-and-MO_071460865933_002-1560295471'}"
        "log": "2019-06-11 21:31:59,431 - INFO - pipeline.mongodb - Inserting result or error TE_091608566333_001-and-MO_071460865933_002-1560295471-tr "
        "log": "2019-06-11 21:31:59,407 - INFO - pipeline.rsync_tools - Touching flag file, upload complete for u'TE_091608566333_001-and-MO_071460865933_002-1560295471-tr'"
        "log": "2019-06-11 21:31:59,398 - INFO - pipeline.rsync_tools - ssh_touch_done cmd: ssh -F /home/gateway-user1/.ssh/config-gateway rsync-to-shared-repository \"touch /repo/home/.//pipeline/test-result-uploads/incoming//approved/./tr/TE_091608566333_001-and-MO_071460865933_002-1560295471-tr/upload_complete.txt\" >> /disk2/gateway/openkim-pipeline/logs/ssh.log 2>&1"
        "log": "2019-06-11 21:31:59,388 - INFO - pipeline.rsync_tools - ssh_touch_done remote_file: /repo/home/.//pipeline/test-result-uploads/incoming//approved/./tr/TE_091608566333_001-and-MO_071460865933_002-1560295471-tr/upload_complete.txt"
        "log": "2019-06-11 21:31:58,604 - INFO - pipeline.rsync_tools - running rsync for files: [u'tr/TE_091608566333_001-and-MO_071460865933_002-1560295471-tr']"
        "log": "2019-06-11 21:31:58,583 - INFO - pipeline.pipeline.gateway-0 - Processing jobid TE_091608566333_001-and-MO_071460865933_002-1560295471 with result type tr"

Query Link


curl --data-urlencode 'sort=[["_id",-1]]' --data-urlencode 'fields={"log":1,"_id":0}' --data-urlencode 'limit=10' --data-urlencode 'database=log'



result ="",data={u'sort': u'[["_id",-1]]', u'fields': u'{"log":1,"_id":0}', u'limit': u'10', u'database': u'log'}).json()




$.post("",{"sort": "[[\"_id\",-1]]", "fields": "{\"log\":1,\"_id\":0}", "limit": "10", "database": "log"});


@< query({"sort": [["_id", -1]], "fields": {"_id": 0, "log": 1}, "limit": 10, "database": "log"}) >@