<!-- This file was created by autoDtd based on test/chado/in.xml -->

<!-- First some entities to mark numeric types in between tags.  Same as NCBI. -->
<!ENTITY % INTEGER "#PCDATA">
<!ENTITY % REAL "#PCDATA">

<!-- Now some entities for numeric attributes. NCBI doesn't define these but we do. -->
<!ENTITY % int "CDATA">
<!ENTITY % float "CDATA">

<!-- Now the data structure in test/chado/in.xml. -->
<!ELEMENT chado (
	_appdata+, 
	cv+, 
	db+, 
	cvterm+, 
	pub+, 
	organism, 
	feature+
)>

<!ELEMENT _appdata (#PCDATA)>
<!ATTLIST _appdata name CDATA #REQUIRED>

<!ELEMENT cv (name)>
<!ATTLIST cv id CDATA #REQUIRED>

<!ELEMENT name (#PCDATA)>

<!ELEMENT db (name, contact_id)>
<!ATTLIST db op CDATA #REQUIRED>
<!ATTLIST db id CDATA #REQUIRED>

<!ELEMENT contact_id (contact)>

<!ELEMENT contact (description)>

<!ELEMENT description (#PCDATA)>

<!ELEMENT cvterm (cv_id, name)>
<!ATTLIST cvterm op CDATA #REQUIRED>
<!ATTLIST cvterm id CDATA #REQUIRED>

<!ELEMENT cv_id (#PCDATA)>

<!ELEMENT pub (uniquename, type_id)>
<!ATTLIST pub op CDATA #REQUIRED>
<!ATTLIST pub id CDATA #REQUIRED>

<!ELEMENT uniquename (#PCDATA)>

<!ELEMENT type_id (#PCDATA)>

<!ELEMENT organism (genus, species)>
<!ATTLIST organism id CDATA #IMPLIED>

<!ELEMENT genus (#PCDATA)>

<!ELEMENT species (#PCDATA)>

<!ELEMENT feature (
	uniquename, 
	organism_id, 
	type_id, 
	name?, 
	timelastmodified?, 
	seqlen?, 
	dbxref_id?, 
	feature_dbxref*, 
	featureprop*, 
	feature_synonym?, 
	featureloc?, 
	feature_relationship?, 
	md5checksum?, 
	residues?, 
	is_analysis?, 
	analysisfeature?
)>
<!ATTLIST feature id CDATA #IMPLIED>

<!ELEMENT organism_id (organism?, #PCDATA)>

<!ELEMENT timelastmodified (#PCDATA)>

<!ELEMENT seqlen (%INTEGER;)>

<!ELEMENT dbxref_id (dbxref)>

<!ELEMENT dbxref (accession, db_id)>

<!ELEMENT accession (#PCDATA)>

<!ELEMENT db_id (#PCDATA)>

<!ELEMENT feature_dbxref (dbxref_id)>

<!ELEMENT featureprop (type_id, value)>

<!ELEMENT value (#PCDATA)>

<!ELEMENT feature_synonym (
	is_internal, 
	synonym_id, 
	pub_id, 
	is_current
)>

<!ELEMENT is_internal (%INTEGER;)>

<!ELEMENT synonym_id (synonym)>

<!ELEMENT synonym (name, synonym_sgml, type_id)>

<!ELEMENT synonym_sgml (#PCDATA)>

<!ELEMENT pub_id (#PCDATA)>

<!ELEMENT is_current (%INTEGER;)>

<!ELEMENT featureloc (
	srcfeature_id, 
	fmin, 
	fmax, 
	strand, 
	is_fmin_partial?, 
	is_fmax_partial?, 
	locgroup?, 
	rank?, 
	residue_info?
)>

<!ELEMENT srcfeature_id (feature?, #PCDATA)>

<!ELEMENT fmin (%INTEGER;)>

<!ELEMENT fmax (%INTEGER;)>

<!ELEMENT strand (%INTEGER;)>

<!ELEMENT is_fmin_partial (%INTEGER;)>

<!ELEMENT is_fmax_partial (%INTEGER;)>

<!ELEMENT locgroup (%INTEGER;)>

<!ELEMENT rank (%INTEGER;)>

<!ELEMENT residue_info (#PCDATA)>

<!ELEMENT feature_relationship (type_id, subject_id, rank?)>

<!ELEMENT subject_id (feature)>

<!ELEMENT md5checksum (#PCDATA)>

<!ELEMENT residues (#PCDATA)>

<!ELEMENT is_analysis (%INTEGER;)>

<!ELEMENT analysisfeature (analysis_id, rawscore?)>

<!ELEMENT analysis_id (analysis)>

<!ELEMENT analysis (
	sourcename, 
	timeexecuted?, 
	sourceversion, 
	program, 
	programversion
)>

<!ELEMENT sourcename (#PCDATA)>

<!ELEMENT timeexecuted (#PCDATA)>

<!ELEMENT sourceversion (%REAL;)>

<!ELEMENT program (#PCDATA)>

<!ELEMENT programversion (%REAL;)>

<!ELEMENT rawscore (%INTEGER;)>

