Example: University


DTD
<!ELEMENT University (Person)*>
<!ELEMENT Person (first_name, last_name, email, Status)>
<!ATTLIST Person Code ID #REQUIRED>
<!ELEMENT Status (Student | Professor)>
<!ELEMENT Student (year, Course*, home_address. rank)>
<!ATTLIST Student StudentId ID #REQUIRED 
                  tutor CDATA #REQUIRED>
<!ELEMENT Professor(ptitle, Division, rank)>
<!ATTLIST Professor Prof_code ID #REQUIRED
                    Office_phone CDATA #IMPLIED>
<!ELEMENT Division (Location, fund, employeenr)>
<!ATTLIST Division description CDATA #REQUIRED
                   sector CDATA #REQUIRED>
<!ELEMENT Location (city, street, number, county)>
<!ATTLIST Location code_location CDATA #IMPLIED>
<!ELEMENT Course (name,room)>
<!ATTLIST Course taughtby IDREF #REQUIRED>
<!ELEMENT first_name (#PCDATA)>
<!ELEMENT last_name (#PCDATA)>
<!ELEMENT email (#PCDATA)>
<!ELEMENT year (#PCDATA)>
<!ELEMENT rank (#PCDATA)>
<!ELEMENT ptitle (#PCDATA)>
<!ELEMENT description (#PCDATA)>
<!ELEMENT fund (#PCDATA)>
<!ELEMENT employeenr (#PCDATA)>
<!ELEMENT city (#PCDATA)>
<!ELEMENT street (#PCDATA)>
<!ELEMENT number (#PCDATA)>
<!ELEMENT county (#PCDATA)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT room (#PCDATA)>
<!ELEMENT home_address (#PCDATA)>




ODL

interface university
(source semistructured univers_xml
extent university )
{
	 attribute person person ;

};

interface person
(source semistructured univers_xml
extent person 
key (person_code))
{
	 attribute string person_code ;
	 attribute string first_name ;
	 attribute string last_name ;
	 attribute string email ;
	 attribute status status ;
};

interface status
(source semistructured univers_xml
extent status )
{
	 attribute student student ;

}
 union status1  
{
	 attribute professor professor ;

};

interface student
(source semistructured univers_xml
extent student 
key (student_studentid)
candidate_key cK0 (student_tutor))
{
	 attribute string student_studentid ;
	 attribute string student_tutor ;
	 attribute string year ;
	 attribute set course ;
	 attribute string homeaddress ;
	 attribute string rank ;
};

interface professor
(source semistructured univers_xml
extent professor 
key (professor_prof_code))
{
	 attribute string professor_prof_code ;
	 attribute string professor_office_phone ?; 
	 attribute string ptitle ;
	 attribute division division ;
	 attribute string rank ;
};

interface course
(source semistructured univers_xml
extent course 
foreign_key (course_taughtby) references person (person_code))
{
	 attribute string course_taughtby ;
	 attribute string name ;
	 attribute string room ;
};

interface division
(source semistructured univers_xml
extent division 
candidate_key cK0 (division_description,division_sector))
{
	 attribute string division_description ;
	 attribute string division_sector ;
	 attribute location location ;
	 attribute string fund ;
	 attribute string employeenr ;
};

interface location
(source semistructured univers_xml
extent location )
{
	 attribute string location_code_location ?; 
	 attribute string city ;
	 attribute string street ;
	 attribute string number ;
	 attribute string county ;
};




Representation with a OEM-like data model




Representation with a XML-GDM data model


The MOMIS Home Page