1 / 11

Compatibility of XML Language Versions Daniel Dui d.dui@cs.ucl.ac.uk March 2003

Compatibility of XML Language Versions Daniel Dui d.dui@cs.ucl.ac.uk March 2003. What is a language?. Definition. Instance. Schema. <class> <subject> Maths <subject> <teacher> Mr Garrison </teacher> <student> Cartman </student> <student> Kyle </student> <student> Sten </student>

penney
Download Presentation

Compatibility of XML Language Versions Daniel Dui d.dui@cs.ucl.ac.uk March 2003

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Compatibility of XML Language Versions Daniel Dui d.dui@cs.ucl.ac.uk March 2003

  2. What is a language? Definition Instance Schema <class> <subject>Maths<subject> <teacher>Mr Garrison</teacher> <student>Cartman</student> <student>Kyle</student> <student>Sten</student> <student>Kenny</student> </class> <class> <subject>English<subject> <teacher>Mr Garrison</teacher> <assistant>Mr Slave</assistant> <student>Cartman</student> <student>Kyle</student> <student>Sten</student> <student>Kenny</student> </class> Constraints Rule: If the value of element subject is “English” or “French”, then element assistant shall exist.

  3. Evolution • What happens when the language definition changes? • How can compatibility with previous versions of the language be preserved? • What to do when compatibility can not be preserved?

  4. <class> <student>Cartman</student> <student>Kyle</student> <student>Sten</student> <student>Kenny</student> </class> <class> <student>Cartman</student> <student>Kyle</student> <student>Sten</student> <student>Kenny</student> </class> <class> <student>Cartman</student> <teacher>Mr Garrison</teacher> <student>Kyle</student> <student>Sten</student> <student>Kenny</student> </class> <class> <student>Cartman</student> <student>Kyle</student> <student>Sten</student> <student>Kenny</student> </class> <class> <student>Cartman</student> <teacher>Mr Garrison</teacher> <student>Kyle</student> <student>Sten</student> <student>Kenny</student> </class> <class> <teacher>Mr Garrison</teacher> <student>Cartman</student> <student>Kyle</student> <student>Sten</student> <student>Kenny</student> </class> Language compatibility Language B is fully compatible with language A

  5. <class> <student>Cartman</student> <student>Kyle</student> <student>Sten</student> <student>Kenny</student> </class> <class> <student>Cartman</student> <student>Kyle</student> <student>Sten</student> <student>Kenny</student> </class> <class> <student>Cartman</student> <teacher>Mr Garrison</teacher> <student>Kyle</student> <student>Sten</student> <student>Kenny</student> </class> <class> <student>Cartman</student> <student>Kyle</student> <student>Sten</student> <student>Kenny</student> </class> <class> <student>Cartman</student> <teacher>Mr Garrison</teacher> <student>Kyle</student> <student>Sten</student> <student>Kenny</student> </class> <class> <teacher>Mr Garrison</teacher> <student>Cartman</student> <student>Kyle</student> <student>Sten</student> <student>Kenny</student> </class> Incompatible languages Language B is incompatible with language A

  6. Transformations <class> <teacher>unknown</teacher> <student>Cartman</student> <student>Kyle</student> <student>Sten</student> <student>Kenny</student> </class> <class> <student>Cartman</student> <student>Kyle</student> <student>Sten</student> <student>Kenny</student> </class>

  7. Partially compatible languages

  8. Checking compatibility • Schema languages are context free grammars. • Containment and intersection are undecidable operations. But… • There are heuristic compatibility rules for many (most?) practical situations.

  9. Compatibility rules <xsd:element name="class"> <xsd:complextype> <xsd:sequence> <xsd:element name="teacher" type="xsd:string" minOccurs="1" maxOccurs="1" /> <xsd:element name="student" type="xsd:string" minOccurs="1" maxOccurs="unbounded" /> </xsd:sequence> </xsd:complextype> </xsd:element> <xsd:element name="class"> <xsd:complextype> <xsd:sequence> <xsd:element name="teacher" type="xsd:string" minOccurs="0" maxOccurs="1" /> <xsd:element name="student" type="xsd:string" minOccurs="1" maxOccurs="unbounded" /> </xsd:sequence> </xsd:complextype> </xsd:element> <forall var="a" in="/Schema_A//element"> <forall var="b" in="/Schema_B//element"> <implies> <equals op1="$a/@name" op2="$b/@name" /> <and> <equals op1="$a/@type" op2="$b/@type" /> <and> <lessThanOrEq op1="$b/@minOccurs" op2="$a/@minOccurs" /> <greaterThanOrEq op1="$b/@maxOccurs" op2="$a/@maxOccurs" /> </and> </and> </implies> </forall> </forall>

  10. Constraint compatibility Rule A: If the value of element subject is “English” or “French”, then element assistant shall exist. <forall var=”a” in=“//class”> <implies> <or> <equals op1=“$a/subject/text()” op2=“’English’” /> <equals op1=“$a/subject/text()” op2=“’French’” /> </or> <exists var=“b” in=“$a/assistant” /> <implies> <forall> Rule B: If the value of element subject is “English”, then element assistant shall exist. <forall var=”a” in=“//class”> <implies> <equals op1=“$a/subject/text()” op2=“’English’” /> <exists var=“b” in=“$a/assistant” /> <implies> <forall> Compatibility: If second child of implies in Rule A and second child of implies in Rule B are the same, then the first child of implies in Rule A shall be stronger than the first child or implies in Rule B. <implies> <equal op1="$a/child::*[position()=2]“ op2="$b/child::*[position()=2]"> <stronger op1="$a/child::*[position()=1]“ op2="$b/child::*[position()=1]"> </implies>

  11. Coming next Imminent • Schema compatibility rules Next • Constraint compatibility rules Later on • Transformations

More Related