Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonioG70 committed Jun 7, 2024
1 parent 42a9819 commit 2a2747a
Show file tree
Hide file tree
Showing 8 changed files with 148 additions and 62 deletions.
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
<!--&lt;!&ndash; provide ID type information even for parsers which only read the-->
<!-- internal subset &ndash;&gt;-->
<!-- <!ATTLIST xs:schema id ID #IMPLIED>-->
<!-- <!ATTLIST xs:complexType id ID #IMPLIED>-->
<!-- <!ATTLIST xs:complexContent id ID #IMPLIED>-->
<!-- <!ATTLIST xs:simpleContent id ID #IMPLIED>-->
<!-- <!ATTLIST xs:extension id ID #IMPLIED>-->
<!-- <!ATTLIST xs:element id ID #IMPLIED>-->
<!-- <!ATTLIST xs:group id ID #IMPLIED>-->
<!-- <!ATTLIST xs:all id ID #IMPLIED>-->
<!-- <!ATTLIST xs:choice id ID #IMPLIED>-->
<!-- <!ATTLIST xs:sequence id ID #IMPLIED>-->
<!-- <!ATTLIST xs:any id ID #IMPLIED>-->
<!-- <!ATTLIST xs:anyAttribute id ID #IMPLIED>-->
<!-- <!ATTLIST xs:attribute id ID #IMPLIED>-->
<!-- <!ATTLIST xs:attributeGroup id ID #IMPLIED>-->
<!-- <!ATTLIST xs:unique id ID #IMPLIED>-->
<!-- <!ATTLIST xs:key id ID #IMPLIED>-->
<!-- <!ATTLIST xs:keyref id ID #IMPLIED>-->
<!-- <!ATTLIST xs:selector id ID #IMPLIED>-->
<!-- <!ATTLIST xs:field id ID #IMPLIED>-->
<!-- <!ATTLIST xs:include id ID #IMPLIED>-->
<!-- <!ATTLIST xs:import id ID #IMPLIED>-->
<!-- <!ATTLIST xs:redefine id ID #IMPLIED>-->
<!-- <!ATTLIST xs:notation id ID #IMPLIED>-->
<!-- &lt;!&ndash;-->
<!-- keep this schema XML1.0 DTD valid-->
<!-- &ndash;&gt;-->
<!-- <!ENTITY % schemaAttrs 'xmlns:hfp CDATA #IMPLIED'>-->
<!-- provide ID type information even for parsers which only read the
internal subset -->
<!ATTLIST xs:schema id ID #IMPLIED>
<!ATTLIST xs:complexType id ID #IMPLIED>
<!ATTLIST xs:complexContent id ID #IMPLIED>
<!ATTLIST xs:simpleContent id ID #IMPLIED>
<!ATTLIST xs:extension id ID #IMPLIED>
<!ATTLIST xs:element id ID #IMPLIED>
<!ATTLIST xs:group id ID #IMPLIED>
<!ATTLIST xs:all id ID #IMPLIED>
<!ATTLIST xs:choice id ID #IMPLIED>
<!ATTLIST xs:sequence id ID #IMPLIED>
<!ATTLIST xs:any id ID #IMPLIED>
<!ATTLIST xs:anyAttribute id ID #IMPLIED>
<!ATTLIST xs:attribute id ID #IMPLIED>
<!ATTLIST xs:attributeGroup id ID #IMPLIED>
<!ATTLIST xs:unique id ID #IMPLIED>
<!ATTLIST xs:key id ID #IMPLIED>
<!ATTLIST xs:keyref id ID #IMPLIED>
<!ATTLIST xs:selector id ID #IMPLIED>
<!ATTLIST xs:field id ID #IMPLIED>
<!ATTLIST xs:include id ID #IMPLIED>
<!ATTLIST xs:import id ID #IMPLIED>
<!ATTLIST xs:redefine id ID #IMPLIED>
<!ATTLIST xs:notation id ID #IMPLIED>
<!--
keep this schema XML1.0 DTD valid
-->
<!ENTITY % schemaAttrs 'xmlns:hfp CDATA #IMPLIED'>

<!-- <!ELEMENT hfp:hasFacet EMPTY>-->
<!-- <!ATTLIST hfp:hasFacet-->
<!-- name NMTOKEN #REQUIRED>-->
<!ELEMENT hfp:hasFacet EMPTY>
<!ATTLIST hfp:hasFacet
name NMTOKEN #REQUIRED>

<!-- <!ELEMENT hfp:hasProperty EMPTY>-->
<!-- <!ATTLIST hfp:hasProperty-->
<!-- name NMTOKEN #REQUIRED-->
<!-- value CDATA #REQUIRED>-->
<!-- &lt;!&ndash;-->
<!-- Make sure that processors that do not read the external-->
<!-- subset will know about the various IDs we declare-->
<!-- &ndash;&gt;-->
<!-- <!ATTLIST xs:simpleType id ID #IMPLIED>-->
<!-- <!ATTLIST xs:maxExclusive id ID #IMPLIED>-->
<!-- <!ATTLIST xs:minExclusive id ID #IMPLIED>-->
<!-- <!ATTLIST xs:maxInclusive id ID #IMPLIED>-->
<!-- <!ATTLIST xs:minInclusive id ID #IMPLIED>-->
<!-- <!ATTLIST xs:totalDigits id ID #IMPLIED>-->
<!-- <!ATTLIST xs:fractionDigits id ID #IMPLIED>-->
<!-- <!ATTLIST xs:length id ID #IMPLIED>-->
<!-- <!ATTLIST xs:minLength id ID #IMPLIED>-->
<!-- <!ATTLIST xs:maxLength id ID #IMPLIED>-->
<!-- <!ATTLIST xs:enumeration id ID #IMPLIED>-->
<!-- <!ATTLIST xs:pattern id ID #IMPLIED>-->
<!-- <!ATTLIST xs:appinfo id ID #IMPLIED>-->
<!-- <!ATTLIST xs:documentation id ID #IMPLIED>-->
<!-- <!ATTLIST xs:list id ID #IMPLIED>-->
<!-- <!ATTLIST xs:union id ID #IMPLIED>-->
<!ELEMENT hfp:hasProperty EMPTY>
<!ATTLIST hfp:hasProperty
name NMTOKEN #REQUIRED
value CDATA #REQUIRED>
<!--
Make sure that processors that do not read the external
subset will know about the various IDs we declare
-->
<!ATTLIST xs:simpleType id ID #IMPLIED>
<!ATTLIST xs:maxExclusive id ID #IMPLIED>
<!ATTLIST xs:minExclusive id ID #IMPLIED>
<!ATTLIST xs:maxInclusive id ID #IMPLIED>
<!ATTLIST xs:minInclusive id ID #IMPLIED>
<!ATTLIST xs:totalDigits id ID #IMPLIED>
<!ATTLIST xs:fractionDigits id ID #IMPLIED>
<!ATTLIST xs:length id ID #IMPLIED>
<!ATTLIST xs:minLength id ID #IMPLIED>
<!ATTLIST xs:maxLength id ID #IMPLIED>
<!ATTLIST xs:enumeration id ID #IMPLIED>
<!ATTLIST xs:pattern id ID #IMPLIED>
<!ATTLIST xs:appinfo id ID #IMPLIED>
<!ATTLIST xs:documentation id ID #IMPLIED>
<!ATTLIST xs:list id ID #IMPLIED>
<!ATTLIST xs:union id ID #IMPLIED>
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- fileIndex.xsd version 0.9.5 -->
<!-- Rigsarkivet 2016 -->
<xs:schema xmlns="http://www.sa.dk/xmlns/diark/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.sa.dk/xmlns/diark/1.0" elementFormDefault="qualified" attributeFormDefault="unqualified" blockDefault="#all" finalDefault="#all" version="0.9.5" id="fileIndex">
<xs:annotation>
<xs:documentation xml:lang="da">Dette skema angiver tilladte mappenavne og filnavne, men ikke hvilke filnavne, som er tilladt i hvilke mapper. Denne begrænsning skyldes ønsket om at anvende samme elementnavn 'foN' for alle mappenavne, og XML Schema tillader ikke at samme element kan være af forskellig type (Consistent Declaration Rule)</xs:documentation>
<xs:documentation xml:lang="en">This Schema defines legal folder names and file names, but not what file names are allowed in what folders. This limitation is due to a desire to use the same element name 'foN' for all folder names, and XML Schema does not allow the same element name to belong to different types (Consistent Declaration Rule)</xs:documentation>
</xs:annotation>
<xs:element name="fileIndex" type="fileIndexType" block="#all" final="#all"/>
<xs:complexType name="fileIndexType">
<xs:annotation>
<xs:documentation xml:lang="da">Indeks for alle filer i arkiveringsversionen</xs:documentation>
<xs:documentation xml:lang="en">Index for all files in the information package</xs:documentation>
</xs:annotation>
<xs:sequence maxOccurs="unbounded">
<xs:element name="f">
<xs:complexType>
<xs:sequence>
<xs:element name="foN" type="folderNameType"/>
<xs:element name="fiN" type="fileNameType"/>
<xs:element name="md5" type="checkSumType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="folderNameType">
<xs:annotation>
<xs:documentation xml:lang="da">Navn for en mappe i arkiveringsversionen</xs:documentation>
<xs:documentation xml:lang="en">Name for a folder in the information package</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="AVID\.[A-ZÆØÅ]{2,4}\.[1-9][0-9]*\.[1-9][0-9]*\\ContextDocumentation\\docCollection((10000)|([1-9][0-9]{0,3}))\\[1-9][0-9]{0,11}">
<xs:annotation>
<xs:documentation xml:lang="da">Højst 10.000 docCollection mapper per ContextDocumentation mappe</xs:documentation>
<xs:documentation xml:lang="en">Maximum of 10.000 docCollection folders per ContextDocumentation folder</xs:documentation>
</xs:annotation>
</xs:pattern>
<xs:pattern value="AVID\.[A-ZÆØÅ]{2,4}\.[1-9][0-9]*\.[1-9][0-9]*\\Documents\\docCollection((10000)|([1-9][0-9]{0,3}))\\[1-9][0-9]{0,11}">
<xs:annotation>
<xs:documentation xml:lang="da">Højst 10.000 docCollection mapper per Documents mappe</xs:documentation>
<xs:documentation xml:lang="en">Maximum of 10.000 docCollection folders per Documents folder</xs:documentation>
</xs:annotation>
</xs:pattern>
<xs:pattern value="AVID\.[A-ZÆØÅ]{2,4}\.[1-9][0-9]*\.[1-9][0-9]*\\Indices"/>
<xs:pattern value="AVID\.[A-ZÆØÅ]{2,4}\.[1-9][0-9]*\.[1-9][0-9]*\\Schemas\\(localShared|standard)"/>
<xs:pattern value="AVID\.[A-ZÆØÅ]{2,4}\.[1-9][0-9]*\.[1-9][0-9]*\\Tables\\table[1-9][0-9]{0,11}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="fileNameType">
<xs:annotation>
<xs:documentation xml:lang="da">type for et filnavn i arkiveringversionen</xs:documentation>
<xs:documentation xml:lang="en">type for a file name in the information package</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:annotation>
<xs:documentation xml:lang="da">Små bogstaver (minuskler) for filtyper (suffix) er krævet i bekendtgørelse, men store bogstaver (versaler) er tilladt i Schemaet for at mindske behov for navneændring</xs:documentation>
<xs:documentation xml:lang="en">Lower case is required, but upper case for the following file type extensions is accepted to reduce the needed for renaming--></xs:documentation>
</xs:annotation>
<xs:pattern value="archiveIndex.xml|docIndex.xml|contextDocumentationIndex.xml|fileIndex.xml|tableIndex.xml"/>
<xs:pattern value="archiveIndex.xsd|docIndex.xsd|contextDocumentationIndex.xsd|fileIndex.xsd|tableIndex.xsd|XMLSchema.xsd"/>
<xs:pattern value="basicTypes.xsd|coordinateOperations.xsd|coordinateReferenceSystems.xsd|coordinateSystems.xsd|coverage.xsd|dataQuality.xsd|datums.xsd|defaultStyle.xsd|dictionary.xsd|direction.xsd|dynamicFeature.xsd|feature.xsd|geometryAggregates.xsd|geometryBasic0d1d.xsd|geometryBasic2d.xsd|geometryComplexes.xsd|geometryPrimitives.xsd|gml.xsd|gmlBase.xsd|grids.xsd|measures.xsd|observation.xsd|referenceSystems.xsd|smil20.xsd|smil20-language.xsd|temporal.xsd|temporalReferenceSystems.xsd|temporalTopology.xsd|topology.xsd|units.xsd|valueObjects.xsd|xlinks.xsd|xml-mod.xsd"/>
<xs:pattern value="table[1-9][0-9]{0,11}\.(xml|XML|xsd|XSD)"/>
<xs:pattern value="[1-9][0-9]{0,11}\.(tif|TIF)"/>
<xs:pattern value="[1-9][0-9]{0,11}\.(mp3|MP3)"/>
<xs:pattern value="[1-9][0-9]{0,11}\.(mpg|MPG)"/>
<xs:pattern value="[1-9][0-9]{0,11}\.(jp2|JP2)"/>
<xs:pattern value="[1-9][0-9]{0,11}\.(gml|GML)"/>
<xs:pattern value="[1-9][0-9]{0,11}\.(xsd|XSD)"/>
<xs:pattern value="[1-9][0-9]{0,11}\.(wav|WAV)"/>
<xs:pattern value="localSchema[1-9][0-9]{0,11}\.(xsd|XSD)"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="checkSumType">
<xs:annotation>
<xs:documentation xml:lang="da">Dette er en MD5 kontrolsum med et resultat på 128 bit svarende til 16 bytes repræsenteret som 32 hexadecimale tegn</xs:documentation>
<xs:documentation xml:lang="en">This is a MD5 checksum with a result of 128 bit equalt to 16 bytes represented as 32 characters in hexadecimal</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:hexBinary">
<xs:length value="16"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
3 changes: 3 additions & 0 deletions dbptk-bindings/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@
<!-- specify the schema to convert -->
<schemaDirectory>${basedir}/src/main/resources/schema</schemaDirectory>
<schemaIncludes>
<include>archiveIndex.xsd</include>
<include>docIndex.xsd</include>
<!-- <include>contextDocumentationIndex.xsd</include>-->
<include>fileIndex.xsd</include>
<include>XMLSchema.xsd</include>
<include>tableIndex.xsd</include>
<include>siard2-1-metadata.xsd</include>
<include>siard2-0-metadata.xsd</include>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<f>
<foN>AVID.HEX.2000.1\Schemas\standard</foN>
<fiN>fileIndex.xsd</fiN>
<md5>BC828D70D073029CE8C5FDBC6651C4F3</md5>
<md5>143BEC3B0E6D43E52B539F2CCD0B7A68</md5>
</f>
<f>
<foN>AVID.HEX.2000.1\Schemas\standard</foN>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<f>
<foN>AVID.TST.4000.1\Schemas\standard</foN>
<fiN>fileIndex.xsd</fiN>
<md5>D41D8CD98F00B204E9800998ECF8427E</md5>
<md5>143BEC3B0E6D43E52B539F2CCD0B7A68</md5>
</f>
<f>
<foN>AVID.TST.4000.1\Schemas\standard</foN>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
<xs:pattern value="[1-9][0-9]{0,11}\.(gml|GML)"/>
<xs:pattern value="[1-9][0-9]{0,11}\.(xsd|XSD)"/>
<xs:pattern value="[1-9][0-9]{0,11}\.(wav|WAV)"/>
<xs:pattern value="[1-9][0-9]{0,11}\.(bin)"/>
<xs:pattern value="localSchema[1-9][0-9]{0,11}\.(xsd|XSD)"/>
</xs:restriction>
</xs:simpleType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ public void writeMetadataXSD(DatabaseStructure dbStructure, SIARDArchiveContaine
writeSchemaFile(outputContainer, SIARDDKConstants.TABLE_INDEX, writeStrategy);
writeSchemaFile(outputContainer, SIARDDKConstants.ARCHIVE_INDEX, writeStrategy);
writeSchemaFile(outputContainer, SIARDDKConstants.CONTEXT_DOCUMENTATION_INDEX, writeStrategy);
writeSchemaFile(outputContainer, SIARDDKConstants.FILE_INDEX + "_original", writeStrategy);
writeSchemaFile(outputContainer, SIARDDKConstants.FILE_INDEX, writeStrategy);
if (lobsTracker.getLOBsCount() > 0) {
writeSchemaFile(outputContainer, SIARDDKConstants.DOC_INDEX + "_original", writeStrategy);
writeSchemaFile(outputContainer, SIARDDKConstants.DOC_INDEX, writeStrategy);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,11 @@ private boolean validateSIARDVersion(String version) {
switch (version) {
case "2.0":
case "2.1":
case "2.2":
case "DK":
case "1.0":
break;
default:
addWarning(A_M_511_1, "The version of SIARD should be 1.0, DK, 2.0, 2.1 or 2.2. Found: " + version,
addWarning(A_M_511_1, "The version of SIARD should be 1.0, DK, 2.0 or 2.1. Found: " + version,
"siardArchive");
}
}
Expand Down

0 comments on commit 2a2747a

Please sign in to comment.