summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
Diffstat (limited to 'data')
-rw-r--r--data/domain/bibliography.osxml27
-rw-r--r--data/domain/book.osxml31
-rw-r--r--data/domain/comments.osxml40
-rw-r--r--data/domain/headings.osxml33
-rw-r--r--data/domain/lists.osxml26
-rw-r--r--data/domain/meta.osxml47
-rw-r--r--data/domain/structure.osxml3
-rw-r--r--data/typesystem/affiliation.osxml10
-rw-r--r--data/typesystem/email.osxml8
-rw-r--r--data/typesystem/version.osxml8
10 files changed, 230 insertions, 3 deletions
diff --git a/data/domain/bibliography.osxml b/data/domain/bibliography.osxml
new file mode 100644
index 0000000..11e2606
--- /dev/null
+++ b/data/domain/bibliography.osxml
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<domain name="bibliography">
+
+ <import rel="domain" src="book"/>
+ <import rel="domain" src="meta"/>
+
+ <struct name="bibliography" transparent="true">
+ <field>
+ <childRef ref="bibEntry"/>
+ </field>
+ <parentRef ref="book">
+ <field name="bibliography" isSubtree="true"/>
+ </parentRef>
+ </struct>
+
+ <struct name="bibEntry">
+ <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"/>
+ <field name="authors" optional="true">
+ <childRef ref="meta.author"/>
+ </field>
+ </struct>
+</domain>
diff --git a/data/domain/book.osxml b/data/domain/book.osxml
index 9659334..8ec60ed 100644
--- a/data/domain/book.osxml
+++ b/data/domain/book.osxml
@@ -1,3 +1,34 @@
<?xml version="1.0" standalone="yes"?>
<domain name="book">
+ <struct name="book" cardinality="{1}" isRoot="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>
</domain>
diff --git a/data/domain/comments.osxml b/data/domain/comments.osxml
new file mode 100644
index 0000000..cb19bd4
--- /dev/null
+++ b/data/domain/comments.osxml
@@ -0,0 +1,40 @@
+<?xml version="1.0" standalone="yes"?>
+<domain name="comments">
+ <import rel="domain" src="book"/>
+
+ <!-- an annotation comment -->
+ <annotation name="comment">
+ <field name="replies" isSubtree="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" isSubtree="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" isSubtree="true">
+ <childRef ref="reply"/>
+ </field>
+ <field name="content">
+ <childRef ref="book.paragraph"/>
+ </field>
+ </struct>
+</domain>
diff --git a/data/domain/headings.osxml b/data/domain/headings.osxml
new file mode 100644
index 0000000..055a204
--- /dev/null
+++ b/data/domain/headings.osxml
@@ -0,0 +1,33 @@
+<?xml version="1.0" standalone="yes"?>
+<domain name="headings">
+
+ <import rel="domain" src="book"/>
+
+ <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" isSubtree="true" optional="true"/>
+ </parentRef>
+ <parentRef ref="book.chapter">
+ <field name="heading" isSubtree="true" optional="true"/>
+ </parentRef>
+ <parentRef ref="book.section">
+ <field name="heading" isSubtree="true" optional="true"/>
+ </parentRef>
+ <parentRef ref="book.subsection">
+ <field name="heading" isSubtree="true" optional="true"/>
+ </parentRef>
+ <parentRef ref="book.paragraph">
+ <field name="heading" isSubtree="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 domains.
+ So we need to reference the default field of paragraph. -->
+ <fieldRef ref="book.paragraph.$default"/>
+ </struct>
+</domain>
diff --git a/data/domain/lists.osxml b/data/domain/lists.osxml
new file mode 100644
index 0000000..66e77cb
--- /dev/null
+++ b/data/domain/lists.osxml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<domain name="lists">
+ <import rel="domain" src="book"/>
+
+ <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/data/domain/meta.osxml b/data/domain/meta.osxml
new file mode 100644
index 0000000..7e96699
--- /dev/null
+++ b/data/domain/meta.osxml
@@ -0,0 +1,47 @@
+<?xml version="1.0"?>
+<domain name="meta">
+
+ <import rel="typesystem" src="affiliation"/>
+ <import rel="typesystem" src="email"/>
+ <import rel="typesystem" src="version"/>
+ <import rel="domain" src="book"/>
+ <import rel="domain" src="headings"/>
+
+ <struct name="meta" cardinality="{1}" transparent="true">
+ <field>
+ <childRef ref="title"/>
+ <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>
+
+ <!-- A title is just a heading -->
+ <struct name="title">
+ <field>
+ <childRef ref="heading"/>
+ </field>
+ </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/data/domain/structure.osxml b/data/domain/structure.osxml
deleted file mode 100644
index 63d0c5c..0000000
--- a/data/domain/structure.osxml
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml version="1.0" standalone="yes"?>
-<domain name="structure">
-</domain>
diff --git a/data/typesystem/affiliation.osxml b/data/typesystem/affiliation.osxml
new file mode 100644
index 0000000..d84dc30
--- /dev/null
+++ b/data/typesystem/affiliation.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/data/typesystem/email.osxml b/data/typesystem/email.osxml
new file mode 100644
index 0000000..325f89a
--- /dev/null
+++ b/data/typesystem/email.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/data/typesystem/version.osxml b/data/typesystem/version.osxml
new file mode 100644
index 0000000..0d52736
--- /dev/null
+++ b/data/typesystem/version.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>