diff options
Diffstat (limited to 'testdata/integration/osxml')
-rw-r--r-- | testdata/integration/osxml/affiliation_typesystem.osxml | 10 | ||||
-rw-r--r-- | testdata/integration/osxml/bibliography_ontology.osxml | 42 | ||||
-rw-r--r-- | testdata/integration/osxml/book_ontology.osxml | 35 | ||||
-rw-r--r-- | testdata/integration/osxml/comments_ontology.osxml | 40 | ||||
-rw-r--r-- | testdata/integration/osxml/complex_book.osxml | 107 | ||||
-rw-r--r-- | testdata/integration/osxml/email_typesystem.osxml | 8 | ||||
-rw-r--r-- | testdata/integration/osxml/emphasis_ontology.osxml | 5 | ||||
-rw-r--r-- | testdata/integration/osxml/headings_ontology.osxml | 33 | ||||
-rw-r--r-- | testdata/integration/osxml/lists_ontology.osxml | 24 | ||||
-rw-r--r-- | testdata/integration/osxml/meta_ontology.osxml | 49 | ||||
-rw-r--r-- | testdata/integration/osxml/simple_annotation.osxml | 10 | ||||
-rw-r--r-- | testdata/integration/osxml/version_typesystem.osxml | 8 |
12 files changed, 371 insertions, 0 deletions
diff --git a/testdata/integration/osxml/affiliation_typesystem.osxml b/testdata/integration/osxml/affiliation_typesystem.osxml new file mode 100644 index 0000000..d84dc30 --- /dev/null +++ b/testdata/integration/osxml/affiliation_typesystem.osxml @@ -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/integration/osxml/bibliography_ontology.osxml b/testdata/integration/osxml/bibliography_ontology.osxml new file mode 100644 index 0000000..0333133 --- /dev/null +++ b/testdata/integration/osxml/bibliography_ontology.osxml @@ -0,0 +1,42 @@ +<?xml version="1.0"?> +<ontology name="bibliography"> + + <import rel="ontology" src="./book_ontology"/> + <import rel="ontology" src="./meta_ontology"/> + + <struct name="bibliography" transparent="true"> + <field> + <childRef ref="bibEntry"/> + </field> + <parentRef ref="book"> + <field name="bibliography" subtree="true"/> + </parentRef> + </struct> + <struct name="bibEntry"> + <field> + <childRef ref="meta.authors"/> + <childRef ref="title"/> + <childRef ref="year"/> + <childRef ref="journal"/> + <childRef ref="pages"/> + <childRef ref="location"/> + </field> + </struct> + <struct name="title" cardinality="{1}"> + <primitive type="string"/> + </struct> + <struct name="year" cardinality="{1}"> + <primitive type="int"/> + </struct> + <struct name="journal" cardinality="{0-1}"> + <!-- here some kind of database reference would be better --> + <primitive type="string"/> + </struct> + <struct name="pages" cardinality="{0-1}"> + <primitive type="cardinality"/> + </struct> + <struct name="location" cardinality="{0-1}"> + <!-- here some kind of database reference would be better --> + <primitive type="string"/> + </struct> +</ontology> diff --git a/testdata/integration/osxml/book_ontology.osxml b/testdata/integration/osxml/book_ontology.osxml new file mode 100644 index 0000000..2c615ca --- /dev/null +++ b/testdata/integration/osxml/book_ontology.osxml @@ -0,0 +1,35 @@ +<?xml version="1.0" standalone="yes"?> +<!-- The ontology node is the root node of a single ontology definition --> +<ontology name="book"> + <struct name="book" cardinality="{1}" root="true"> + <field> + <childRef ref="book.chapter"/> + <childRef ref="book.paragraph"/> + </field> + </struct> + <struct name="chapter"> + <field> + <childRef ref="book.section"/> + <childRef ref="book.paragraph"/> + </field> + </struct> + <struct name="section"> + <field> + <childRef ref="book.subsection"/> + <childRef ref="book.paragraph"/> + </field> + </struct> + <struct name="subsection"> + <field> + <childRef ref="book.paragraph"/> + </field> + </struct> + <struct name="paragraph" transparent="true"> + <field> + <childRef ref="book.text"/> + </field> + </struct> + <struct name="text" transparent="true"> + <primitive type="string"/> + </struct> +</ontology> diff --git a/testdata/integration/osxml/comments_ontology.osxml b/testdata/integration/osxml/comments_ontology.osxml new file mode 100644 index 0000000..34185d8 --- /dev/null +++ b/testdata/integration/osxml/comments_ontology.osxml @@ -0,0 +1,40 @@ +<?xml version="1.0" standalone="yes"?> +<ontology name="comments"> + <import rel="ontology" src="./book_ontology.osxml"/> + + <!-- an annotation comment --> + <annotation name="comment"> + <field name="replies" subtree="true"> + <childRef ref="reply"/> + </field> + <field name="content"> + <childRef ref="book.paragraph"/> + </field> + </annotation> + + <!-- an point-like structure comment. --> + <struct name="comment"> + <!-- Is there a chance to prevent users from having to redefine these + two fields in comment and reply? Could we use a fieldRef here? + Or would that be circular? --> + <field name="replies" subtree="true"> + <childRef ref="reply"/> + </field> + <field name="content"> + <childRef ref="book.paragraph"/> + </field> + <parentRef ref="book.paragraph"> + <fieldRef ref="$default"/> + </parentRef> + </struct> + <!-- note that replies are organized in a tree fashion: One can also reply + to a reply --> + <struct name="reply"> + <field name="replies" subtree="true"> + <childRef ref="reply"/> + </field> + <field name="content"> + <childRef ref="book.paragraph"/> + </field> + </struct> +</ontology> diff --git a/testdata/integration/osxml/complex_book.osxml b/testdata/integration/osxml/complex_book.osxml new file mode 100644 index 0000000..8eb5f26 --- /dev/null +++ b/testdata/integration/osxml/complex_book.osxml @@ -0,0 +1,107 @@ +<?xml version="1.0"?> +<document> + + <import rel="ontology" src="./book_ontology"/> + <import rel="ontology" src="./headings_ontology"/> + <import rel="ontology" src="./meta_ontology"/> + <import rel="ontology" src="./bibliography_ontology"/> + <import rel="ontology" src="./lists_ontology"/> + <import rel="ontology" src="./emphasis_ontology"/> + <import rel="ontology" src="./comments_ontology"/> + <!--<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> + <version>[1,0,0]</version> + </meta> + + <bibliography> + <bibEntry> + <title>Dezember-Heft</title> + <journal>Berlinische Monatsschrift</journal> + <year>1784</year> + <pages>{481-494}</pages> + </bibEntry> + <bibEntry> + <title>Kleine Schriften</title> + <primaryAuthor> + <firstName>Immanuel</firstName> + <lastName>Kant</lastName> + </primaryAuthor> + <year>1793</year> + <pages>{34-50}</pages> + <location>Neuwied</location> + </bibEntry> + <bibEntry> + <title>Zerstreute Aufsätze</title> + <primaryAuthor> + <firstName>Immanuel</firstName> + <lastName>Kant</lastName> + </primaryAuthor> + <year>1793</year> + <pages>{25-37}</pages> + <location>Frankfurt und Leipzig</location> + </bibEntry> + <bibEntry> + <title>Sämmtliche kleine Schriften</title> + <primaryAuthor> + <firstName>Immanuel</firstName> + <lastName>Kant</lastName> + </primaryAuthor> + <year>1798</year> + <pages>{159-172}</pages> + <location>Königsberg u. Leipzig</location> + </bibEntry> + <bibEntry> + <title>I. Kant's vermischte Schriften</title> + <primaryAuthor> + <firstName>Immanuel</firstName> + <lastName>Kant</lastName> + </primaryAuthor> + <year>1799</year> + <pages>{687-700}</pages> + <location>Halle</location> + </bibEntry> + <bibEntry> + <title>Vorzügliche kleine Schriften und Aufsätze</title> + <primaryAuthor> + <firstName>Immanuel</firstName> + <lastName>Kant</lastName> + </primaryAuthor> + <year>1833</year> + <pages>{75-84}</pages> + <location>Leipzig</location> + </bibEntry> + </bibliography> + + <heading> + Beantwortung der Frage: Was ist Aufklärung? + </heading> + + <chapter name="content"> + <heading>Was ist Aufklärung?</heading> + + <a:start:strong/>Aufklärung ist der Ausgang des Menschen aus seiner + selbstverschuldeten Unmündigkeit<a:end:strong/>. + <ul> + <item><a:start:emphasized/>Unmündigkeit<a:end:emphasized/> ist + das Unvermögen, sich seines Verstandes ohne Leitung eines anderen zu + bedienen.</item> + <item><a:start:emphasized/>Selbstverschuldet<a:end:emphasized/> + 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.</item> + </ul> + <a:start:strong/>Sapere aude!<a:end:strong/> Habe Mut, dich deines + eigenen Verstandes zu bedienen! ist also der Wahlspruch der + Aufklärung. + </chapter> + </book> +</document> diff --git a/testdata/integration/osxml/email_typesystem.osxml b/testdata/integration/osxml/email_typesystem.osxml new file mode 100644 index 0000000..325f89a --- /dev/null +++ b/testdata/integration/osxml/email_typesystem.osxml @@ -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/integration/osxml/emphasis_ontology.osxml b/testdata/integration/osxml/emphasis_ontology.osxml new file mode 100644 index 0000000..0fdd63a --- /dev/null +++ b/testdata/integration/osxml/emphasis_ontology.osxml @@ -0,0 +1,5 @@ +<?xml version="1.0" standalone="yes"?> +<ontology name="emphasis"> + <annotation name="emphasized"/> + <annotation name="strong"/> +</ontology> diff --git a/testdata/integration/osxml/headings_ontology.osxml b/testdata/integration/osxml/headings_ontology.osxml new file mode 100644 index 0000000..56c9e7d --- /dev/null +++ b/testdata/integration/osxml/headings_ontology.osxml @@ -0,0 +1,33 @@ +<?xml version="1.0" standalone="yes"?> +<ontology name="headings"> + + <import rel="ontology" src="./book_ontology.osxml"/> + + <struct name="heading" cardinality="1" transparent="true"> + <!-- The parent mechanism is a curious thing. Remind yourself + that parent-child-relationship in this sense are mediated + by fields. So we must either reference a field that is + already there or declare a new one on the fly. --> + <parentRef ref="book.book"> + <field name="heading" subtree="true" optional="true"/> + </parentRef> + <parentRef ref="book.chapter"> + <field name="heading" subtree="true" optional="true"/> + </parentRef> + <parentRef ref="book.section"> + <field name="heading" subtree="true" optional="true"/> + </parentRef> + <parentRef ref="book.subsection"> + <field name="heading" subtree="true" optional="true"/> + </parentRef> + <parentRef ref="book.paragraph"> + <field name="heading" subtree="true" optional="true"/> + </parentRef> + <!-- regarding its fields we have a problem here. We do not want to + declare a new field, because in fact we want to allow every + bit of content that a paragraph would allow - also considering + possible extensions of paragraph by other ontologies. + So we need to reference the default field of paragraph. --> + <fieldRef ref="book.paragraph.$default"/> + </struct> +</ontology> diff --git a/testdata/integration/osxml/lists_ontology.osxml b/testdata/integration/osxml/lists_ontology.osxml new file mode 100644 index 0000000..c18494a --- /dev/null +++ b/testdata/integration/osxml/lists_ontology.osxml @@ -0,0 +1,24 @@ +<?xml version="1.0"?> +<ontology name="lists"> + <import rel="ontology" src="./book_ontology"/> + + <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 ref="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 ref="item"/> + </field> + </struct> + <struct name="item"> + <fieldRef ref="book.paragraph.$default"/> + </struct> +</ontology> diff --git a/testdata/integration/osxml/meta_ontology.osxml b/testdata/integration/osxml/meta_ontology.osxml new file mode 100644 index 0000000..eb392ce --- /dev/null +++ b/testdata/integration/osxml/meta_ontology.osxml @@ -0,0 +1,49 @@ +<?xml version="1.0"?> +<ontology name="meta"> + + <import rel="typesystem" src="./affiliation_typesystem"/> + <import rel="typesystem" src="./email_typesystem"/> + <import rel="typesystem" src="./version_typesystem"/> + <import rel="ontology" src="./book_ontology"/> + + <struct name="meta" cardinality="{1}" transparent="true"> + <field> + <childRef ref="authors"/> + <childRef ref="version"/> + </field> + <parentRef ref="book"> + <field name="meta" subtree="true" optional="true"/> + </parentRef> + <parentRef ref="chapter"> + <field name="meta" subtree="true" optional="true"/> + </parentRef> + <!-- One could also include "article" and other things here --> + </struct> + + <struct name="person"> + <primitive subtree="true" name="firstName" type="string"/> + <primitive subtree="true" name="secondNames" type="string[]" optional="true"/> + <primitive subtree="true" name="lastName" type="string"/> + <primitive subtree="true" name="email" type="email" optional="true"/> + <primitive subtree="true" name="affiliation" type="affiliation" optional="true"/> + </struct> + + <!-- wrapper author tag to allow specifying no authors whatsoever. But if + an author is specified it has to be at least one primary author. --> + <struct name="authors" transparent="true" cardinality="{0-1}"> + <field> + <childRef ref="author"/> + </field> + </struct> + + <!-- no explicit cardinality, because we might have multiple authors --> + <struct name="author" isa="person"/> + + <!-- 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> +</ontology> diff --git a/testdata/integration/osxml/simple_annotation.osxml b/testdata/integration/osxml/simple_annotation.osxml new file mode 100644 index 0000000..c0f426a --- /dev/null +++ b/testdata/integration/osxml/simple_annotation.osxml @@ -0,0 +1,10 @@ +<?xml version="1.0" standalone="yes"?> +<document> + <import rel="ontology" src="./book_ontology.osxml"/> + <import rel="ontology" src="./comments_ontology.osxml"/> + + <book> + This is a <a:start:comment>This is not a nice test!</a:start:comment>test<a:end:comment/>. + </book> +</document> + diff --git a/testdata/integration/osxml/version_typesystem.osxml b/testdata/integration/osxml/version_typesystem.osxml new file mode 100644 index 0000000..0d52736 --- /dev/null +++ b/testdata/integration/osxml/version_typesystem.osxml @@ -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> |