<placeName>
-Tags in <body>
<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/ressourcen/schnittstellen.html
https://peripleo.pelagios.org/ui
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> .
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" ;
.
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 ;
.
<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>
<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!
<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>
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/"/>
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>
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>
<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>
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>
Subjekt ist weiterhin die Annotation – die Ortserwähnung
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>
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" />