diff options
author | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-02-15 20:48:17 +0100 |
---|---|---|
committer | Benjamin Paassen <bpaassen@techfak.uni-bielefeld.de> | 2015-02-15 20:48:17 +0100 |
commit | 2544749215bc2465bfeca431e271110ca86d8a83 (patch) | |
tree | 6e1b9e500941cec7f63a526e27881491a13ee340 | |
parent | 6041324a65cfdb878154af68d74aac2c86372440 (diff) |
added much more test data: meta domain, lists domain, bibliography domain, version typesystem, email typesystem, affiliation typesystem and complex book document which uses the aforementioned domains and typesystems.
-rw-r--r-- | testdata/xmlparser/affiliation.oxm | 10 | ||||
-rw-r--r-- | testdata/xmlparser/bibliography_domain.oxm | 26 | ||||
-rw-r--r-- | testdata/xmlparser/complex_book.oxd | 106 | ||||
-rw-r--r-- | testdata/xmlparser/email.oxm | 8 | ||||
-rw-r--r-- | testdata/xmlparser/lists_domain.oxm | 26 | ||||
-rw-r--r-- | testdata/xmlparser/meta_domain.oxm | 35 | ||||
-rw-r--r-- | testdata/xmlparser/version.oxm | 8 |
7 files changed, 219 insertions, 0 deletions
diff --git a/testdata/xmlparser/affiliation.oxm b/testdata/xmlparser/affiliation.oxm new file mode 100644 index 0000000..d84dc30 --- /dev/null +++ b/testdata/xmlparser/affiliation.oxm @@ -0,0 +1,10 @@ +<?xml version="1.0" standalone="yes"?> +<typesystem name="affiliation"> + <struct name="affiliation"> + <field name="workgroup" type="string"/> + <field name="departement" type="string"/> + <field name="institution" type="string"/> + </struct> + + <constant name="citec.sc" type="affiliation" value="[workgroup=Semantic Computing Group,departement=Center of Excellence Cognitive Interaction Technology (CITEC), institution=Bielefeld University]"/> +</typesystem> diff --git a/testdata/xmlparser/bibliography_domain.oxm b/testdata/xmlparser/bibliography_domain.oxm new file mode 100644 index 0000000..f1d25f8 --- /dev/null +++ b/testdata/xmlparser/bibliography_domain.oxm @@ -0,0 +1,26 @@ +<?xml version="1.0"?> +<domain name="bibliography"> + + <import rel="domain" src="./book_domain.oxm"/> + <import rel="domain" src="./meta_domain.oxm"/> + + <struct name="bibliography" transparent="true"> + <field> + <childRef ref="bibEntry"/> + </field> + <parentRef ref="book"> + <field name="bibliography" isSubtree="true"/> + </parentRef> + </struct> + <struct name="bibEntry"> + <field name="authors" optional="true"> + <childRef ref="meta.author"/> + </field> + <primitive name="name" type="string" isSubtree="true"/> + <primitive name="year" type="int" isSubtree="true"/> + <primitive name="journal" type="string" isSubtree="true" optional="true"/> + <primitive name="pages" type="cardinality" isSubtree="true" optional="true"/> + <!-- Here a geographical enum or something would be more exact --> + <primitive name="location" type="string" isSubtree="true" optional="true"/> + </struct> +</domain> diff --git a/testdata/xmlparser/complex_book.oxd b/testdata/xmlparser/complex_book.oxd new file mode 100644 index 0000000..7d69713 --- /dev/null +++ b/testdata/xmlparser/complex_book.oxd @@ -0,0 +1,106 @@ +<?xml version="1.0"?> +<document> + + <import rel="domain" src="./book_domain.oxm"/> + <import rel="domain" src="./headings_domain.oxm"/> + <import rel="domain" src="./meta_domain.oxm"/> + <import rel="domain" src="./bibliography_domain.oxm"/> + <!--<import rel="domain" src="emphasis.oxm"/> + <import rel="domain" src="comments.oxm"/> + <import rel="domain" src="lists.oxm"/> + <alias tag="paragraph" aka="p"/> + <alias tag="emphasized" aka="em"/>--> + + <book> + <meta> + <primaryAuthor> + <firstName>Immanuel</firstName> + <lastName>Kant</lastName> + <email>[ikant,philo.albertus-koenigsberg,de]</email> + <affiliation>[Logic and Metaphysics, Faculty of Philosophy, Albertus-University Königsberg]</affiliation> + </primaryAuthor> + <!-- Using this version tag leads to a very interesting bug: + A new transparent meta element gets created for it. Because only + one meta tag is allowed this leads to an error. So what to do? + + <version>[1,0,0]</version> --> + </meta> + + <heading> + Beantwortung der Frage: Was ist Aufklärung? + </heading> + + <chapter name="content"> + <heading>Was ist Aufklärung?</heading> + + Aufklärung ist der Ausgang des Menschen aus seiner + selbstverschuldeten Unmündigkeit. Unmündigkeit ist + das Unvermögen, sich seines Verstandes ohne Leitung eines anderen zu + bedienen. Selbstverschuldet ist diese Unmündigkeit, wenn + die Ursache derselben nicht am Mangel des Verstandes, sondern der + Entschließung und des Mutes liegt, sich seiner ohne Leitung eines + andern zu bedienen. + Sapere aude! Habe Mut, dich deines eigenen Verstandes zu + bedienen! ist also der Wahlspruch der Aufklärung. + </chapter> + + <bibliography> + <bibEntry> + <name>Dezember-Heft</name> + <journal>Berlinische Monatsschrift</journal> + <year>1784</year> + <pages>{481-494}</pages> + </bibEntry> + <bibEntry> + <name>Kleine Schriften</name> + <primaryAuthor> + <firstName>Immanuel</firstName> + <lastName>Kant</lastName> + </primaryAuthor> + <year>1793</year> + <pages>{34-50}</pages> + <location>Neuwied</location> + </bibEntry> + <bibEntry> + <name>Zerstreute Aufsätze</name> + <primaryAuthor> + <firstName>Immanuel</firstName> + <lastName>Kant</lastName> + </primaryAuthor> + <year>1793</year> + <pages>{25-37}</pages> + <location>Frankfurt und Leipzig</location> + </bibEntry> + <bibEntry> + <name>Sämmtliche kleine Schriften</name> + <primaryAuthor> + <firstName>Immanuel</firstName> + <lastName>Kant</lastName> + </primaryAuthor> + <year>1798</year> + <pages>{159-172}</pages> + <location>Königsberg u. Leipzig</location> + </bibEntry> + <bibEntry> + <name>I. Kant's vermischte Schriften</name> + <primaryAuthor> + <firstName>Immanuel</firstName> + <lastName>Kant</lastName> + </primaryAuthor> + <year>1799</year> + <pages>{687-700}</pages> + <location>Halle</location> + </bibEntry> + <bibEntry> + <name>Vorzügliche kleine Schriften und Aufsätze</name> + <primaryAuthor> + <firstName>Immanuel</firstName> + <lastName>Kant</lastName> + </primaryAuthor> + <year>1833</year> + <pages>{75-84}</pages> + <location>Leipzig</location> + </bibEntry> + </bibliography> + </book> +</document> diff --git a/testdata/xmlparser/email.oxm b/testdata/xmlparser/email.oxm new file mode 100644 index 0000000..325f89a --- /dev/null +++ b/testdata/xmlparser/email.oxm @@ -0,0 +1,8 @@ +<?xml version="1.0" standalone="yes"?> +<typesystem name="email"> + <struct name="email"> + <field name="local" type="string"/> + <field name="domainName" type="string"/> + <field name="domainSuffix" type="string"/> + </struct> +</typesystem> diff --git a/testdata/xmlparser/lists_domain.oxm b/testdata/xmlparser/lists_domain.oxm new file mode 100644 index 0000000..4360a6d --- /dev/null +++ b/testdata/xmlparser/lists_domain.oxm @@ -0,0 +1,26 @@ +<?xml version="1.0"?> +<domain name="lists"> + <import rel="domain" src="book.oxm"/> + + <struct name="ul" isa="book.paragraph"> + <!-- Here we solve the problem of parents using the isa + mechanism, because a list may occur whereever a paragraph + may occur. However we do want to override the default field. --> + <field> + <childRef name="item"/> + </field> + </struct> + <struct name="ol" isa="book.paragraph"> + <!-- Here we solve the problem of parents using the isa + mechanism, because a list may occur whereever a paragraph + may occur. However we do want to override the default field. --> + <field> + <childRef name="item"/> + </field> + </struct> + <struct name="item"> + <field> + <childRef name="book.paragaph"/> + </field> + </struct> +</domain> diff --git a/testdata/xmlparser/meta_domain.oxm b/testdata/xmlparser/meta_domain.oxm new file mode 100644 index 0000000..ffb5413 --- /dev/null +++ b/testdata/xmlparser/meta_domain.oxm @@ -0,0 +1,35 @@ +<?xml version="1.0"?> +<domain name="meta"> + + <import rel="typesystem" src="./affiliation.oxm"/> + <import rel="typesystem" src="./email.oxm"/> + <import rel="typesystem" src="./version.oxm"/> + <import rel="domain" src="./book_domain.oxm"/> + + <struct name="meta" cardinality="{1}" transparent="true"> + <field name="authors"> + <childRef ref="author"/> + <childRef ref="version"/> + </field> + <parentRef ref="book"> + <field name="meta" isSubtree="true" optional="true"/> + </parentRef> + <parentRef ref="chapter"> + <field name="meta" isSubtree="true" optional="true"/> + </parentRef> + <!-- One could also include "article" and other things here --> + </struct> + <!-- no explicit cardinality, because we might have multiple authors --> + <struct name="author"> + <primitive isSubtree="true" name="firstName" type="string"/> + <primitive isSubtree="true" name="lastName" type="string"/> + <primitive isSubtree="true" name="email" type="email" optional="true"/> + <primitive isSubtree="true" name="affiliation" type="affiliation" optional="true"/> + </struct> + <!-- but we need at least one primary author --> + <struct name="primaryAuthor" cardinality="{>0}" isa="author"/> + <!-- version intermediate struct --> + <struct name="version" cardinality="{0-1}"> + <primitive type="version"/> + </struct> +</domain> diff --git a/testdata/xmlparser/version.oxm b/testdata/xmlparser/version.oxm new file mode 100644 index 0000000..0d52736 --- /dev/null +++ b/testdata/xmlparser/version.oxm @@ -0,0 +1,8 @@ +<?xml version="1.0" standalone="yes"?> +<typesystem name="version"> + <struct name="version"> + <field name="major" type="int"/> + <field name="minor" type="int"/> + <field name="patch" type="int"/> + </struct> +</typesystem> |