OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

obix message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Comment on PR01 Schemas: oBIX Schemas and backward incompatibilty


We seem to have radically redefined the effects of the schema for oBIX in that we have radically simplified the required fields. This may be good or bad: I merely assert that it is.

 

For this letter I used ALTOVA XML Spy, latest version. Notice that for all URI.s, this tool always generates a link to the company…

 

If I generate a legal OP from the oBIX 1.0 Schema, I generate the following artifact:

 

<?xml version="1.0" encoding="UTF-8"?>

<!--Sample XML file generated of an OP based on Schema 1.0)-->

<op display="String" displayName="String" href="http://www.altova.com" icon="http://www.altova.com" is="http://www.altova.com" name="NMTOKEN" null="true" status="ok" writable="false" in="obix:Nil" out="obix:Nil" xsi:schemaLocation="http://obix.org/ns/schema/1.0 obix%201.0.xsd" xmlns="http://obix.org/ns/schema/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

            <obj display="String" displayName="String" href="http://www.altova.com" icon="http://www.altova.com" is="http://www.altova.com" name="NMTOKEN" null="true" status="ok" writable="false">

                        <enum display="String" displayName="String" href="http://www.altova.com" icon="http://www.altova.com" is="http://www.altova.com" name="NMTOKEN" null="true" status="ok" writable="false" range="http://www.altova.com" val="NMTOKEN">

                                    <reltime display="String" displayName="String" href="http://www.altova.com" icon="http://www.altova.com" is="http://www.altova.com" name="NMTOKEN" null="true" status="ok" writable="false" min="P1Y2M3DT10H30M" max="P1Y2M3DT10H30M" val="PT0S">

                                                <uri display="String" displayName="String" href="http://www.altova.com" icon="http://www.altova.com" is="http://www.altova.com" name="NMTOKEN" null="true" status="ok" writable="false" val="http://www.altova.com">

                                                            <int display="String" displayName="String" href="http://www.altova.com" icon="http://www.altova.com" is="http://www.altova.com" name="NMTOKEN" null="true" status="ok" writable="false" min="0" max="0" unit="http://www.altova.com" val="0">

                                                                        <bool display="String" displayName="String" href="http://www.altova.com" icon="http://www.altova.com" is="http://www.altova.com" name="NMTOKEN" null="true" status="ok" writable="false" range="http://www.altova.com" val="false">

                                                                                    <str display="String" displayName="String" href="http://www.altova.com" icon="http://www.altova.com" is="http://www.altova.com" name="NMTOKEN" null="true" status="ok" writable="false" min="0" max="0" val="">

                                                                                                <abstime display="String" displayName="String" href="http://www.altova.com" icon="http://www.altova.com" is="http://www.altova.com" name="NMTOKEN" null="true" status="ok" writable="false" min="2001-12-17T09:30:47Z" max="2001-12-17T09:30:47Z" val="2001-12-17T09:30:47Z">

                                                                                                            <real display="String" displayName="String" href="http://www.altova.com" icon="http://www.altova.com" is="http://www.altova.com" name="NMTOKEN" null="true" status="ok" writable="false" min="3.14159265358979E0" max="3.14159265358979E0" precision="0" unit="http://www.altova.com" val="0">

                                                                                                                        <list display="String" displayName="String" href="http://www.altova.com" icon="http://www.altova.com" is="http://www.altova.com" name="NMTOKEN" null="true" status="ok" writable="false" min="0" max="0" of="obix:obj">

                                                                                                                                    <feed display="String" displayName="String" href="http://www.altova.com" icon="http://www.altova.com" is="http://www.altova.com" name="NMTOKEN" null="true" status="ok" writable="false" in="obix:Nil" of="obix:obj"/>

                                                                                                                        </list>

                                                                                                            </real>

                                                                                                </abstime>

                                                                                    </str>

                                                                        </bool>

                                                            </int>

                                                </uri>

                                    </reltime>

                        </enum>

            </obj>

</op>

 

If I use the new Schemas, those in the current public review, I generate the following:

 

<?xml version="1.0" encoding="UTF-8"?>

<!--Sample XML file generated by XMLSpy v2013 sp1 based on Schema in PR01-->

<obix:op in="String" out="String" name="String" href="String" is="String" null="true" displayName="String" display="String" icon="http://www.altova.com" precision="0" status="ok" unit="String" writable="true" xsi:schemaLocation="http://obix.org/ns/schema/1.1 obix-v1.1-wd13.xsd" xmlns:obix="http://obix.org/ns/schema/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>

 

This is quite different. In part this is because the current schema often uses strings rather than URIS.  1.0, though, has almost no subtyping, or referencing, each of which desirable for tooling. If I go back to 1.0, and make the following changes:

 

1)      Use NIEM rules for naming types and references, i.e. foo is of type FooType. Current schema uses the pattern foo is of type Foo which is confusing

2)      Define all attribute types before use

<!-- 9.0 Attribute Primitives     ===================== -->

                        <xs:attribute name="display" type="DisplayType"/>

                        <xs:simpleType name="DisplayType">

                                    <xs:restriction base="xs:string" />

                        </xs:simpleType>

                        <xs:attribute name="displayName" type="DisplayNameType"/>

                        <xs:simpleType name="DisplayNameType">

                                    <xs:restriction base="xs:string" />

                        </xs:simpleType>

                        <xs:attribute name="href" type="HrefType"/>

                        <xs:simpleType name="HrefType">

                                    <xs:restriction base="xs:anyURI" />

                        </xs:simpleType>

                        <xs:attribute name="icon" type="IconType"/>

                        <xs:simpleType name="IconType">

                                    <xs:restriction base="xs:anyURI" />

                        </xs:simpleType>

                        <xs:attribute name="name" type="NameType"/>

                        <xs:simpleType name="NameType">

                                    <xs:restriction base="xs:NMTOKEN" />

                        </xs:simpleType>

                        <xs:attribute name="null" type="NullType"/>

                        <xs:simpleType name="NullType">

                                    <xs:restriction base="xs:boolean" />

                        </xs:simpleType>

                        <xs:attribute name="writable" type="WritableType" default="false"/>

                        <xs:simpleType name="WritableType">

                                    <xs:restriction base="xs:boolean"/>

 

                        </xs:simpleType>

 

3)      Contract Type is currently defined as a collection of anyURIs. Is is really a collection of oBIX HREFs?

4)      Global element err redefines Err[Type] rather than using type Err[Type]

5)      Add Unit (anyURI) to list of Global Attributes

6)      As currently defined, err is an instance of type Err which is identical to the Obj type. The object ref is an instance of ObjectType. Suggest making usage consistent between two types, I,e., Make each an instance of type obj or, preferred, make a type for each

7)      Make precision a global attribute

 

I get a schema that was used to generate the following artifact:

 

<?xml version="1.0" encoding="UTF-8"?>

<!--Sample XML file generated of an OP based on normalized Schema 1.0)-->

<op n1:display="String" n1:displayName="String" n1:href="http://www.altova.com" n1:icon="http://www.altova.com" n1:is="http://www.altova.com" n1:name="NMTOKEN" n1:null="true" n1:status="ok" n1:writable="false" n1:in="obix:Nil" n1:out="obix:Nil" xsi:schemaLocation="http://docs.oasis-open.org/obix/ns/2013 obix-tc.xsd" xmlns="http://docs.oasis-open.org/obix/ns/2013" xmlns:n1="http://docs.oasis-open.org/obix/ns/2013" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

            <obj n1:display="String" n1:displayName="String" n1:href="http://www.altova.com" n1:icon="http://www.altova.com" n1:is="http://www.altova.com" n1:name="NMTOKEN" n1:null="true" n1:status="ok" n1:writable="false">

                        <enum n1:display="String" n1:displayName="String" n1:href="http://www.altova.com" n1:icon="http://www.altova.com" n1:is="http://www.altova.com" n1:name="NMTOKEN" n1:null="true" n1:status="ok" n1:writable="false" n1:range="http://www.altova.com" val="NMTOKEN">

                                    <reltime n1:display="String" n1:displayName="String" n1:href="http://www.altova.com" n1:icon="http://www.altova.com" n1:is="http://www.altova.com" n1:name="NMTOKEN" n1:null="true" n1:status="ok" n1:writable="false" min="P1Y2M3DT10H30M" max="P1Y2M3DT10H30M" val="PT0S">

                                                <uri n1:display="String" n1:displayName="String" n1:href="http://www.altova.com" n1:icon="http://www.altova.com" n1:is="http://www.altova.com" n1:name="NMTOKEN" n1:null="true" n1:status="ok" n1:writable="false" val="http://www.altova.com">

                                                            <int n1:display="String" n1:displayName="String" n1:href="http://www.altova.com" n1:icon="http://www.altova.com" n1:is="http://www.altova.com" n1:name="NMTOKEN" n1:null="true" n1:status="ok" n1:writable="false" min="0" max="0" n1:unit="http://www.altova.com" val="0">

                                                                        <bool n1:display="String" n1:displayName="String" n1:href="http://www.altova.com" n1:icon="http://www.altova.com" n1:is="http://www.altova.com" n1:name="NMTOKEN" n1:null="true" n1:status="ok" n1:writable="false" n1:range="http://www.altova.com" val="false">

                                                                                    <str n1:display="String" n1:displayName="String" n1:href="http://www.altova.com" n1:icon="http://www.altova.com" n1:is="http://www.altova.com" n1:name="NMTOKEN" n1:null="true" n1:status="ok" n1:writable="false" min="0" max="0" val="">

                                                                                                <abstime n1:display="String" n1:displayName="String" n1:href="http://www.altova.com" n1:icon="http://www.altova.com" n1:is="http://www.altova.com" n1:name="NMTOKEN" n1:null="true" n1:status="ok" n1:writable="false" min="2001-12-17T09:30:47Z" max="2001-12-17T09:30:47Z" val="2001-12-17T09:30:47Z">

                                                                                                            <real n1:display="String" n1:displayName="String" n1:href="http://www.altova.com" n1:icon="http://www.altova.com" n1:is="http://www.altova.com" n1:name="NMTOKEN" n1:null="true" n1:status="ok" n1:writable="false" min="3.14159265358979E0" max="3.14159265358979E0" n1:precision="0" n1:unit="http://www.altova.com" val="0">

                                                                                                                        <list n1:display="String" n1:displayName="String" n1:href="http://www.altova.com" n1:icon="http://www.altova.com" n1:is="http://www.altova.com" n1:name="NMTOKEN" n1:null="true" n1:status="ok" n1:writable="false" min="0" max="0" n1:of="obix:obj">

                                                                                                                                    <feed n1:display="String" n1:displayName="String" n1:href="http://www.altova.com" n1:icon="http://www.altova.com" n1:is="http://www.altova.com" n1:name="NMTOKEN" n1:null="true" n1:status="ok" n1:writable="false" n1:in="obix:Nil" n1:of="obix:obj">

                                                                                                                                                <err n1:display="String" n1:displayName="String" n1:href="http://www.altova.com" n1:icon="http://www.altova.com" n1:is="http://www.altova.com" n1:name="NMTOKEN" n1:null="true" n1:status="ok" n1:writable="false"/>

                                                                                                                                    </feed>

                                                                                                                        </list>

                                                                                                            </real>

                                                                                                </abstime>

                                                                                    </str>

                                                                        </bool>

                                                            </int>

                                                </uri>

                                    </reltime>

                        </enum>

            </obj>

</op>

 

 

So I tried to normalize the PR01 schemas, using the same comments as for 1.0:

 

Some issues:

1)      Obix:REAL is missing Max and Min

2)      “of” and “in” are strings rather than contracts

3)      In 1/0. “bool” has a range. In PR01, it does not. I think 1.1 PR01 is correct.

4)      AbsTime “val” should be "xs:dateTime"

5)      RelTime val, min, max should all be of type duration (missing Val)

6)      Add “Type” to all types

 

This now generates sample XML as follows

 

<?xml version="1.0" encoding="UTF-8"?>

<!--Sample XML file generated by normalized PR01 TC-->

<obix:op in="String" out="String" obix:name="NMTOKEN" obix:href="http://www.altova.com" obix:is="http://www.altova.com" obix:null="true" obix:displayName="String" obix:display="String" obix:icon="http://www.altova.com" obix:precision="0" obix:status="ok" obix:unit="http://www.altova.com" obix:writable="false" xsi:schemaLocation="http://docs.oasis-open.org/obix/ns/2013 obix-v1.1-pr01%20TC.xsd" xmlns:obix="http://docs.oasis-open.org/obix/ns/2013" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>

 

Which maintains the new look, but is better typed (see URIs)

 

Sample Schemas and examples can be found at:

 

https://www.oasis-open.org/apps/org/workgroup/obix/download.php/50223/Notes%20to%20options%20on%20Schemas.docx

 

tc

 

 

 


"Energy and persistence conquer all things." -- Benjamin Franklin


Toby Considine
TC9, Inc

OASIS TC Chair: oBIX & WS-Calendar

OASIS TC Editor: EMIX, Energy Interoperation

SGIP Smart Grid Architecture Committee

  

Email: Toby.Considine@gmail.com
Phone: (919)619-2104

http://www.tcnine.com
blog: http://www.NewDaedalus.com

 



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]