Skip to content

Commit

Permalink
WIP: Tools for managing split authority files
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-morrison committed Jan 9, 2018
1 parent 1b2f587 commit 4918a85
Show file tree
Hide file tree
Showing 9 changed files with 757 additions and 8 deletions.
59 changes: 59 additions & 0 deletions authority/authority-schematron.sch
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>


<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<ns prefix="tei" uri="http://www.tei-c.org/ns/1.0"/>

<!-- currently, these are basic rules relating to correct entry of names and ids. Later they may be expanded to cover other areas. -->

<pattern>
<rule context="tei:person">
<assert test="matches(@xml:id, 'person_\d+')">The person element must have an xml:id attribute matching the pattern 'person_[digits]'</assert>
<assert test="count(tei:persName[@type='display']) = 1">One persName element only must have @type=display</assert>
</rule>
</pattern>


<pattern>
<rule context="tei:org">
<assert test="matches(@xml:id, 'org_\d+')">The org element must have an xml:id attribute matching the pattern 'org_[digits]'</assert>
<assert test="count(tei:orgName[@type='display']) = 1">One orgName element only must have @type=display</assert>
</rule>
<rule context="tei:place">
<assert test="matches(@xml:id, 'place_\d+')">The place element must have an xml:id attribute matching the pattern 'place_[digits]'</assert>
<assert test="count(tei:placeName[@type='index']) = 1">One placeName element only must have @type=index</assert>
</rule>
</pattern>


<pattern>
<rule context="tei:text/tei:body/tei:listBibl/tei:bibl">
<assert test="matches(@xml:id, 'work_\d+')">The bibl element must have an xml:id attribute matching the pattern 'work_[digits]'</assert>
<assert test="count(tei:title[@type='uniform']) = 1">One title element only must have @type=uniform</assert>
<assert test="tei:textLang[@mainLang]">Works should have language(s) specified in a textLang element which must have an attribute @mainLang</assert>

</rule>

</pattern>

<pattern>
<rule context="tei:text/tei:body/tei:listBibl/tei:bibl[not(tei:author)]">
<assert test="tei:note[@type='subject']">Works without an author should have one or more subject headings</assert>
</rule>
</pattern>

<!-- Import all the entries so that when editing an individual file checks can be made across all others -->
<let name="allpeople" value="doc('persons_master.xml')//tei:person"/>

<pattern>
<rule context="tei:person">
<let name="thisid" value="@xml:id"/>
<report test="count($allpeople[@xml:id eq $thisid]) gt 1" role="error">
The xml:id of <value-of select="$thisid"/> has been used elsewhere
</report>
</rule>
</pattern>

<!-- TODO: Similar code needed for other types of authority files -->

</schema>
144 changes: 144 additions & 0 deletions authority/british library/persons.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<?xml-model href="../authority-schematron.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
<fileDesc>
<titleStmt>
<title>Title</title>
</titleStmt>
<publicationStmt>
<p>Publication Information</p>
</publicationStmt>
<sourceDesc>
<p>Information about the source</p>
</sourceDesc>
</fileDesc>
</teiHeader>
<text>
<body>
<listPerson>

<person xml:id="person_21717206">
<!-- SAMPLE DATA COPIED FROM MEDIEVAL. DELETE BEFORE EDITING FOR REAL. -->
<persName type="display">Boethius, pseudo</persName>
<persName type="crossref">Pseudo-Boethius</persName>
<note type="links">
<list type="links">
<item>
<ref target="http://viaf.org/viaf/21717206">
<title>VIAF</title>
</ref>
</item>
</list>
</note>
<note type="source">This record contains information from <ref target="http://viaf.org/">VIAF (Virtual International Authority File)</ref> which is made available under the <ref target="http://opendatacommons.org/licenses/by/1.0/">ODC Attribution License</ref>.</note>
</person>


<person xml:id="person_40466384">
<!-- SAMPLE DATA COPIED FROM MEDIEVAL. DELETE BEFORE EDITING FOR REAL. -->
<persName type="display" source="LC bodl">Griffolini, Francesco, 1420-1491</persName>
<persName type="crossref" source="LC">Aretino, Francesco, 1418-1483</persName>
<persName type="variant" source="LC">Aretinus, Franciscus Griffolinus, 1418-1483</persName>
<persName type="variant" source="LC">Arretinus, Franciscus, 1418-1483</persName>
<persName type="variant" source="LC">Franciscus, Aretinus, 1418-1483</persName>
<persName type="crossref" source="LC">Francesco, d'Arezzo, 1418-1483</persName>
<persName type="variant" source="LC">Griffolinus, Franciscus, 1418-1483</persName>
<note>Humanist and translator; to be distinguished from the jurist Francesco Accolti.</note>
<note type="links">
<list type="links">
<item><ref target="http://id.loc.gov/authorities/names/n93804055.html"><title>LC</title></ref></item>
<item>
<ref target="http://www.treccani.it/enciclopedia/francesco-griffolini_%28Dizionario-Biografico%29/">
<title>DBI</title>
</ref>
</item>
<!-- BNF confuses with the jurist -->
<item>
<ref target="http://d-nb.info/gnd/129835021">
<title>GND</title>
</ref>
</item>
<item>
<ref target="http://www.mirabileweb.it/author/franciscus-griffolinus-aretinus-n-1420-m-1491-author/24182">
<title>Mirabile</title>
</ref>
</item>
</list>

</note>
<note type="source">This record contains information from <ref target="http://viaf.org/">VIAF (Virtual International Authority File)</ref> which is made available under the <ref target="http://opendatacommons.org/licenses/by/1.0/">ODC Attribution License</ref>.</note>
</person>

<person xml:id="person_172419710">
<!-- SAMPLE DATA COPIED FROM MEDIEVAL. DELETE BEFORE EDITING FOR REAL. -->
<!-- record originally created from https://viaf.org/viaf/172419710/viaf.xml at 2017-05-08 15:32:17.509859 -->
<persName type="display" subtype="forenameFirst" source="LC">Henry, VIII, King of England, 1491-1547</persName>
<persName type="variant" subtype="forenameFirst" source="DNB">Heinrich, 8, England ; König, 1491-1547</persName>
<persName type="variant" subtype="forenameFirst" source="DNB">Heinrich, VIII., König von England, 1491-1547</persName>
<persName type="variant" subtype="forenameFirst" source="DNB">Heinrich, VIII, King of England, 1491-1547</persName>
<persName type="variant" subtype="forenameFirst" source="DNB">Heinrich, VIII, König von England, 1491-1547</persName>
<persName type="variant" subtype="forenameFirst" source="DNB">Heinrich, VIII, Roi d'Angleterre, 1491-1547</persName>
<persName type="variant" subtype="forenameFirst" source="DNB">Heinricus, VIII, König von England, 1491-1547</persName>
<persName type="variant" subtype="forenameFirst" source="DNB">Henricus, VIII., Anglia, Rex, 1491-1547</persName>
<persName type="variant" subtype="forenameFirst" source="DNB">Henricus, VIII, Rex Anglorum, 1491-1547</persName>
<persName type="variant" subtype="forenameFirst" source="DNB">Henrie, VIII., Angleterre, Roi, 1491-1547</persName>
<persName type="variant" subtype="forenameFirst" source="DNB">Henri, VIII., 1491-1547</persName>
<persName type="variant" subtype="forenameFirst" source="DNB">Henri, VIII., Angleterre, Roi, 1491-1547</persName>
<persName type="variant" subtype="forenameFirst" source="DNB">Henri, VIII., Roi d'Angleterre, 1491-1547</persName>
<persName type="variant" subtype="forenameFirst" source="DNB">Henri, VIII, King of England, 1491-1547</persName>
<persName type="variant" subtype="forenameFirst" source="DNB">Henri, VIII, König von England, 1491-1547</persName>
<persName type="variant" subtype="forenameFirst" source="DNB">Henri, VIII, Roi d'Angleterre, 1491-1547</persName>
<persName type="variant" subtype="forenameFirst" source="DNB">Henry VIII., König von England, 1491-1547</persName>
<persName type="variant" subtype="forenameFirst" source="DNB">Henry, VIII., Angleterre, Roy, 1491-1547</persName>
<persName type="variant" subtype="forenameFirst" source="DNB">Henry, VIII., England, King, 1491-1547</persName>
<persName type="variant" subtype="forenameFirst" source="DNB">Henry, VIII., King of England, 1491-1547</persName>
<persName type="variant" subtype="forenameFirst" source="DNB">Henry, VIII, King of England, 1491-1547</persName>
<persName type="variant" subtype="forenameFirst" source="DNB">Henry, VIII, König von England, 1491-1547</persName>
<persName type="variant" subtype="forenameFirst" source="DNB">Henry, VIII, Roi d'Angleterre, 1491-1547</persName>
<birth source="VIAF">1491-06-28</birth>
<death source="VIAF">1547-01-28</death>
<note type="links">
<list type="links">
<item>
<ref target="http://catalogue.bnf.fr/ark:/12148/cb11988809r">
<title>BNF</title>
</ref>
</item>
<item>
<ref target="http://d-nb.info/gnd/118548204">
<title>GND</title>
</ref>
</item>
<item>
<ref target="http://id.loc.gov/authorities/names/n79113093">
<title>LC</title>
</ref>
</item>
<item>
<ref target="http://www.idref.fr/027303608/id">
<title>SUDOC</title>
</ref>
</item>
<item>
<ref target="http://www.wikidata.org/entity/Q38370">
<title>Wikidata</title>
</ref>
</item>
<item>
<ref target="https://viaf.org/viaf/172419710">
<title>VIAF</title>
</ref>
</item>
</list>
</note>
<note type="source">This record contains information from <ref target="http://viaf.org/">VIAF (Virtual International Authority File)</ref> which is made available under the <ref target="http://opendatacommons.org/licenses/by/1.0/">ODC Attribution License</ref>.</note>
</person>


</listPerson>
</body>
</text>
</TEI>
Loading

0 comments on commit 4918a85

Please sign in to comment.