160 likes | 290 Views
ENF for Serializing Graphs in XML. Matthew Yu Tak Chiu Raghuram Sivalanka Sujith Surendran. ENF ,Graphs,XML. XML A Standard for exchanging data Element Normal Form XML using elements rather than attributes
E N D
ENF for Serializing Graphs in XML Matthew Yu Tak Chiu Raghuram Sivalanka Sujith Surendran
ENF ,Graphs,XML • XML • A Standard for exchanging data • Element Normal Form • XML using elements rather than attributes • Serialize graphs of data to XML while preserving structure(so that it can be reconstructed)
Design Goals • Readable,Simple • XML 1.0 • Simple Query Model • Map to other syntax families
Terminology • Simple Node • Compound Node • Value of a Node • Single, Multi-reference • Independent Elements • Embedded elements
Serialization • Root Element – a container • Independent Elements are Nodes • Embedded elements are Arcs • Value of node becomes content of element • Arc can contain the value of the node it points to or can have a reference • References use ID attribute
<School> <Address id="Address-3"> <street>28 Campus Drive #103</street> <city>Unicity</city> <state>CA</state> </Address> <Course id="Course-19"> <name>Western Civilization</name> <taughtBy href="#Teacher-83"/> </Course> <Student id="Student-30006"> <name>Raphael</name> <parentaddr> <street>950 Greenhill Rd</street> <city>Mill Valley</city> <state>CA</state> </parentaddr> <dormaddr href="Address-3"/> <attends href="#Course-19"/> </Student> <Teacher id="Teacher-83"> <name>Thorsten</name> </Teacher> </School> Example Serialization
1:1 Relationship <Student> <name>Alice</name> <attends> <name>Greek</name> </attends> </Student>
1:many <Teacher id="Teacher-1"> <name>Alice</name> <teaches dt:type='course'> <name>Greek</name> </teaches> <teaches dt:type='danceClass'> <name>Rhumba and More!</name> </teaches> </Teacher>
<Student id="Student-1"> <name>Alice<name> <attends href="#Course-1"/> <attends href="#Course-2"/> </Student> <Student id="Student-2"> <name>Bob<name> <attends href="#Course-2"/> <attends href="#Course-3"/> </Student> <Course id="Course-1"> <name>Greek</name> <attendee href="Student-1"/> </Course> <Course id="Course-2"> <name>English History</name> <attendedBy href="Student-1"/> <attendedBy href="Student-2"/> </Course> <Course id="Course-3"> <name>Physics</name> <attendedBy href="Student-2"/> </Course> Many to Many
Mapping other syntax • Easy to convert ENF back to graph • Other syntax eg. Uses attributes,no ids • 2 approaches • Encode mappings in schema/DTD • Use XSL to transform to ENF
Converting UML • Similar to graph serialization • UML types correspond to node labels • Properties correspond to edge labels and so are Relations • Property always a single reference. Relation can be multi-reference as well
Serializing RDF • RDF provides a simple graph based data model and XML syntax • RDF developed as an interchange for Web metadata. • Any RDF graph can be serialized with ENF • ENF can be used for web metadata interchange as well
ENF and Information Integration • Databases serialized in ENF • A common ground for heterogeneous clients and data sources • XML,XPATH,XQuery,XSL • Using XML technologies for an Information Integration system
Conclusion • Powerful tool to transfer complex structured data • Simple, conforms to XML 1.0 • Semantic view of data, independent of implementation • Duplicates information, verbose • Some serializations cannot be expressed with DTD/schema • Can lose constraints on data