Skip to content

Instantly share code, notes, and snippets.

@lueck
Last active September 25, 2025 08:53
Show Gist options
  • Select an option

  • Save lueck/96cb7f6cd73fcff4d16e5eca93797d24 to your computer and use it in GitHub Desktop.

Select an option

Save lueck/96cb7f6cd73fcff4d16e5eca93797d24 to your computer and use it in GitHub Desktop.
XTriples configuration for TEI from https://gams.uni-graz.at/cantus/

XTriples für so'n Kantatenzeug

Auffällig im TEI

Falsche IDREFs

Die Werte von /TEI/text/body/div/head/@corresp sind eine samedoc-Referenz mit IDREF, aber es existieren im selben Dokument keine Fragmente mit dieser ID.

Die Werte von @ana sind IDREFs, aber Fragmente mit den entsprechenden IDs fehlen.

Sprache fehlt

Das Wurzelelement sollte eine Sprachangabe haben: <TEI xml:lang="de">

<?xml-model uri="https://xtriples.lod.academy/xtriples.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<!DOCTYPE xtriples [
<!ATTLIST vocabularies xml:id ID #IMPLIED>
<!ATTLIST subject xml:id ID #IMPLIED>
]>
<xtriples xmlns:xi="http://www.w3.org/2001/XInclude">
<configuration>
<vocabularies>
<vocabulary prefix="ed" uri="https://gams.uni-graz.at/"/>
<vocabulary prefix="gams" uri="https://gams.uni-graz.at/o:gams-ontology/#"/>
<vocabulary prefix="cantus" uri="https://gams.uni-graz.at/cantus/"/>
<vocabulary prefix="grote" uri="https://gams.uni-graz.at/grotefend/"/>
<vocabulary prefix="rdau" uri="http://rdaregistry.info/Elements/u/"/>
<vocabulary prefix="skos" uri="http://www.w3.org/2004/02/skos/core#"/>
<vocabulary prefix="dc" uri="http://purl.org/dc/elements/1.1/"/>
<vocabulary prefix="rdf" uri="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
<vocabulary prefix="rdfs" uri="http://www.w3.org/2000/01/rdf-schema#"/>
<vocabulary prefix="foaf" uri="http://xmlns.com/foaf/0.1/"/>
<vocabulary prefix="rel" uri="http://purl.org/vocab/relationship/"/>
<vocabulary prefix="t" uri="http://www.tei-c.org/ns/1.0"/>
<vocabulary uri="http://www.tei-c.org/ns/1.0"/>
</vocabularies>
<triples>
<statement>
<subject xml:id="about" prefix="ed">/TEI/teiHeader/fileDesc//idno[@type='PID']</subject>
<predicate prefix="rdf">type</predicate>
<object prefix="cantus" type="uri">LO</object>
</statement>
<statement>
<subject prefix="ed">/TEI/teiHeader/fileDesc//idno[@type='PID']</subject>
<predicate prefix="gams">isMemberOf</predicate>
<object prefix="cantus" type="uri"></object>
</statement>
<statement>
<subject prefix="ed">/TEI/teiHeader/fileDesc//idno[@type='PID']</subject>
<predicate prefix="rdfs">label</predicate>
<object type="literal">/TEI/teiHeader/fileDesc/titleStmt//title[@type='short']</object>
</statement>
<statement>
<subject prefix="ed">/TEI/teiHeader/fileDesc//idno[@type='PID']</subject>
<predicate prefix="skos">preflabel</predicate>
<!-- The second predicate assumes that de is the default language. -->
<object type="literal" lang="de">/TEI/teiHeader/fileDesc/titleStmt//title[@type='short'][ancestor-or-self::*/@xml:lang='de' or not(ancestor-or-self::*/@xml:lang)]</object>
</statement>
<statement>
<subject prefix="ed">/TEI/teiHeader/fileDesc//idno[@type='PID']</subject>
<predicate prefix="skos">altLabel</predicate>
<object type="literal" lang="de">/TEI/teiHeader/fileDesc/titleStmt//title[@type='citation'][ancestor-or-self::*/@xml:lang='de' or not(ancestor-or-self::*/@xml:lang)]</object>
</statement>
<statement>
<subject prefix="ed">/TEI/teiHeader/fileDesc//idno[@type='PID']</subject>
<predicate prefix="skos">altLabel</predicate>
<object type="literal" lang="la">/TEI/teiHeader/fileDesc/titleStmt//title[@type='citation'][ancestor-or-self::*/@xml:lang='la']</object>
</statement>
<statement>
<subject prefix="ed">/TEI/teiHeader/fileDesc//idno[@type='PID']</subject>
<predicate prefix="dc">date</predicate>
<object type="literal" datatype="xsd:gYear">/TEI/teiHeader/fileDesc/sourceDesc/msDesc[1]//altIdentifier//date/@to</object>
</statement>
<statement>
<subject xml:id="about" prefix="ed">/TEI/teiHeader/fileDesc//idno[@type='PID']</subject>
<predicate prefix="dc">source</predicate>
<object type="literal">/TEI/teiHeader/fileDesc/sourceDesc/msDesc[1]//altIdentifier/idno</object>
</statement>
<statement>
<subject xml:id="about" prefix="ed">/TEI/teiHeader/fileDesc//idno[@type='PID']</subject>
<predicate prefix="rdau">P60052</predicate>
<object type="literal">/TEI/teiHeader/fileDesc/sourceDesc/msDesc[1]//altIdentifier/idno/@n</object>
</statement>
<!-- repeat for all the feasts -->
<statement repeat="/count(/TEI/text/body/div[head[matches(@xml:id, '^feast')]])">
<subject prefix="ed">/TEI/teiHeader/fileDesc//idno[@type='PID']</subject>
<predicate prefix="cantus">hasFeast</predicate>
<object type="uri" prefix="ed">/TEI/teiHeader/fileDesc//idno[@type='PID'] || '#' || (/TEI/text/body/div[head[matches(@xml:id, '^feast')]])[$repeatIndex]/head/@xml:id</object>
</statement>
</triples>
</configuration>
<collection uri="collection.xml">
</collection>
</xtriples>
<collection stable="true">
<doc href="https://gams.uni-graz.at/o:cantus.regensburg/TEI_SOURCE"/>
</collection>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment