Overview of Filtering a GetMetadataObjects Request

The GetMetadataObjects method enables you to filter both the initial set of objects and the associated objects that are selected in the GetMetadataObjects request. This topic describes how to filter the initial set of objects selected by GetMetadataObjects. For information to filter the associated objects, see Filtering the Associated Objects That Are Returned by a GetMetadataObjects Request.
The GetMetadataObjects method supports an OMI_XMLSELECT (128) flag to enable you to filter the initial set of objects that are retrieved by the SAS Metadata Server. The OMI_XMLSELECT flag instructs the server to check the OPTIONS parameter for search criteria specified in an <XMLSELECT search="criteria"/> element. The search syntax supported in the <XMLSELECT search="criteria"/> element enables you to filter objects based on the following:
  • attribute criteria
  • association path criteria
  • a combination of attribute and association path criteria
The criteria can be concatenated with the logical operators AND, OR and NOT.
Attribute criteria enable you to select only objects that contain specified attribute values. For example, you can specify:
  • select only Person objects that have a Name attribute value of John Doe.
By concatenating attribute criteria with the logical operators AND or OR, you can perform exclusive or inclusive filtering based on the attribute criteria. For example, you can specify:
  • select objects that have a Name attribute value of John Doe or Jane Doe (exclusive search).
  • select objects that have the attribute=value pairs Name="John Doe" and Title="Manager" (inclusive search).
Association path criteria enables you to select objects that have a specific association and whose associated objects meet association and attribute criteria. For example, you can specify:
  • select Document objects that have a Reports association to a Report object.
  • select Document objects that have a ResponsibleParties association to a ResponsibleParty object that has a Persons association to a Person object that has the Name attribute value of John Doe.
In both examples, the Document objects that are retrieved are filtered by one association path. In the first example, the filtering association path starts with the association Reports. Documents that do not have a Reports association are ignored. In the second example, the filtering association path starts with the association ResponsibleParties. Documents that do not have a ResponsibleParties association are ignored. In addition, the ResponsibleParty objects found through the ResponsibleParties association are filtered to include only objects that have a Persons association to a Person object that has the attribute value Name="John Doe".
When you concatenate association path criteria, the method filters the objects that are selected. Filtering is based on two or more associations that are directly defined for the specified metadata type. In SAS 9.3, the XMLSELECT search syntax supports explicit AND and OR logical operators in concatenated association path criteria. Concatenated association path criteria can be used to select objects that meet the following requirements:
  • all of the criteria specified in all of the association paths
  • the criteria in one association path or the criteria in another association path
For example, you can specify to select the following:
  • Document objects that have a Reports association to a Report object that has a Name attribute value of Sales AND a ResponsibleParties association to a ResponsibleParty object that has a Persons association to a Person object that has a Name value of John Doe.
  • Document objects that have a Reports association to a Report object that has a Name attribute value of Sales OR a ResponsibleParties association to a ResponsibleParty object that has a Persons association to a Person object that has a Name value of John Doe.
SAS 9.3 supports a NOT logical operator in attribute criteria and a NOT function in association path syntax. Instead of returning objects that match the specified attribute or association path criteria, the new operator and function return objects that do not match the specified criteria.