← Prev in month
← Prev in thread
B2MML schemas and definition of Equipment Classes
Dear all,
I am not so experienced with xml schemas but I am dealing with representation of industrial data using xml and I am tryong to use the B2mml xml schemas provided by the wbf (www.wbf.org).
In particular I want to represent data for equipment. B2MML provides the Equipment.xsd schema:
A first option could be using the EquipmentType with the EquipmentPropertyType to add the two properties.
Hence:
An idea is using the EquipmentClassType:
However I experienced some problem.
I am not allowed to put the <Equipment> and the <EquipmentClass> in the same xml file, hence I am not able to verify consistence of data given some specification on the different Equipment Classes.
Is there another way to reach the same objective? As an example, could be possible to derive a new schema from the EquipmentClassType to define an "GrindingMachineType"?
How can I do this restricting the number and type of properties that should be considered? It is a complexType and I was not able to use xsd:restriction.
Marcello
I am not so experienced with xml schemas but I am dealing with representation of industrial data using xml and I am tryong to use the B2mml xml schemas provided by the wbf (www.wbf.org).
In particular I want to represent data for equipment. B2MML provides the Equipment.xsd schema:
- <xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.wbf.org/xml/b2mml-v0400"
xmlns:Extended="http://www.wbf.org/xml/b2mml-v0400-extensions"
targetNamespace="http://www.wbf.org/xml/b2mml-v0400"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
- <!-- Include the Common schema -->
- <xsd:include schemaLocation="B2MML-v0400-Common.xsd"/>
- <!-- Import the Extension Schema -->
- <xsd:import namespace="http://www.wbf.org/xml/b2mml-v0400-extensions" schemaLocation="B2MML-v0400-Extensions.xsd"/>
- ...
- <!-- Elements -->
- ...
- <xsd:element name="Equipment" type="EquipmentType"/>
- <xsd:element name="EquipmentClass" type="EquipmentClassType"/>
- ....
- <xsd:complexType name="EquipmentType">
- <xsd:sequence>
- <xsd:element name="ID" type="IdentifierType"/>
- <xsd:element name="Description" type="DescriptionType" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="EquipmentProperty" type="EquipmentPropertyType" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="Equipment" type="EquipmentType" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="EquipmentClassID" type="EquipmentClassIDType" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="MaintenanceRequestID" type="MaintenanceRequestIDType" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="MaintenanceWorkOrderID" type="MaintenanceWorkOrderIDType" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="Location" type="LocationType" minOccurs="0"/>
- ...
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="EquipmentClassType">
- <xsd:sequence>
- <xsd:element name="ID" type="IdentifierType"/>
- <xsd:element name="Description" type="DescriptionType" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="EquipmentClassProperty" type="EquipmentClassPropertyType" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="EquipmentID" type="EquipmentIDType" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:group ref="Extended:EquipmentClass" minOccurs="0"/>
- ...
- </xsd:sequence>
- </xsd:complexType>
- <!-- Include the Common schema -->
A first option could be using the EquipmentType with the EquipmentPropertyType to add the two properties.
Hence:
- <Equipment
xmlns="http://www.wbf.org/xml/b2mml-v0400"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.wbf.org/xml/b2mml-v0400
B2MML-V0400-Equipment.xsd">
- <ID>GM</ID>
- <Description>Grinding Machine</Description>
- <EquipmentProperty>
- <ID>1</ID>
- <Description>Power</Description>
- <Value>
- <ValueString>Power</ValueString>
- <DataType>int</DataType>
- <UnitOfMeasure>Watt</UnitOfMeasure>
- </Value>
- </EquipmentProperty>
- <EquipmentProperty>
- <ID>2</ID>
- <Description>Length</Description>
- <Value>
- <ValueString>Length</ValueString>
- <DataType>int</DataType>
- <UnitOfMeasure>meter</UnitOfMeasure>
- </Value>
- </EquipmentProperty>
- </Equipment>
- <ID>GM</ID>
An idea is using the EquipmentClassType:
- <EquipmentClass
xmlns="http://www.wbf.org/xml/b2mml-v0400"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.wbf.org/xml/b2mml-v0400
B2MML-V0400-Equipment.xsd">
- <ID>GM</ID>
- <Description>Grinding Machine</Description>
- <EquipmentClassProperty>
- <ID>1</ID>
- <Description>Power</Description>
- <Value>
- <ValueString>Power</ValueString>
- <DataType>int</DataType>
- <UnitOfMeasure>Watt</UnitOfMeasure>
- </Value>
- </EquipmentClassProperty>
- <EquipmentClassProperty>
- <ID>2</ID>
- <Description>Length</Description>
- <Value>
- <ValueString>Length</ValueString>
- <DataType>int</DataType>
- <UnitOfMeasure>meter</UnitOfMeasure>
- </Value>
- </EquipmentClassProperty>
- </EquipmentClass>
- <ID>GM</ID>
- <Equipment
xmlns="http://www.wbf.org/xml/b2mml-v0400"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.wbf.org/xml/b2mml-v0400
B2MML-V0400-Equipment.xsd">
- <ID>GM1</ID>
- <Description>Grinding Machine 1</Description>
- <EquipmentClassID>GM</EquipmentClassID>
- </Equipment>
- <ID>GM1</ID>
However I experienced some problem.
I am not allowed to put the <Equipment> and the <EquipmentClass> in the same xml file, hence I am not able to verify consistence of data given some specification on the different Equipment Classes.
Is there another way to reach the same objective? As an example, could be possible to derive a new schema from the EquipmentClassType to define an "GrindingMachineType"?
How can I do this restricting the number and type of properties that should be considered? It is a complexType and I was not able to use xsd:restriction.
- <xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.wbf.org/xml/b2mml-v0400"
xmlns:Extended="http://www.wbf.org/xml/b2mml-v0400-extensions"
targetNamespace="http://www.wbf.org/xml/b2mml-v0400"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
- <xsd:element name="GrindingMachineClass" type="GrindingMachineClassType"/>
- <xsd:complexType name="GrindingMachineClassType">
- <xsd:restriction base="EquipmentClassType">
- ...
- </xsd:restriction>
- </xsd:complexType>
- </xsd:schema>
Marcello
← Prev in month
← Prev in thread