The Xpetal -xsd option generates a W3C XML schema based on an RDF schema, generally the EPRI CIM RDF schema.
The XML schema produced does not reflect all of the structure in the input (CIM). It provides type and element definitions intended as building blocks for messages. In other words, the generated schema is not intended to stand alone but would normally be imported into various message schema.
A command line using the -xsd option has the following form:
java -Xmx100M -jar Xpetal-20010921a.jar -xsd xyz.rdf xyz.xsd
Note that the -Xmx option may be needed to allow enough memory.
The generated CIM/XSD schema is intended to be imported into a message schema. A sample message schema, message-model-01.xsd can be examined to see one approach. Here are the main steps in writing a message schema:
Declare both a cim and a message namespace in the top element. Make the
message namespace the target of the schema:
<xsd:schema targetNamespace="http://iec.ch/TC57/2001/message-model-01" xmlns:cim="http://iec.ch/TC57/2001/CIM-schema-cim10" xmlns:msg="http://iec.ch/TC57/2001/message-model-01" ....
Import (rather than include) the cim schema. You need to quote the cim namespace again here and the URL of the actual schema document:
<xsd:import namespace="http://iec.ch/TC57/2001/CIM-schema-cim10" schemaLocation="cim10_010825c.xsd"/>
A message will be defined as a complexType. Its constituent elements don't
all come from the CIM. Those that do, are defined as follows:
To define a message element that refers to a CIM class use this form:
<xsd:element name="locationOfWork" type="cim:Substation"/>
To define a message element that corresponds to a cim association, (ie
reuse a cim association in a message) use this form:
<xsd:element ref="cim:Substation.MemberOf_SubControlArea"/>