petervizi/python-eeml

XSD schema validaton for "id" breaks Cosm compatibility

Closed this issue · 5 comments

Cosm currently does not enforce "id" to be nonNegativeInteger (per EEML 0.5.1) so commit c75e280 breaks previous Datastreams with String identifiers. Those can't be updated any longer.

Hi Jose,

I'm assuming you are referring to the id of the data element - environment also has a non negative although optional id -, and what I see is type="xsd:nonNegativeInteger" and use="required" in line 132 of the schema. Can you please double check?

Thanks

That's right. It's the id of the Data element.

I used to use:
pac.update([eeml.Data("Power", power,
unit=eeml.Unit('Watt','derivedSI','W')),
eeml.Data("PowerApparent", powerapparent,
unit=eeml.Unit('VoltAmpere','derivedSI','VA')),
eeml.Data("PowerAccumulated", poweracc,
unit=eeml.Unit('WattHour','derivedSI','kWh')),
eeml.Data("Current", current,
unit=eeml.Unit('Ampere','basicSI','mA')),
eeml.Data("Voltage", voltage,
unit=eeml.Unit('Volt','derivedSI','V')),
eeml.Data("PowerFactor", powerfactor)])

<current_value>532.78</current_value>Watt<current_value>716.33</current_value>VoltAmpere<current_value>467.27</current_value>WattHour<current_value>3182.36</current_value>Ampere<current_value>225.09</current_value>Volt<current_value>0.74</current_value>

But now I need to use:
pac.update([eeml.Data(0, power,
unit=eeml.Unit('Watt','derivedSI','W')),
eeml.Data(1, powerapparent,
unit=eeml.Unit('VoltAmpere','derivedSI','VA')),
eeml.Data(2, poweracc,
unit=eeml.Unit('WattHour','derivedSI','kWh')),
eeml.Data(3, current,
unit=eeml.Unit('Ampere','basicSI','mA')),
eeml.Data(4, voltage,
unit=eeml.Unit('Volt','derivedSI','V')),
eeml.Data(5, powerfactor)])

<current_value>532.78</current_value>Watt<current_value>716.33</current_value>VoltAmpere<current_value>467.27</current_value>WattHour<current_value>3182.36</current_value>Ampere<current_value>225.09</current_value>Volt<current_value>0.74</current_value>

J+

On Thu, Jan 31, 2013 at 12:06 PM, Peter Vizi notifications@github.comwrote:

Hi Jose,

I'm assuming you are referring to the id of the data element - environment
also has a non negative although optional id -, and what I see is
type="xsd:nonNegativeInteger" and use="required" in line 132 of the
schema. Can you please double check?

Thanks


Reply to this email directly or view it on GitHubhttps://github.com//issues/24#issuecomment-12946423.

So do we agree that prior to version 4.0.0 the generated xml wasn't valid eeml? If so I'll close this ticket.

Yes, I agree that it wasn't a valid eeml. However I suggest to add some
mechanism to allow these non-valid eeml in order to be able to still
communicate with Cosm :)

J+

On Thu, Jan 31, 2013 at 1:49 PM, Peter Vizi notifications@github.comwrote:

So do we agree that prior to version 4.0.0 the generated xml wasn't valid
eeml? If so I'll close this ticket.


Reply to this email directly or view it on GitHubhttps://github.com//issues/24#issuecomment-12952026.

Sorry for the slow turnaround. Can you give the Invalidator a try to see if it fits your use case?