Your browser doesn’t support the features required by impress.mod.js, so you are presented with a simplified version of this presentation.

For the best experience please use the latest Chrome, Safari or Firefox browser.

2019-03-26 | Mainz

DHd 2019 multimedial & multimodal

RDF-Lifting aus TEI

LOD am Anwendungsbeispiel STURM-Briefe

Slides: Link

Julian Jarosch | @digicademy | Twitter digicademy | CC-BY 4.0

Inhalte

  1. Die STURM-Edition
  2. Pelagios und Peripleo
  3. RDF-Lifting einer Pelagios Dataset Summary aus TEI mit XTriples

01

Die STURM-Edition

Kontext

https://sturm-edition.de

Kodierungsbeispiel

                

<p>
    In einer niederrheinischen Zeitung soll von einer bevorstehenden großen
    Ausstellung in <placeName key="O.0000045"
    ref="http://sws.geonames.org/2952539" >Barmen</placeName> von 
    <persName key="P.0000009" ref="http://d-nb.info/gnd/118559737">Kandinsky</persName>
    mir u.s.w. berichtet worden sein; […] ich bin natürlich einverstanden,
    nur soll die frei<hi rend="underline">e Rück</hi>fracht
    <placeName key="O.0000045" ref="http://sws.geonames.org/2952539"
    >Barmen</placeName> – <placeName key="O.0000002"
    ref="http://sws.geonames.org/2950157">Berlin</placeName> gesichert sein.
    Aber es ist natürlich nur Vermutung von mir. Von <persName key="P.0000057"
    ref="http://d-nb.info/gnd/143669230">Reiche</persName> höre ich gar nichts.
</p>
    
                
            

https://sturm-edition.de/id/Q.01.19140115.FMA.01

Schnittstellen

https://sturm-edition.de/ressourcen/schnittstellen.html

02

Pelagios und Peripleo

Kontext

https://peripleo.pelagios.org/ui

Grundstruktur Pelagios Dataset Summary

Präfixe

Einmalig zu Beginn der RDF-Datei zu deklarieren

                
@prefix cnt: <http://www.w3.org/2011/content#> . 
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix oa: <http://www.w3.org/ns/oa#> .
@prefix pelagios: <http://pelagios.github.io/vocab/terms#> .
@prefix relations: <http://pelagios.github.io/vocab/relations#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema> .
                
            

Grundstruktur Pelagios Dataset Summary

Beschriebenes Objekt

Wird wiederholt für jedes beschriebene Objekt

                
# RDF-Typ
<http://example.org/pelagios/dump.ttl#items/00l>
    a pelagios:AnnotatedThing ;

# Notwendige Statements
    # Titel
    dcterms:title "Honorific inscription of Ostia" ;
    # Homepage
    foaf:homepage <http://edh-www.adw.uni-heidelberg.de/...> ;

# Optionale Statements
    dcterms:description "Honorific inscription, findspot Ostia" ;
    dcterms:temporal "366/402" ;
    dcterms:temporal <http://n2t.net/ark:/99152/p03wskd389m> ;
    dcterms:language "la" ;
    dcterms:subject "inscription" ;
    .
                
            

Grundstruktur Pelagios Dataset Summary

Ortsbezüge

Wird wiederholt für jeden Ortsbezug von jedem Objekt

                
# RDF-Typ
<http://example.org/pelagios/dump.ttl#items/00l/annotations/01>
    a oa:Annotation ;

# Notwendige Statements
    # Verweis auf beschriebenes Objekt
    oa:hasTarget <http://example.org/pelagios/dump.ttl#items/00l> ;
    # Verweis auf Geo-Normdatensatz
    oa:hasBody <http://pleiades.stoa.org/places/422995> ;

# Optionale Statements
    pelagios:relation relations:foundAt ;
    oa:hasBody [ cnt:chars "POINT (41.755740099 12.290938199)";
                 dcterms:format "application/wkt" ] ;
    oa:annotatedAt "2014-11-05T10:18:00Z"^^xsd:date ;
    .
                
            

03

RDF-Lifting einer Pelagios Dataset Summary aus TEI

Generische Grundstruktur XTriples-Konfiguration

https://xtriples.lod.academy

                
<xtriples>
    <configuration>
        <vocabularies>
            <vocabulary prefix="###MY_NAMESPACE_PREFIX###" uri="###MY_NAMESPACE_URI###"/>
            <vocabulary prefix="rdf" uri="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
        </vocabularies>
        <triples>
            <statement>
                <subject prefix="###MY_NAMESPACE_PREFIX###">###XPATH###</subject>
                <predicate prefix="rdf">about</predicate>
                <object type="literal">###XPATH###</object>
            </statement>
        </triples>
    </configuration>
    <collection uri="###MY_COLLECTION_URI###">
        <resources uri="{###XPATH###}"/>
    </collection>
</xtriples>
                
            

Schritt 1

Einen einzelnen STURM-Brief als Quelle konfigurieren

                
<collection>
    <resources uri="https://sturm-edition.de/api/files/Q.01.19140115.FMA.01.xml"/>
</collection>
                
            

… später kommen wir auf Crawling von Collections zurück!

Schritt 1

Präfixe entsprechend Pelagios definieren

                
<vocabularies>
    <vocabulary prefix="rdf" uri="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
    <vocabulary prefix="cnt" uri="http://www.w3.org/2011/content#"/>
    <vocabulary prefix="dcterms" uri="http://purl.org/dc/terms/"/>
    <vocabulary prefix="foaf" uri="http://xmlns.com/foaf/0.1/"/>
    <vocabulary prefix="oa" uri="http://www.w3.org/ns/oa#"/>
    <vocabulary prefix="pelagios" uri="http://pelagios.github.io/vocab/terms#"/>
    <vocabulary prefix="relations" uri="http://pelagios.github.io/vocab/relations#"/>
    <vocabulary prefix="xsd" uri="http://www.w3.org/2001/XMLSchema"/>
</vocabularies>
                
            

Schritt 1

Weitere Präfixe

Wir wollen XPath für ein TEI-Dokument nutzen – der Namespace muss angegeben werden!

                
<vocabulary prefix="tei" uri="http://www.tei-c.org/ns/1.0"/>
                
            

Die STURM-URIs haben eine Basis-URL, die auch als Präfix gesetzt werden kann:

                
<vocabulary prefix="sturm" uri="https://sturm-edition.de/id/"/>
                
            

Schritt 2

Das erste Statement zum beschriebenen Objekt

Subjekt: URI des STURM-Briefes, bestehend aus der ID des Briefes und dem STURM-Präfix

<subject prefix="sturm" type="uri">/tei:TEI/@xml:id</subject>

Prädikat: RDF-type

<predicate prefix="rdf">type</predicate>

Objekt: ein Pelagios-AnnotatedThing

<object prefix="pelagios" type="uri">AnnotatedThing</object>

                
<xtriples>
    <configuration>
        <vocabularies>
            <vocabulary prefix="tei" uri="http://www.tei-c.org/ns/1.0"/>
            <vocabulary prefix="sturm" uri="https://sturm-edition.de/id/"/>
            <vocabulary prefix="rdf" uri="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
            <vocabulary prefix="cnt" uri="http://www.w3.org/2011/content#"/>
            <vocabulary prefix="dcterms" uri="http://purl.org/dc/terms/"/>
            <vocabulary prefix="foaf" uri="http://xmlns.com/foaf/0.1/"/>
            <vocabulary prefix="oa" uri="http://www.w3.org/ns/oa#"/>
            <vocabulary prefix="pelagios" uri="http://pelagios.github.io/vocab/terms#"/>
            <vocabulary prefix="relations" uri="http://pelagios.github.io/vocab/relations#"/>
            <vocabulary prefix="xsd" uri="http://www.w3.org/2001/XMLSchema"/>
        </vocabularies>
        <triples>
            <statement>
                <subject prefix="sturm" type="uri">/tei:TEI/@xml:id</subject>
                <predicate prefix="rdf">type</predicate>
                <object prefix="pelagios" type="uri">AnnotatedThing</object>
            </statement>
        </triples>
    </configuration>
    <collection>
        <resource uri="https://sturm-edition.de/api/files/Q.01.19150315.FMA.02.xml"/>
    </collection>
</xtriples>
                
            

Schritt 2

Notwendige Statements

Subjekt ist weiterhin das beschriebene Objekt – der STURM-Brief

                
<statement>
    <subject prefix="sturm" type="uri">/tei:TEI/@xml:id</subject>
    <predicate prefix="dcterms">title</predicate>
    <object type="literal">/normalize-space(./tei:TEI/tei:teiHeader/tei:fileDesc/tei:titleStmt/tei:title)</object>
</statement>
<statement>
    <subject prefix="sturm" type="uri">/tei:TEI/@xml:id</subject>
    <predicate prefix="foaf">homepage</predicate>
    <!-- Hier wird die in der Datei kodierte URI verwendet; de facto identisch mit der <subject>-URI -->
    <object type="uri">/tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:idno[@type="uri"]</object>
</statement>
                
            

Ergebnis

Schritt 3

Das erste Statement zur Ortserwähnung

                
<statement>
    <subject prefix="sturm" type="uri">/tei:TEI/tei:text/tei:body//tei:placeName/@key</subject>
    <predicate prefix="rdf">type</predicate>
    <object prefix="oa" type="uri">Annotation</object>
</statement>
                
            

Schritt 3

Das zweite Statement zur Ortserwähnung

Subjekt ist weiterhin die Annotation – die Ortserwähnung

                
<statement>
    <subject prefix="sturm" type="uri">/tei:TEI/tei:text/tei:body//tei:placeName/@key</subject>
    <predicate prefix="oa">hasTarget</predicate>
    <object prefix="sturm" type="uri">/tei:TEI/@xml:id</object>
</statement>
                
            

Ergebnis

Schritt 3

1:1-Zuordnung von Ortserwähnung zu Geo-Normdatum

Subjekt ist weiterhin die Annotation – die Ortserwähnung

¿?¿?¿?¿?

Schritt 3

1:1-Zuordnung von Ortserwähnung zu Geo-Normdatum

Für die eindeutige 1:1-Zuordnung eines <placeName> zu einer Geo-URI brauchen wir eine Iteration:

                
<statement repeat="{/count(./tei:TEI/tei:text/tei:body//tei:placeName[@ref])}">
                
            

… die dann mit der Variable $repeatIndex wieder aufgegriffen wird:

                
<subject prefix="sturm" type="uri">/(tei:TEI/tei:text/tei:body//tei:placeName)[$repeatIndex]/@key</subject>
                
            

Schritt 4

Crawling

Voraussetzung ist eine XML-Liste der Ressourcen, z.B. aus einer REST-Schnittstelle

                
<collection uri="https://sturm-edition.de/api/letters" max="7">
                
            

Aus dieser Liste können mit XPath Ressourcen-Namen extrahiert und mit einer Basis-URL kombiniert werden

                    
<resource uri="https://sturm-edition.de/api/files/{/tei:TEI/tei:text/tei:body/tei:div/tei:list[@n='letters']//tei:item[@n='letter']/@xml:id}.xml" />
                    
                

Eine mögliche weitgehend vollständige Konfiguration

Konfiguration

Ergebnis

F I N I S

Thank you