Please enable JavaScript to view this site.

QPR Knowledge Base 2023.1

  •      
  • Navigation: Developer's Guide > QPR Web Services Foundation > Functions > QueryObjects > Query Syntax

    Common Query Functions

    Scroll Prev Top Next More

    These functions are available for all objects (UM, PO, PG, and SC):

     

    Related([relation=<relation name> [, <relation parameters>]], [hierarchy=<hierarchy name> [, <hierarchy parameters>]], [viewsettings=<navigator view settings name or id>], <recursion parameters>, <global parameters>)

    Returns related objects identified by <relation name> or <hierarchy name>, or in the case of <navigator view settings name or id>, returns elements that are on a single hierarchy level under the starting element in a QPR Modeling Client model.

    The navigator view settings id can be either an id (single number) or a full id. If full id is given, the model id must match with the model id of the root element. If the model ids do not match, the result will be an empty set.

    The navigator view settings name can be given in three formats:

    Exactly as it is, e.g. "1 - My navigator view #12"

    With spaces omitted, e.g. "1-Mynavigatorview#12"

    In script name format:

    oThe allowed characters are _, a-z, A-Z, 0-9

    o# characters are converted to _

    oIf the name starts with a digit, the name will be prefixed with _

    oAll other characters are removed

    oFor example: "_1Mynavigatorview_12"

    Sharepoint hierarchies are not supported.

     

    SubObjects([<recursion parameters>, <global parameters>])

    Returns all sub-objects.

     

    HierarchyRoots([hierarchy=<hierarchy name> [, <hierarchy parameters>]], [viewsettings=<navigator view settings name or id>], [, <global parameters>])

    Returns root nodes of a given hierarchy, or in the case of <navigator view settings name or id>, returns elements on the root level of the navigator hierarchy identified by the view settings name or id in a QPR Modeling Client model. Using the navigator view settings name or id will work correctly only when performing the query on the model level, e.g. [PG.1234].HierarchyRoots(viewsettings="vs").

    The navigator view settings id can be either an id (single number) or a full id. If full id is given, the model id must match with the model id of the root element. If the model ids do not match, the result will be an empty set.

    The navigator view settings name can be given in three formats:

    Exactly as it is, e.g. "1 - My navigator view #12"

    With spaces omitted, e.g. "1-Mynavigatorview#12"

    In script name format:

    oThe allowed characters are _, a-z, A-Z, 0-9

    o# characters are converted to _

    oIf the name starts with a digit, the name will be prefixed with _

    oAll other characters are removed

    oFor example: "_1Mynavigatorview_12"

    Sharepoint hierarchies are not supported.

     

    Filter([include=<typename(s)>, exclude=<typename(s)>, responsible=<userid(s)>, <global parameters>])

    Filters objects by leaving only objects of given types and (in the case user ID is provided) objects which the corresponding user is responsible for. Model ID's and product ID's are not supported. All objects that do not support responsibility status are filtered out in the case the responsible parameter is defined. Note that if an attribute that takes parameters (e.g. period for a range value) is used in a filter, the parameter value needs to be enclosed in escaped parentheses, e.g. \"SC.123456789.234567890\".

     

    Actions([<recursion parameters>, <global parameters>])

    Returns actions connected to an object. Not available for full ID's containing only the product ID. If called for a model, all the actions attached to any object in that model are returned. If versioning is used in PG, this function always returns actions attached to any version (i.e. actions are queried from the root model).

     

    <typename>([<recursion parameters>, <global parameters>])

    Returns related objects of type <typename>. If the type name in the product contains spaces, omit them when using them here.

     

    <relationname>([<relation parameters>, <recursion parameters>, <global parameters>])

    Returns objects related through <relationname>.

     

    <hierarchy name>([<hierarchy parameters>, <recursion parameters>, <global parameters>])

    Returns objects next in hierarchy identified by <hierarchy name>. Unless recursion parameters define otherwise, only the first level of the defined hierarchy is returned.

     

    attributeasfunction(attributeasfunction="<attributename>")

    This relation allows any object query attribute to be used as an object query relation. For example [PO].comment.attributeasfunction(attributeasfunction="creator") would return IDs of all users who have created Comment type actions.

     

     

    Parameter Group Values

    The parameter group values listed in angle brackets in the function listings above are as follows:

     

    <typename>

    Valid options for the UM object: See the UM Object Functions section.

    Valid options for the PO object: See the PO Object Functions section.

    Valid options for the PG object: See the PG Object Functions section.

    Valid options for the SC object: See the SC Object Functions section.

     

    <typename(s)>

    A comma-separated list of multiple <typename> parameters.

     

    <userid(s)>

    A comma-separated list of user ID's, login names, or a set of user ID's. _CURRENT_USER is used to identify the current user.