Skip to content

CLASS ndi.query

  Ensure the did.query class definition is available on the MATLAB path


Superclasses

did.query

Properties

Property Description
searchstructure

Methods

Method Description
and add DID.QUERY objects
or search for this DID.QUERY object or that DID.QUERY object
query create an NDI query object for searching an NDI database
searchcellarray2searchstructure convert a search cell array to a search structure
searchstruct make a search structure from field, operation, param1, param2 inputs
to_searchstructure convert an DID.QUERY object to a set of search structures

Methods help

and - add DID.QUERY objects

C = AND(A,B) or C = A & B

  Produces a new DID.QUERY object C that is true if both DID.QUERY A and DID.QUERY B are true.

  Combines the searches from A and B into a search C. The searchstructure field of
  C will be a concatenated version of those from A and B. The query C will only pass if
  all of the characteristics of A and B are satisfied.

Help for ndi.query/and is inherited from superclass did.query

or - search for this DID.QUERY object or that DID.QUERY object

C = OR(A,B) or C = A | B

  Produces a new DID.QUERY object C that is true if either DID.QUERY A or DID.QUERY B is true.

Help for ndi.query/or is inherited from superclass did.query

query - create an NDI query object for searching an NDI database

Creates an NDI.QUERY object, which inherits from DID.QUERY.
  It encapsulates search criteria in a SEARCHSTRUCTURE property
  appropriate for use with FIELDSEARCH or similar functions used
  by the NDI database search mechanism.

  The SEARCHSTRUCTURE has the fields:
  Field:                   | Description
  ---------------------------------------------------------------------------
  field                      | A character string of the field to examine (e.g., 'ndi_document_property.name')
  operation                  | The operation to perform. Most operations can be
                             |   negated by prefixing with '~'. This operation
                             |   determines values of fields 'param1' and 'param2'.
      |----------------------|----------------------------------------------------
      |   'regexp'             - Regular expression match between field value and 'param1'.
      |   'exact_string'       - Field value is an exact string match for 'param1'.
      |   'exact_string_anycase' - Field value is an exact string match for 'param1' (ignoring case).
      |   'contains_string'    - Field value is a char array that contains 'param1'.
      |   'exact_number'       - Field value is exactly 'param1' (same size and values).
      |   'lessthan'           - Field value is less than 'param1'.
      |   'lessthaneq'         - Field value is less than or equal to 'param1'.
      |   'greaterthan'        - Field value is greater than 'param1'.
      |   'greaterthaneq'      - Field value is greater than or equal to 'param1'.
      |   'hasfield'           - Field is present? (no role for 'param1'/'param2').
      |   'hasanysubfield_contains_string' - Field is struct/cell array where any element
      |                                    has subfield 'param1' containing string 'param2'.
      |   'isa'                - Document class is or inherits from 'param1'.
      |   'depends_on'         - Document depends on item with name 'param1' and value 'param2'.
      |   'or'                 - Logical OR of search structures in 'param1' and 'param2'.
      |   '~...'               - Negation of most operations above (e.g., '~exact_number').
      |----------------------|----------------------------------------------------
  param1                     | Search parameter 1. Meaning depends on 'operation' (see above).
  param2                     | Search parameter 2. Meaning depends on 'operation' (see above).
  ---------------------------------------------------------------------------
  See FIELDSEARCH documentation for full details of the search structure.

  Construction options are identical to did.query:

  NDI_QUERY_OBJ = NDI.QUERY(SEARCHSTRUCT) - Accepts a SEARCHSTRUCT.
  NDI_QUERY_OBJ = NDI.QUERY(SEARCHCELLARRAY) - Accepts {'prop1',val1,...}.
  NDI_QUERY_OBJ = NDI.QUERY(FIELD, OPERATION, PARAM1, PARAM2) - Specifies components.

  Examples:
    q = ndi.query('ndi_document_property.id','exact_string','12345678','')
    q = ndi.query('ndi_document_property.name','exact_string','my_ndi_name')
    q = ndi.query('ndi_document_property.name','regexp','(.*)') % match any name
    q = ndi.query('','isa','ndi.document.base') % match any ndi.document.base or subclass

    Documentation for ndi.query/query
       doc ndi.query

searchcellarray2searchstructure - convert a search cell array to a search structure

SEARCHSTRUCT = SEARCHCELLARRAY2SEARCHSTRUCTURE(SEACHCELLARRAY)

  Converts a cell array with SEARCHCELLARRAY = {'property1',value1,'property2',value2, ...}
  into a SEARCHSTRUCT with the 'regexp' operator in the case of a character 'value' or the 'exact_number'
  operator in the case of a non-character value.

  See also: FIELDSEARCH, NDI.QUERY/DID.QUERY

Help for ndi.query.searchcellarray2searchstructure is inherited from superclass did.query

searchstruct - make a search structure from field, operation, param1, param2 inputs

SEARCHSTRUCT_OUT = SEARCHSTRUCT(FIELD, OPERATION, PARAM1, PARAM2)

  Creates search structure with the given fields FIELD, OPERATION, PARAM1, PARAM2.

  See also: FIELDSEARCH, NDI.QUERY/DID.QUERY

Help for ndi.query.searchstruct is inherited from superclass did.query

to_searchstructure - convert an DID.QUERY object to a set of search structures

SEARCHSTRUCTURE = TO_SEARCHSTRUCTURE(DID.QUERY_OBJ)

  Converts an DID.QUERY object to a set of search structures without any
  DID.QUERY dependencies (see FIELDSEARCH).

  See also: FIELDSEARCH

Help for ndi.query/to_searchstructure is inherited from superclass did.query