Skip to content

Commit

Permalink
Schema
Browse files Browse the repository at this point in the history
  • Loading branch information
PonteIneptique committed Aug 23, 2024
1 parent e14976d commit e42d4c2
Show file tree
Hide file tree
Showing 3 changed files with 215 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,7 @@ See one of our test files to check out the minimal requirements: we have one
### Collection and Resource level guidelines

Collection and Resource level guidelines can be provided through file named dts-metadata.xml in each subfolder of a
given repository. We are currently looking at the reuse of former [Capitains V2 guidelines](https://github.com/Capitains/guidelines/blob/edde0323c2e94b3d0d687094e55cb32cac548752/capitains.rng)
given repository. We are currently looking at using external file that would help you ingest metadata, while leaving you
the option to load up metadata yourself.

The current schema for the collection catalog ingestion is available in [./tests/catalog/schema.rng](./tests/catalog/schema.rng).
21 changes: 21 additions & 0 deletions tests/catalog/example-collection.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<?oxygen RNGSchema="schema.rng" type="xml" ?>
<collection identifier="https://foo.bar/default">
<title>A collection</title>
<dublinCore>
<abstract xmlns="http://purl.org/dc/terms/">This is a perfect example of an absract.</abstract>
<abstract xmlns="http://purl.org/dc/terms/" xml:lang="fr">Et je peux traduire en français</abstract>
</dublinCore>
<members>
<resource identifier="https://foo.bar/text" path="../tei/base_tei.xml">
<title>A simple resource</title>
<description>With a description</description>
<dublinCore>
<title xmlns="http://purl.org/dc/terms/">A simple resource</title>
</dublinCore>
<extensions>
<something xmlns="https://foaf.com/foaf">Truc</something>
</extensions>
</resource>
</members>
</collection>
191 changes: 191 additions & 0 deletions tests/catalog/schema.rng
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
<?xml version="1.0" encoding="UTF-8"?>
<grammar
xmlns="http://relaxng.org/ns/structure/1.0"
xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<start>
<choice>
<ref name="resource"/>
<ref name="collection"/>
</choice>
</start>

<define name="identifier-and-path">
<group>
<attribute name="identifier">
<a:documentation>Identifier of the Collection or Resource</a:documentation>
<data type="anyURI"/>
</attribute>
<optional>
<attribute name="path">
<a:documentation>Path to the relevant Collection or Resource</a:documentation>
<data type="anyURI"/>
</attribute>
</optional>
</group>
</define>
<define name="parent">
<optional>
<element name="parent">
<a:documentation xml:lang="eng">Identifier of the parent if required by a parent
collection</a:documentation>
<data type="anyURI"/>
</element>
</optional>
</define>
<define name="baseDetails">
<element name="title">
<a:documentation>Title / name of a Collection or Resource</a:documentation>
<data type="string"/>
</element>
<optional>
<element name="description">
<a:documentation>Description of a Collection or Resource</a:documentation>
<data type="string"/>
</element>
</optional>
</define>
<define name="dublinCore">
<element name="dublinCore">
<interleave>
<zeroOrMore>
<element ns="http://purl.org/dc/terms/">
<a:documentation>Something</a:documentation>
<choice>
<name>abstract</name>
<name>accessRights</name>
<name>accrualMethod</name>
<name>accrualPeriodicity</name>
<name>accrualPolicy</name>
<name>alternative</name>
<name>audience</name>
<name>available</name>
<name>bibliographicCitation</name>
<name>conformsTo</name>
<name>contributor</name>
<name>coverage</name>
<name>created</name>
<name>creator</name>
<name>date</name>
<name>dateAccepted</name>
<name>dateCopyrighted</name>
<name>dateSubmitted</name>
<name>description</name>
<name>educationLevel</name>
<name>extent</name>
<name>format</name>
<name>hasFormat</name>
<name>hasPart</name>
<name>hasVersion</name>
<name>identifier</name>
<name>instructionalMethod</name>
<name>isFormatOf</name>
<name>isPartOf</name>
<name>isReferencedBy</name>
<name>isReplacedBy</name>
<name>isRequiredBy</name>
<name>issued</name>
<name>isVersionOf</name>
<name>language</name>
<name>license</name>
<name>mediator</name>
<name>medium</name>
<name>modified</name>
<name>provenance</name>
<name>publisher</name>
<name>references</name>
<name>relation</name>
<name>replaces</name>
<name>requires</name>
<name>rights</name>
<name>rightsHolder</name>
<name>source</name>
<name>spatial</name>
<name>subject</name>
<name>tableOfContents</name>
<name>temporal</name>
<name>title</name>
<name>type</name>
<name>valid</name>
</choice>
<optional>
<attribute name="xml:lang">
<data type="language"/>
</attribute>
</optional>
<data type="string"/>
</element>
</zeroOrMore>
</interleave>
</element>

</define>
<define name="extension">
<element>
<a:documentation>Structured metadata contains any other optional metadata that are not part of
DublinCore Terms namespace</a:documentation>
<name>extensions</name>
<zeroOrMore>
<element>
<anyName>
<except>
<nsName ns="http://purl.org/dc/terms/"/>
</except>
</anyName>
<optional>
<attribute name="xml:lang">
<data type="language"/>
</attribute>
</optional>
<text/>
</element>
</zeroOrMore>
</element>
</define>
<define name="members">
<a:documentation>Children member of a collection or ressource</a:documentation>
<element>
<name>members</name>
<interleave>
<oneOrMore>
<choice>
<ref name="collection"/>
<ref name="resource"/>
<element>
<a:documentation>Relative link to a secondary collection file</a:documentation>
<choice>
<name>collection</name>
<name>resource</name>
</choice>
<ref name="identifier-and-path"/>
</element>
</choice>
</oneOrMore>
</interleave>
</element>
</define>
<define name="collection-pattern">
<ref name="identifier-and-path"/>
<ref name="parent"/>
<ref name="baseDetails"/>
<optional>
<ref name="dublinCore"/>
</optional>
<optional>
<ref name="extension"/>
</optional>
<optional>
<ref name="members"/>
</optional>
</define>
<define name="resource">
<element name="resource">
<ref name="collection-pattern"/>
</element>
</define>
<define name="collection">
<element name="collection">
<ref name="collection-pattern"/>
</element>
</define>
</grammar>

0 comments on commit e42d4c2

Please sign in to comment.