1 / 24

XML Schema Design Quality Testing using Expert System

Thesis Presentation. XML Schema Design Quality Testing using Expert System. December 14, 2005 Daehong, Kim. Contents. Introduction XML schema design quality testing Rule-based expert system Framework Rule encoding Fact transformation Prototype & Live demo Conclusion. Example1.xml.

jun
Download Presentation

XML Schema Design Quality Testing using Expert System

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. Thesis Presentation XML Schema Design Quality Testingusing Expert System December 14, 2005 Daehong, Kim

  2. Contents • Introduction • XML schema design quality testing • Rule-based expert system • Framework • Rule encoding • Fact transformation • Prototype & Live demo • Conclusion

  3. Example1.xml Example1.txt Laboratory.xsd <Unv>POSTECH <Dep>IME <Lab>ISL</Lab> </Dep> </Unv> POSTECH IME ISL <element name=“Unv”> <complexType> <element name=“Dep”> <complexType> <element name=“Lab”/> </complexType> </element> </complexType> </element> Example2.xml <Unv>SNU <Dep>CHEM <Lab>H2</Lab> </Dep> </Unv> XML & XML Schema

  4. Global Type Local Type XML Schema Design phonenumber1.xsd <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:simpleType name=“phonenumber"> <xsd:restriction base="xsd:string"> <xsd:pattern value ="[0-9]{3}-[0-9]{3}-[0-9]{4}"/> </xsd:restriction> </xsd:simpleType> </xsd:schema> 054-279-8243 phonenumber2.xsd <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name=“phonenumber2"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:pattern value ="[0-9]{3}-[0-9]{4}-[0-9]{4}"/> </xsd:restriction> </xsd:simpleType> </xsd:element> </xsd:schema> 010-2798-2431

  5. Schema error – Undefined value for ‘type’ encountered XML Schema Design phonenumber3.xsd <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:simpleType name=“phonenumber"> <xsd:restriction base="xsd:string"> <xsd:pattern value ="[0-9]{3}-[0-9]{3}-[0-9]{4}"/> </xsd:restriction> </xsd:simpleType> <xsd:element name=“phonenumber2"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:pattern value ="[0-9]{3}-[0-9]{4}-[0-9]{4}"/> </xsd:restriction> </xsd:simpleType> </xsd:element> <xsd:element name=“LabPhone" type=“phonenumber"/> <xsd:element name=“MobilePhone" type=“phonenumber2"/> </xsd:schema>

  6. Organization Conventions • OAGIS Best Practices • KIEC XML Guideline • UBL Naming and Design rules • ASC X12 Reference Model for XML Design • And more… Best practice for extensibility and reusability of the schema Local type should not be used. Globally defined types allow reuse while the local types do not.

  7. XML Schema Design Quality Testing Schema design OrganizationConventions Developer • It helps the developer to make XML schema consistent.

  8. XML Schema Design Quality Testing • Testing system requirements • Several organizational conventions should be satisfied. • Distributed work should be enabled. • Common conventions should be shared or reused. • Rule-based Expert System • Decision making system based on knowledge of rules

  9. Rule-based Expert System JESS (Java Expert System Shell script) for JAVA – Web implementation Expert System Shell Explanation system Interface Inference engine User Domain-specific Knowledge base Knowledge base editor

  10. Objectives To propose the rule-based expert system to ensure the quality of XML Schema design • To show the system framework • To encode testing rules from organization conventions • To translate XML schemas into facts • To implement the prototype

  11. Framework

  12. System Framework XMLSchemaspecification OrganizationConventions Check Schema against Organization Conventions XML Schema Schema Diagnosis A0 Expert System XSLT Engine

  13. System Framework Rule DesignGuide XSLT for XML2JESS Organization conventions Validation Rules Encode Rules A1 XML Schema Facts Transforminto Facts A2 A2 Schema Diagnosis Rule Execution A3 XSLT Engine ExpertSystem

  14. Fact Definition (deftemplate laboratory (slot University) (slot Department) (slot Name) ) (assert laboratory (University POSTECH) (Department IME) (Name ISL)) (laboratory (University POSTECH) (Department IME) (Name ISL))

  15. Template Definition deftemplate element (slot id) (slot name) deftemplate attribute (slot id) (slot name) (slot value) deftemplate relation (slot type (default attribute)) (slot parent) (slot child) deftemplate text (slot id) (slot value) <element name=“Unv”> <complexType> <element name=“Dep”> <complexType> <element name=“Lab”/> </complexType> </element> </complexType> </element> element complextype name (Unv) element complextype name (Dep) element name (Lab)

  16. Fact Transformation • XML Schema to JESS Fact element <element name=“Dep”> <complexType/> </element> complextype name (Dep) XSLT ; Templates Definition (deftemplate element (slot id) (slot name)) (deftemplate attribute (slot id) (slot name) (slot value)) (deftemplate relation (slot type (default attribute)) (slot parent) (slot child)) (deftemplate text (slot id) (slot value)) ; Fact Assertion (assert (element (id N000001) (name xsd:element))) (assert (relation (type attribute) (parent N000001) (child N000002))) (assert (attribute (id N000002) (name name) (value Dep)) (assert (relation (type element) (parent N000001) (child N000003))) (assert (element (id N000003) (name xsd:complexType)) …

  17. Rule Encoding • Organization convention to JESS Rules The schema must have Lab element as the child node of Dep element (defrule laboratory (element (id ?e-id) (name Dep)) (relation (type element) (parent ?e-id) (child ?e-id2)) (element (id ?e-id2) (name Lab)) => (printout t "Good Schema Design” crlf)) )

  18. Prototype

  19. Users Users Users Users Users Users Users Users Users Users KIEC v2.0 OAGI NIST JESS … Implementation architecture Application/Servlet Server Test scriptmanage module JESS executionmodule Client Login to system I/O Interface Upload test script Execute test Show test result Organization guideline Rule script Reference Interaction

  20. Demo Scenario • OAGI design document • Check for improper use of local type • Global element • To allow it to be referenced and reused • Scenario • Find the local type. • If the local type does not exist, printout “This schema does not local type”. • If the local type exist, printout “This local type should not be used” for each local type.

  21. Testing XML Schema <?xml version="1.0" encoding="ISO-8859-1"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:simpleType name="phonenumber"> <xsd:restriction base="xsd:string"> <xsd:pattern value ="[0-9]{3}-[0-9]{3}-[0-9]{4}"/> </xsd:restriction> </xsd:simpleType> </xsd:schema> <?xml version="1.0" encoding="ISO-8859-1"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="phonenumber2"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:pattern value ="[0-9]{3}-[0-9]{4}-[0-9]{4}"/> </xsd:restriction> </xsd:simpleType> </xsd:element> </xsd:schema>

  22. Live Demo

  23. Induction to interest in standardization Promotion to Interoperability Easiness to Schema Development Conclusion XML Schema Design Quality Testing

  24. Q & A Thank you

More Related