Previous Page | Next Page

Metadata Access (IOMI Interface)

Constructing a Metadata Property String

To read or write a metadata object, you must pass a string of properties that describe the object to the SAS Metadata Server. This property string is passed to the server in the INMETADATA parameter of the method call.

A metadata object is described by the following:

The SAS Open Metadata Interface supports the following XML elements for defining a metadata property string:

metadata type

identifies the metadata type that you want to read or write, enclosed in angle brackets. The following example shows the XML element representing the PhysicalTable metadata type:

<PhysicalTable></PhysicalTable>
A shorthand method of specifying this XML element is as follows:
<PhysicalTable/>
metadata type attributes

specifies the attributes of the metadata type as XML attributes (enclosed in the angle brackets of the metadata type). The following example shows the PhysicalTable metadata type with "NE Sales" as the Name= attribute.

<PhysicalTable Name="NE Sales"/>
association name and associated metadata type subelements

describe the relationship between the metadata object in the main XML element and one or more other metadata types as nested XML elements. For example:

<PhysicalTable Name="NE Sales"/>
   <Columns>
      <Column/>
   </Columns>
</PhysicalTable>

In this example, the first nested element, Columns, is the association name. The association name is a label that describes the relationship between the main XML element and the subelement. The SAS Metadata Model defines the association names that are supported for every metadata type.

The second nested element, Column, is the association subelement. The association subelement specifies the associated metadata type that you are interested in. The Columns association name supports associated objects of the metadata types Column and ColumnRange. By specifying Column in the property string, you indicate to the SAS Metadata Server that you are only interested in associated objects of this metadata type.

All in all, the nested elements in the example specify that the main metadata object, PhysicalTable, has a Columns association to an object of metadata type Column.

CAUTION:
To meet XML parsing rules, the metadata type, attribute, association, and associated metadata type names that you specify in the metadata property string must exactly match those published in the metadata type documentation.   [cautionend]

Quotation Marks and Special Characters

The metadata property string is passed as a string literal (a quoted string) in most programming environments. To ensure that the string is parsed correctly, it is recommended that any additional double quotation marks, such as those enclosing XML attribute values in the metadata property string, be marked to indicate that they should be treated as characters. Here are examples of using escape characters in different programming environments to mark the additional double quotation marks:

Java

"<PhysicalTable Id=\"123\" Name=\"TestTable\" />"
Visual Basic

"<PhysicalTable Id=""123"" Name=""TestTable"" />"
Visual C++

"<PhysicalTable Id=\"123\" Name=\"TestTable\" />"
SAS

"<PhysicalTable Id=""123"" Name=""TestTable"" />"
"<PhysicalTable Id='123' Name='TestTable' />"
'<PhysicalTable Id="123" Name="TestTable"/>'

Special characters that are used in XML syntax are specified as follows:

< = &lt;

> = &gt;

& = &amp;

Previous Page | Next Page | Top of Page