Previous Page | Next Page

Overview of Querying Metadata

Using GetTypes to Get the Metadata Types in a Namespace

The SAS Open Metadata Interface provides the GetTypes method to get all of the metadata types defined in a namespace. The following is an example of a GetTypes request that gets the metadata types that are defined in the SAS namespace of the SAS Metadata Model. The request is formatted for the INMETADATA parameter of the DoRequest method:

<GetTypes>
   <Types/>
   <NS>SAS</NS>
   <Flags/>
   <Options/>
</GetTypes>

The <NS>, <FLAGS>, and <OPTIONS> elements are input parameters. This example does not specify any flags or options. The <TYPES> element is an output parameter. The <TYPES> element lists the metadata types in the specified namespace.

To get all of the metadata types in the SAS Metadata Model, issue the GetTypes method on both the SAS and REPOS namespaces.

The following is an example of the method output. Only the first line of the output is shown:

<Type Id="AbstractExtension" Desc="Abstract Extension" HasSubtypes="1"/>

In the output, note the following:


Using GetSubtypes to Get a Metadata Type's Subtypes

To identify a metadata type's subtypes, use the GetSubtypes method. The following is an example of a GetSubtypes request that lists the subtypes of the AbstractExtension metadata type:

<GetSubtypes>
  <Supertype>AbstractExtension</Supertype>
   <Subtypes/>
   <NS>SAS</NS>
   <Flags>0</Flags>
   <Options/>
</GetSubtypes>

The <SUPERTYPE>, <NS>, <FlAGS>, and <OPTIONS> elements are input parameters. In the request, the <SUPERTYPE> element specifies the AbstractExtension metadata type. The <NS> element specifies the SAS namespace. This example doesn't specify any flags or options. The <SUBTYPES> element is an output parameter.

Here is an example of the output returned by the SAS Metadata Server:

<!-- Using the GETSUBTYPES method. -->

<SubTypes>
 <Type Id="Extension" Desc="Object Extensions" HasSubtypes="0"/>
 <Type Id="NumericExtension" Desc="Numeric Extension" HasSubtypes="0"/>
</SubTypes>

The AbstractExtension metadata type has two subtypes: Extension and NumericExtension. The HasSubtypes= attribute indicates these metadata types do not have any subtypes of their own.

Previous Page | Next Page | Top of Page