In Epigraf erfasste Inhalte können konform zum Resource Description Framework als Tripel exportiert werden. Die Struktur und die Auszeichnung der Daten durch LOD-Vokabulare wird in der Konfiguration auf der Ebene von Artikeln (articles), Abschnitten (sections) und Inhalten (items) festgelegt.
Dazu werden im triples-Schlüssel sowohl die Namensräume als auch Templates für Subjekt-Prädikat-Objekt-Aussagen festgelegt. Diese Templates können Kombinationen aus Literalen mit Platzhaltern enthalten. Die Platzhalter werden durch die Inhalte des Objekts ersetzt, für den das Tripel definiert wurde. Beispielsweise wird der Platzhalter {iri}
in der Artikelkonfiguration zur IRI des Artikels aufgelöst.
Artikel
Beispiel für die Konfiguration eines Artikels:
"triples" : {
"base": "https://epigraf.inschriften.net/iri/",
"namespaces": {
"epi": "https://epigraf.inschriften.net/iri/",
"schema":"https://schema.org/"
},
"templates": [
{
"comment": "The article has a title.",
"subject": "epi:{iri}#",
"predicate": "schema:title",
"object": "{name}"
},
{
"comment": "The article is about inscriptions.",
"subject": "epi:{iri}#",
"predicate": "schema:about",
"object": "epi:{iri}#inscriptions"
}
]
}
Beispielausgabe in JSON-LD für eine Inschrift im Schweriner Dom St. Marien und St. Johannis.
{
"@context": {
"epi": "http:\/\/epigraf.inschriften.net\/iri\/",
"schema": "https:\/\/schema.org\/"
},
"@set": [
{
"@id": "epi:articles\/epi-article\/playground~1623#",
"schema:title": "Sarg f\u00fcr Anna Sophia, Herzogin zu Mecklenburg",
"schema:about": "epi:articles\/epi-article\/playground~1623#inscriptions"
}
]
}
Abschnitte und Inhalte
Tripel können auch auf tieferen Ebenen als auf Artikelebene, das heißt in Abschnitten und Inhalten, generiert werden. Um von dort den Bezug zum Artikel herzustellen, kann in Platzhaltern das Schlüsselwort parent verwendet werden. Das folgende Beispiel zeigt eine Konfiguration für einen Abschnitt (section). Hier bezieht sich das Subjekt auf die IRI des Abschnitts zwei Ebenen darüber und verbindet damit die Inhalte (vom Typ transcriptions) mit dem Abschnitt.
"templates": [
{
"comment": "An inscription has text",
"subject": "epi:{parent.parent.iri}",
"predicate": "schema:text",
"object": "{items.*[itemtype=transcriptions].content}"
}
]
Jobs
Data generated from jobs, i.e. when exporting data via pipelines, may refer to the job. Example:
{
"triples": {
"templates": [
{
"comment": "To which data feed does the article belong to?",
"subject": "epi:{iri}#dfi",
"predicate": "schema:isPartOf",
"object": "epi:{job.iri}"
}
}
Types
The type of a value is determined when rendering the triples. The result of an evaluated placeholder string may have one of the following types:
- IRI: Values that start with a prefix defined in the namespace configuration but need to be expanded to full IRIs due to content such as slashes, which are not allowed in prefixed names. IRIs starting with the base path are converted to relative IRIs.
- Prefixed Names: Values that start with a prefix defined in the namespace configuration and are not expanded to full IRIs. Example:
schema:title
. - Literatal: Literal values. Literal values are always trimmed.
- Typed literals: Literarl values ending with
^^
followed by a type such asschema:Date
.
Some expressions are converted, depending on the target format:
- Im TTL-Format wird das Prädikat
rdf:type
wenn der Namensraumrdf:
http://www.w3.org/1999/02/22-rdf-syntax-ns#
angegeben ist durcha
ersetzt. - Im RDF/XML-Format werden alle Aussagen in
rdf:Description
-Elementen mit dem Subjekt im Attributrdf:about
ausgegeben.
Ausgabe von Tabellen
Im Gegensatz zu einzelnen Artikeln, werden Tabellen (das heißt die Ausgabe der index-Endpunkte) immer als Hydra-Kollektionen ausgegeben.