Entwurf 1 -- Beiträge fehlen

This commit is contained in:
Simon Martens
2024-05-07 18:25:53 +02:00
parent f118cc540b
commit 738a717993
26 changed files with 306 additions and 114 deletions

View File

@@ -1,26 +0,0 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.kgpz.de"
xmlns="https://www.kgpz.de"
elementFormDefault="qualified">
<xs:include schemaLocation="personen.xsd" />
<xs:include schemaLocation="orte.xsd" />
<xs:include schemaLocation="kategorien.xsd" />
<xs:include schemaLocation="werke.xsd" />
<xs:include schemaLocation="stuecke.xsd" />
<xs:include schemaLocation="beitraege.xsd" />
<xs:element name="kgpz">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="1">
<xs:element name="personen" type="personen" minOccurs="1" maxOccurs="1"/>
<xs:element name="orte" type="orte" minOccurs="1" maxOccurs="1"/>
<xs:element name="kategorien" type="kategorien" minOccurs="1" maxOccurs="1"/>
<xs:element name="werke" type="werke" maxOccurs="1" minOccurs="1"/>
<xs:element name="stuecke" type="stuecke" maxOccurs="1" minOccurs="1"/>
<xs:element name="beitraege" type="beitraege" maxOccurs="1" minOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@@ -1,10 +0,0 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.kgpz.de"
xmlns="https://www.kgpz.de"
elementFormDefault="qualified">
<xs:element name="beitraege" type="beitraege" />
<xs:complexType name="beitraege"></xs:complexType>
</xs:schema>

View File

@@ -1,10 +0,0 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.kgpz.de"
xmlns="https://www.kgpz.de"
elementFormDefault="qualified">
<xs:element name="kategorien" type="kategorien" />
<xs:complexType name="kategorien"></xs:complexType>
</xs:schema>

View File

@@ -1,10 +0,0 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.kgpz.de"
xmlns="https://www.kgpz.de"
elementFormDefault="qualified">
<xs:element name="orte" type="orte" />
<xs:complexType name="orte"></xs:complexType>
</xs:schema>

View File

@@ -1,10 +0,0 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.kgpz.de"
xmlns="https://www.kgpz.de"
elementFormDefault="qualified">
<xs:element name="personen" type="personen" />
<xs:complexType name="personen"></xs:complexType>
</xs:schema>

View File

@@ -1,10 +0,0 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.kgpz.de"
xmlns="https://www.kgpz.de"
elementFormDefault="qualified">
<xs:element name="stuecke" type="stuecke" />
<xs:complexType name="stuecke"></xs:complexType>
</xs:schema>

View File

@@ -1,10 +0,0 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.kgpz.de"
xmlns="https://www.kgpz.de"
elementFormDefault="qualified">
<xs:element name="werke" type="werke" />
<xs:complexType name="werke"></xs:complexType>
</xs:schema>

14
XSD/KGPZ.xsd Normal file
View File

@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.kgpz.de"
xmlns="https://www.kgpz.de"
xmlns:kgpz="https://www.kgpz.de"
elementFormDefault="qualified">
<xsd:include schemaLocation="akteure.xsd" />
<xsd:include schemaLocation="orte.xsd" />
<xsd:include schemaLocation="kategorien.xsd" />
<xsd:include schemaLocation="werke.xsd" />
<xsd:include schemaLocation="stuecke.xsd" />
<xsd:include schemaLocation="beitraege.xsd" />
</xsd:schema>

37
XSD/akteure.xsd Normal file
View File

@@ -0,0 +1,37 @@
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.kgpz.de"
xmlns="https://www.kgpz.de"
xmlns:kgpz="https://www.kgpz.de"
elementFormDefault="qualified">
<xsd:include schemaLocation="common.xsd" />
<xsd:element name="akteure">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="akteur" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="name" type="NonEmptyString" nillable="false" maxOccurs="unbounded" />
<xsd:element name="sortiername" minOccurs="1" maxOccurs="1" type="kgpz:NonEmptyString" nillable="false" />
<xsd:element name="lebensdaten" minOccurs="0" maxOccurs="1" type="kgpz:NonEmptyString" />
<!-- TODO: URI FOR GND -->
<xsd:element name="gnd" minOccurs="0" maxOccurs="1" type="xsd:anyURI" nillable="false" />
<xsd:element name="anmerkung" type="kgpz:NonEmptyString" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:unique name="uniqueIndexAkteur">
<xsd:selector xpath="kgpz:akteur" />
<xsd:field xpath="@id" />
</xsd:unique>
<xsd:unique name="uniqueGND">
<xsd:selector xpath="kgpz:akteur" />
<xsd:field xpath="kgpz:gnd" />
</xsd:unique>
</xsd:element>
</xsd:schema>

11
XSD/beitraege.xsd Normal file
View File

@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.kgpz.de"
xmlns="https://www.kgpz.de"
xmlns:kgpz="https://www.kgpz.de"
elementFormDefault="qualified">
<xsd:element name="beitraege" type="beitraege" />
<xsd:complexType name="beitraege"></xsd:complexType>
</xsd:schema>

20
XSD/common.xsd Normal file
View File

@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.kgpz.de"
xmlns="https://www.kgpz.de"
xmlns:kgpz="https://www.kgpz.de"
elementFormDefault="qualified">
<xsd:simpleType name="NonEmptyString">
<xsd:restriction base="xsd:string">
<xsd:minLength value="1" />
<xsd:pattern value=".*[^\s].*" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="Year">
<xsd:restriction base="xsd:unsignedInt">
<xsd:minInclusive value="0"/>
<xsd:maxInclusive value="2024"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>

29
XSD/kategorien.xsd Normal file
View File

@@ -0,0 +1,29 @@
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.kgpz.de"
xmlns="https://www.kgpz.de"
xmlns:kgpz="https://www.kgpz.de"
elementFormDefault="qualified">
<xsd:include schemaLocation="common.xsd"/>
<xsd:element name="kategorien">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="kategorie" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="name" type="NonEmptyString" minOccurs="1" maxOccurs="1" nillable="false" />
</xsd:sequence>
<xsd:attribute name="index" type="xsd:integer" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:unique name="uniqueIndexKategorien">
<xsd:selector xpath="kgpz:kategorie" />
<xsd:field xpath="@index" />
</xsd:unique>
</xsd:element>
</xsd:schema>

36
XSD/orte.xsd Normal file
View File

@@ -0,0 +1,36 @@
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.kgpz.de"
xmlns="https://www.kgpz.de"
xmlns:kgpz="https://www.kgpz.de"
elementFormDefault="qualified">
<xsd:include schemaLocation="common.xsd" />
<xsd:element name="orte">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ort" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="name" type="kgpz:NonEmptyString" minOccurs="1" maxOccurs="unbounded" nillable="false" />
<!-- TODO: geonames URI regex -->
<xsd:element name="geonames" type="xsd:anyURI" minOccurs="0" maxOccurs="1" nillable="false" />
<xsd:element name="anmerkung" type="kgpz:NonEmptyString" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:unique name="uniqueIndexOrte">
<xsd:selector xpath="kgpz:ort" />
<xsd:field xpath="@id" />
</xsd:unique>
<xsd:unique name="uniqueGeonames">
<xsd:selector xpath="kgpz:ort" />
<xsd:field xpath="kgpz:geonames" />
</xsd:unique>
</xsd:element>
</xsd:schema>

39
XSD/stuecke.xsd Normal file
View File

@@ -0,0 +1,39 @@
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.kgpz.de"
xmlns="https://www.kgpz.de"
xmlns:kgpz="https://www.kgpz.de"
elementFormDefault="qualified">
<!-- Vorschlag: Stücke aus dem Datum von Dateinamen ableiten -->
<xsd:include schemaLocation="common.xsd" />
<xsd:element name="stuecke">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="stueck" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<!-- Lässt sich aus Nummer + Jahr berechnen. -->
<xsd:element name="datum" type="xsd:date" minOccurs="1" maxOccurs="1" nillable="false" />
<!-- Von + bis lässt sich aus Nummer berechnen (n-1) * 4 + 1 bzw. (n-1) * 4 + 1 -->
<xsd:element name="von" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1"/>
<xsd:element name="bis" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1" />
<!-- Kann von Stücke abgeleitet werden -->
<xsd:element name="beilagen" type="xsd:nonNegativeInteger" default="0" minOccurs="0" maxOccurs="1"/>
<!-- Vielleicht nötig -->
<xsd:element name="anmerkung" type="kgpz:NonEmptyString" />
</xsd:sequence>
<xsd:attribute name="nummer" type="xsd:integer" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:unique name="uniqueNummer">
<xsd:selector xpath="stueck" />
<xsd:field xpath="@nummer" />
</xsd:unique>
</xsd:element>
</xsd:schema>

45
XSD/werke.xsd Normal file
View File

@@ -0,0 +1,45 @@
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.kgpz.de"
xmlns="https://www.kgpz.de"
xmlns:kgpz="https://www.kgpz.de"
elementFormDefault="qualified">
<xsd:include schemaLocation="common.xsd" />
<xsd:element name="werke">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="werk" maxOccurs="unbounded">
<xsd:complexType>
<xsd:choice>
<xsd:element name="daten" type="kgpz:citation" minOccurs="0" maxOccurs="1" />
<xsd:element name="zitation" type="NonEmptyString" minOccurs="0" maxOccurs="1" />
<xsd:element name="anmerkung" type="kgpz:NonEmptyString" minOccurs="0" maxOccurs="unbounded" />
</xsd:choice>
<xsd:attribute name="id" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:unique name="uniqueId">
<xsd:selector xpath="kgpz:werk" />
<xsd:field xpath="@id" />
</xsd:unique>
</xsd:element>
<xsd:complexType name="citation">
<xsd:sequence>
<xsd:element name="autorschaft" type="NonEmptyString" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="herausgabe" type="NonEmptyString" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="druck" type="NonEmptyString" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="verlag" type="NonEmptyString" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="vertrieb" type="NonEmptyString" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="ausgabe" type="NonEmptyString" minOccurs="0" maxOccurs="1" />
<xsd:element name="titel" type="NonEmptyString" minOccurs="0" maxOccurs="1" />
<xsd:element name="titelannotation" type="NonEmptyString" minOccurs="0" maxOccurs="1" />
<xsd:element name="jahr" type="NonEmptyString" minOccurs="0" maxOccurs="1" />
<xsd:element name="ort" type="NonEmptyString" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>

9
XSLT_Merge/kgpz.xml Normal file
View File

@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<kgpz xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../kategorien.xml" />
<xi:include href="../orte.xml" />
<xi:include href="../akteure.xml" />
<xi:include href="../stuecke.xml" />
<xi:include href="../werke.xml" />
<xi:include href="../beitraege.xml" />
</kgpz>

3
XSLT_Merge/merge.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
xmlstarlet tr --xinclude merge.xsl kgpz.xml

11
XSLT_Merge/merge.xsl Normal file
View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" />
<xsl:template match="/">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:transform>

13
akteure.xml Normal file
View File

@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<akteure xmlns="https://www.kgpz.de"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.kgpz.de XSD/KGPZ.xsd">
<akteur index="1">
<name>Albert Einstein</name>
<name>Ainshutain, A.</name>
<sortiername>Einstein, Albert</sortiername>
<geburtsdatum>1879-03-14</geburtsdatum>
<sterbedatum>1955-04-18</sterbedatum>
<gnd>https://d-nb.info/gnd/118529579</gnd>
</akteur>
</akteure>

View File

@@ -1,5 +1,4 @@
<?xml version="1.0"?>
<beitraege xmlns="https://www.kgpz.de"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xi="http://www.w3.org/2001/XInclude"
xsi:schemaLocation="https://www.kgpz.de Schemata/KGPZ.xsd"></beitraege>
xsi:schemaLocation="https://www.kgpz.de XSD_Schemata/KGPZ.xsd"></beitraege>

View File

@@ -1,5 +1,14 @@
<?xml version="1.0"?>
<kategorien xmlns="https://www.kgpz.de"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xi="http://www.w3.org/2001/XInclude"
xsi:schemaLocation="https://www.kgpz.de Schemata/KGPZ.xsd"></kategorien>
xsi:schemaLocation="https://www.kgpz.de XSD_Schemata/KGPZ.xsd">
<kategorie index="1">
<name>Wissenschaft</name>
</kategorie>
<kategorie index="2">
<name>Technik</name>
</kategorie>
<kategorie index="3">
<name>Politik</name>
</kategorie>
</kategorien>

View File

@@ -1,13 +0,0 @@
<?xml version="1.0"?>
<kgpz
xmlns="https://www.kgpz.de"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xi="http://www.w3.org/2001/XInclude"
xsi:schemaLocation="https://www.kgpz.de Schemata/KGPZ.xsd">
<personen />
<orte />
<kategorien />
<werke />
<stuecke />
<beitraege />
</kgpz>

View File

@@ -1,5 +1,12 @@
<?xml version="1.0"?>
<orte xmlns="https://www.kgpz.de"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xi="http://www.w3.org/2001/XInclude"
xsi:schemaLocation="https://www.kgpz.de Schemata/KGPZ.xsd"></orte>
xsi:schemaLocation="https://www.kgpz.de XSD_Schemata/KGPZ.xsd">
<ort index="1">
<name>Hallo</name>
<geonames></geonames>
</ort>
<ort index="2">
<name>Hans2</name>
</ort>
</orte>

View File

@@ -1,5 +0,0 @@
<?xml version="1.0"?>
<personen xmlns="https://www.kgpz.de"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xi="http://www.w3.org/2001/XInclude"
xsi:schemaLocation="https://www.kgpz.de Schemata/KGPZ.xsd"></personen>

View File

@@ -1,5 +1,12 @@
<?xml version="1.0"?>
<stuecke xmlns="https://www.kgpz.de"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xi="http://www.w3.org/2001/XInclude"
xsi:schemaLocation="https://www.kgpz.de Schemata/KGPZ.xsd"></stuecke>
xsi:schemaLocation="https://www.kgpz.de XSD/KGPZ.xsd">
<stueck nummer="1">
<datum>1970-01-01</datum>
<von>1</von>
<bis>4</bis>
<beilagen>3</beilagen>
<anmerkung>Anmerkung</anmerkung>
</stueck>
</stuecke>

View File

@@ -1,5 +1,12 @@
<?xml version="1.0"?>
<werke xmlns="https://www.kgpz.de"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xi="http://www.w3.org/2001/XInclude"
xsi:schemaLocation="https://www.kgpz.de Schemata/KGPZ.xsd"></werke>
xsi:schemaLocation="https://www.kgpz.de XSD/KGPZ.xsd">
<werk id="1">
</werk>
<werk id="2">
<zitation>Hans</zitation>
<anmerkung>Anmerkungen</anmerkung>
</werk>
</werke>