NIH | National Cancer Institute | NCI Wiki  

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Deleted based on 1/19 discussion.
Excerpt
hiddentrue

dm_query_dataobject

If your user account has the Read , Write, or Own permission level on a collection or data file in DME,  you can search you can search for that data. You can generate a list of such data files , with that match a search query. You can also specify a search path to narrow the search. The list provides the full path to each file in DME

New collections and data files appear in search results 30-60 minutes after they were created

To search for data:

  1. In your file local system, create a JSON file that specifies a search query. ( For more information, TBD)refer to Building a Query to Search for Data via the CLU
  2. Run the following command:

    code
    Panel
    borderColorsilver
    borderStylesolid
    Clipboard
    AllowLineWraptrue

    dm_query_dataobject

    [-D

    REST-response]

    [-o

    output-file]

    <criteria.json>

    [search-path]

    The following table describes each parameter: 

    Optionally specify the collection search in The path to .
    ParameterDescription
    [-D <REST-response>]

    An optional parameter, specifying a path and filename in your file local system. The system always creates a response file:

    • If you specify this parameter, the system saves the response from the server to the specified file in the specified location.
    • If you omit this parameter, the system saves the file as query-dataobject-response-header.tmp in your home directory.
    [-o
    <metadata
     <output-file>]

    An optional parameter, specifying a path and filename in your file local system. The system always creates a metadata query output file:

    • If you specify this parameter, the system saves the metadata query output to the specified file in the specified location.
    • If you omit this parameter, the system prints the metadata query output to standard output and saves the file as query-dataobject-response-message.json.tmp in your home directory.
    The metadata includes information about the data file, a list of attribute values for the file, and a list of attribute values for the parent collection
    • .
    <criteria.json>
    A path and filename for a JSON file in your local system, containing the compound query for the search.
    [search-path]
    An optional parameter, specifying the path to the collection in DME

Search for dataobjects based on the given compound query and optional search path.

  1. in which you want to search.

For example, consider the following criteria.json file. When you perform a query, the system requires it in the context of a compoundQuery element with a join operator, even if it contains only one simple query.

Code Block
{
   "compoundQuery": {
      "operator": "AND",
      "queries": [
         {
            "attribute": "source_file_size",
            "value": "10",
            "operator": "NUM_LESS_OR_EQUAL"
         }
      ]
      },
   "detailedResponse": false,
   "page": 1,
   "totalCount": true
}

With the above criteria.json file, the following command generates a list of data files in DME, in Project_1 and subcollections, that are size 10 or smaller. The output provides a total count of results and lists only the first page (the first 100 paths).

Panel
borderColorsilver
borderStylesolid
Clipboard
AllowLineWraptrue

dm_query_dataobject criteria.json /Example_Archive/PI_Lab1/Project_1

To generate the second page (the second 100 paths), set the page indicator to 2. To generate a list with metadata, set detailedResponse to true. OPTIONS:
[-D REST-response] Optionally specify the filename to capture REST response
[-o output-json-file] Optionally specify the filename to capture the JSON response
<criteria.json> JSON file containing the compound query for the search
[search-path] Optionally specify the collection path to search in