Skip to content

Commit

Permalink
Merge pull request #107 from emt-project/105-add-script-to-download-i…
Browse files Browse the repository at this point in the history
…mages-from-transkribus

105 add script to download images from transkribus
  • Loading branch information
csae8092 authored Dec 10, 2024
2 parents 950eed5 + 7797862 commit 62e15dd
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion arche__filechecker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ docker run \
--rm \
--network="host" \
-v ${PWD}/fc_out:/reports \
-v ${PWD}/to_ingest:/data \
-v ${PWD}/img:/data \
--entrypoint arche-filechecker \
acdhch/arche-ingest \
--overwrite --skipWarnings --html /data /reports
Expand Down
2 changes: 1 addition & 1 deletion arche__ingest_binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

echo "ingest binaries for ${TOPCOLID} into ${ARCHE}"
docker run --rm \
-v ${PWD}/to_ingest:/data \
-v ${PWD}/img:/data \
--network="host" \
--entrypoint arche-import-binary \
acdhch/arche-ingest \
Expand Down
2 changes: 1 addition & 1 deletion arche_seed_files/arche_constants.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
acdh:hasCoverageEndDate "1716-01-31"^^xsd:date ;
acdh:hasLifeCycleStatus <https://vocabs.acdh.oeaw.ac.at/archelifecyclestatus/active> ;
acdh:hasCompleteness "Diese Sammlung wird sukzessive erweitert."@de ;
acdh:hasUrl "https://emt.acdh-dev.oeaw.ac.at" ;
acdh:hasUrl "https://kaiserin-eleonora.oeaw.ac.at/" ;
acdh:hasSubject "digital edition"@en ;
acdh:hasSubject "Digitale Edition"@de ;
acdh:hasSubject "Epistolary correspondence"@en ;
Expand Down
19 changes: 17 additions & 2 deletions make_arche_rdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
g = Graph().parse("arche_seed_files/arche_constants.ttl")
g_repo_objects = Graph().parse("arche_seed_files/repo_objects_constants.ttl")
TOP_COL_URI = URIRef("https://id.acdh.oeaw.ac.at/emt")
APP_URL = "https://emt.acdh-dev.oeaw.ac.at/"
APP_URL = "https://kaiserin-eleonora.oeaw.ac.at/"

ACDH = Namespace("https://vocabs.acdh.oeaw.ac.at/schema#")
COLS = [ACDH["TopCollection"], ACDH["Collection"], ACDH["Resource"]]
Expand Down Expand Up @@ -49,6 +49,15 @@
cur_doc_uri = URIRef(f"{TOP_COL_URI}/{cur_doc_id}")
g.add((cur_doc_uri, RDF.type, ACDH["Resource"]))
g.add((cur_doc_uri, ACDH["isPartOf"], cur_col_uri))
g.add(
(
cur_doc_uri,
ACDH["hasUrl"],
Literal(
f"{APP_URL}{cur_doc_id.replace(".xml", ".html")}", datatype=XSD.anyURI
),
)
)
g.add(
(
cur_doc_uri,
Expand Down Expand Up @@ -169,7 +178,13 @@
entity_id = y.xpath("./*[@type='GEONAMES']/text()")[0]
entity_uri = URIRef(entity_id)
g.add((entity_uri, RDF.type, ACDH["Place"]))
# g.add((entity_uri, ACDH["hasUrl"], Literal(f"{APP_URL}{xml_id}", datatype=XSD.anyURI)))
g.add(
(
entity_uri,
ACDH["hasUrl"],
Literal(f"{APP_URL}{xml_id}", datatype=XSD.anyURI),
)
)
g.add((entity_uri, ACDH["hasTitle"], Literal(entity_title, lang="und")))
g.add((cur_col_uri, ACDH["hasSpatialCoverage"], entity_uri))
g.add((cur_doc_uri, ACDH["hasSpatialCoverage"], entity_uri))
Expand Down
5 changes: 4 additions & 1 deletion make_cmif.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@
excluded.add(x)
continue
item_label = make_entity_label(item_node.xpath("./*[1]")[0])[0]
item_gnd = item_node.xpath("./tei:idno[@type='GND']/text()", namespaces=NSMAP)[0]
try:
item_gnd = item_node.xpath("./tei:idno[@type='GND']/text()", namespaces=NSMAP)[0]
except IndexError:
item_gnd = False
item["receiver_label"] = item_label
item["receiver_gnd"] = item_gnd

Expand Down

0 comments on commit 62e15dd

Please sign in to comment.