acdh-arche-assets
A set of static assets used (mainly) for ARCHE data preprocessing
A set of static assets used (mainly) for ARCHE data preprocessing
To install packages from this channel, you must first login at the command line:
anaconda loginYou can then use the channel temporarily with conda or add it to your .condarc file for configured ongoing access. Learn more
Set of static assets used (mainly) for ARCHE data preprocessing or ARCHE information pages:
* URI normalization rules used within the ACDH-CH.\
(stored in AcdhArcheAssets/uriNormRules.json)
* Description of input data formats accepted by ARCHE.\
(stored in AcdhArcheAssets/formats.json)
The repository provides also Python 3 and PHP bindings for accessing those assets.
Install using pip3:
pip3 install acdh-arche-assets
Use with
from AcdhArcheAssets.uri_norm_rules import get_rules, get_normalized_uri, get_norm_id
print(f"{get_rules()}")
wrong_id = "http://sws.geonames.org/1232324343/linz.html"
good_id = get_normalized_uri(wrong_id)
print(good_id)
# "https://sws.geonames.org/1232324343/"
# extract ID from URL
norm_id = get_norm_id("http://sws.geonames.org/1232324343/linz.html")
print(norm_id)
# "1232324343"
from AcdhArcheAssets.file_formats import get_formats, get_by_mtype, get_by_extension
formats = get_formats()
matching_mapping = get_by_mtype('image/png')
matching_mapping = get_by_extension('png')
Install using using composer:
composer require acdh-oeaw/arche-assets
Usage with
require_once 'vendor/autoload.php';
print_r(acdhOeaw\UriNormRules::getRules());
print_r(acdhOeaw\UriNormRules::getRules(['viaf', 'gnd']));
print_r(acdhOeaw\ArcheFileFormats::getAll();
print_r(acdhOeaw\ArcheFileFormats::getByMime('application/json');
print_r(acdhOeaw\ArcheFileFormats::getByExtension('application/json');
Each rule consists of five properties:
name: a rule namematch: a regular expression matching a given URI namespacereplace: a regular expression replace expression normalizing an URI in a given namespaceresolve: a regular expression replace expression transforming an URI in a given namespace to an URL fetching an RDF dataformat: a RDF serialization format to be requested while resolving the URL produced using the resolve fieldA curated and growing list of file extensions. For each file extension mappings to the respective ARCHE Resource Type Category (stored in acdh:hasCategory) and Media Type (MIME type) (stored in acdh:hasFormat) are given. The indicated Media Type should only be used as a fallback; it is best practice to rely on automated Media Type detection based on file signatures.
Further information is provided as well.
install needed developement packages pip install requirements_dev.txt
toxcoverage run setup.py test and coverage htmlflake8Summary
A set of static assets used (mainly) for ARCHE data preprocessing
Last Updated
Apr 24, 2026 at 16:39
License
MIT