Using W3's XML Schema to define an XML language for defining a beamine, one would use:

  • xsd:element to define new elements
  • xsd:attribute to define attributes of the elements one created

eg, One might then define what a valid <xcor> element is using XML Schema as:

<xsd:element name="xcor">
  <xsd:complexType>
     <xsd:attribute name="bdes" type="xsd:float"/>
     <xsd:attribute name="z" type="xsd:float"/>
     <xsd:attribute name="name" type="xsd:string"/>
  </xsd:complexType>
</xsd:element>

We have define an xsd:element named "xcor" and said that such elements have 3 attributes. The "name" attribute must be a string and the "bdes" and "z" attributes are of type float.

A valid instance of the above schema would then be, eg:

<xcor name="xcor:lc03:42" bdes=14.3 z=324.45/>

To include the relationship of this xcor to other magnets (which "class" of magnet is it?), and to SLC timing modes ("mode"), we would probably define an xcor to be an element with child elements (and attributes).

<xsd:element name="xcor">
  <xsd:complexType>
     <xsd:attribute name="bdes" type="xsd:float"/>
     <xsd:attribute name="z" type="xsd:float"/>
     <xsd:attribute name="name" type="xsd:string"/>
     <xsd:sequence>
        <xsd:element name="class" type="xsd:string"
          minOccurs=1 maxOccurs=3>
        <xsd:element name="mode" type="xsd:int"
          minOccurs=1 maxOccrus=20>
     </xsd:sequence>
  </xsd:complexType>
</xsd:element>

An valid instance of that would be:

<xcor name="xcor:lc03:42" bdes=14.3 z=324.45>
  <class>dipole</class>
  <class>corrector</class>
  <mode>1</mode> <!-- slc e- -->
  <mode>2</mode> <!-- slc e+ -->
  <mode>7</mode> <!-- pep2 her -->
</xcor>

So,

  • It's not that simple, but it's also not that hard.
  • BUT: even using XML Schema doesn't solve the problem of the semantic interpretation of elements. For instance, what do "class" and "mode" really mean? Only someone familiar with the SLC controls system knows that "mode" is a word we often use for a collection of timing configurations, and in fact this use of the word "mode" is one of many instances of its use in SLC/PEPII. To disambiguate "mode", that is to describe its use, and what is meant by "class" in this case, and so on, one would need RDF.
  • No labels

1 Comment

  1. Unknown User (chevtsov)

    "even using XML Schema doesn't solve the problem of the semantic interpretation of elements"
    Makes sense (smile)
    Still, it would be nice to illustrate how RDF would handle this task.