[Rets-dev] More about schema overrides

Jeff Brush jeffbrush at hotmail.com
Sun Apr 29 12:06:46 CDT 2007


Matt, Doesn't allowing anything into a field/element cause "a whole new level of complexity for consuming clients" anyway? Unless your MLS is the only MLS the client communicates with, the client code is going to have to code around possibly having a "Huge" area value anyway.The original intent behind the extensibility of the proposed payload formats is NOT to override element types, but to create new elements in their own namespace that provide their own semantics. "Huge" is either a description, if it is free form, or a category, if it is an ordered, enumerated type, and in either case, deserves its own element. It would not map to '<TotalArea>'. The biggest re-occurring stumbling blocks RETS has had over its lifetime is its inability to agree on standardized names and types. Stonewalling by a vocal minority has prevented RETS from setting a true data standard, which can at least be used as a goal. If your data fields are so completely different from the data elements in the 'standard payload', RETS2 encourages an MLS or group of MLSs to extent the defined schemas with new elements, create their own XML schemas or even develop totally new types of data payloads. Perhaps there needs to be goal of trying to satisfy 80-95% of the data requirements of the community instead of unobtainable perfection.  Jeffery A. BrushRonin Technologies, Inc. "I saw it with my own eyes, and heard it with my own ears, and part of it fell on my head!" - Chicken Little 


From: matt at pmptechnology.comTo: Rets-dev at rets.orgDate: Sat, 28 Apr 2007 17:10:46 -0500CC: Subject: [Rets-dev] More about schema overrides






I want to clarify my earlier statement as to why I don’t like local schemas.
 
First, consider that we will have a pseudo-definitive RETS2 schema that makes strict type assertions such as:
 
<xs:complexType name="Area">
       <xs:simpleContent>
              <xs:extension base="xs:decimal">
                     <xs:attribute ref="commons:areaUnits" use="optional"/>
              </xs:extension>
       </xs:simpleContent>
</xs:complexType>
 
This enforces that the data held in an element using the type “Area” must be an 18-digit number with an arbitrary decimal point (i.e., numeric), and may optionally be labeled with areaUnits.
 
Now, my MLS has dirty data in an element that maps to this type (BuildingArea).  In order to properly validate, my MLS would create their own schema that redefines the type.  Note that there are a couple of ways to do this,  but I’m going to use the cleanest method:
 
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
       <xs:complexType name="MLSNIArea">
              <xs:simpleContent>
                     <xs:extension base="xs:string" />
              </xs:simpleContent>
       </xs:complexType>
</xs:schema>
 
Now, in their payload, they will need to include that local schema and declare the namespace for the element’s type (again, I’m using what I consider to be the cleanest method to do this):
 
<?xml version="1.0"?>
<rets2 xmlns="http://www.ftc2.com/xsd/RETSCommons/2007-04"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://www.mlsni.com/xsd/RETS2
http://www.mlsni.com/xsd/RETS2.xsd">
 
       <Properties>
       <Property>
                     <TotalArea xsi:type="mlsni:MLSNIArea">HUGE</TotalArea>
              </Property>
       </Properties>
</rets2>
 
… and, voila, their payload now validates!
 
But what really happened is that I dissolved the standard and created a whole new level of complexity for consuming clients.  Note that the “TotalArea” element is no longer what was defined by the spec.  In result, we may as well say that every field is arbitrary anyway, since a consuming client can’t trust the core RETS2 schema… and that’s the part that I really don’t like.  They could just as easily add:
 
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
       <xs:complexType name="MLSNIArea">
              <xs:sequence>
                     <xs:element name="personWhoMeasured" base="xs:string" />
                     <xs:element name="dateMeasured" base="xs:date" use="optional" />
                     <xs:element name="areavalue" base="xs:integer" />
                     <xs:element name="areaunits" base="xs:string" />
              </xs:sequence>
       </xs:complexType>
</xs:schema>
 
… at which point we can’t rely on the RETS2 spec at all.
 
Alternatively, the even worse form of override would be to redeclare the element itself (say MLSNITotalArea), in which case the client wouldn’t even know what field to look for without a roadmap and compass.  The document would still validate, but would be well outside the intention of RETS2.
 
With 54 current schemas and a seemingly infinite number of local types declared in the spec, it would be a herculean task to get a client working reasonably with even 5 MLSes that had local data anomalies, mapping hundreds of types to a unified set.
 
Painless: strict vs. loose
Instead, by allowing a “loose” schema that does not specify types and a “strict” schema that does, we would allow the consuming client (even if it’s another MLS) to always know and trust the structure.  Moreover, a locally-declared schema, should an ambitious MLS take the initiative, would be a “type hinting” bonus rather than an implementation hindrance.  I also think it’d be a great idea for us to include a “MUST” format for how such local schema should be included, what they can redefine, etc… particularly as it pertains to the security model.
 
Moreover, and quite possibly most importantly, the adoption of RETS2 would be a painless exercise.  Instead of having to break out giant datatype maps and spend precious man-hours trying to fit a square peg into a round hole, they could simply map local MLS fields to the RETS2 (i.e., true standard) fields and have an interface up inside of a week… while consuming clients can keep their existing data definitions intact.  All the while, the spec would provide guidance to the MLSes (and vendors) that the RETS2-strict format is the ideal.
 
-Matt
 




PMPTechnology.com

Matt LavalleeManager of Web Servicesphone: 630-598-2301 fax: 630-982-6641
 
 
_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rets.org/pipermail/rets-dev/attachments/20070429/3ebb6197/attachment.html


More information about the Rets-dev mailing list