-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/acdh-oeaw/shawi-data
- Loading branch information
Showing
36 changed files
with
1,298 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[packages] | ||
jupyterlab = "*" | ||
sharepy = "*" | ||
saxonpy = "==0.0.2" | ||
nbconvert = "*" | ||
pexpect = "*" | ||
importlib-resources = "*" | ||
importlib_metadata = "*" | ||
zipp = "*" | ||
|
||
[dev-packages] | ||
|
||
[requires] | ||
python_version = "3.8" |
1,136 changes: 1,136 additions & 0 deletions
1,136
080_scripts_generic/080_02_Validation/Pipfile.lock
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "10b266e6-704d-42fd-97a9-10b949d258ef", | ||
"metadata": {}, | ||
"source": [ | ||
"# WIBARAB Data Validation workflow" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "fe888d08-b9a0-4b34-b00f-ddf3d8578648", | ||
"metadata": {}, | ||
"source": [ | ||
"**Author:** Daniel Schopper \n", | ||
"**Description:** This notebook automates the validation of WIBARAB FeatureDB documents. When finished, it should be ported to a non-interactive script which is triggered by a github action. \n", | ||
"**Last Change:** 2023-01-25" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "134100b6-fb65-4005-b443-4ce066cfc2b1", | ||
"metadata": {}, | ||
"source": [ | ||
"## Step 0: Setup" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 7, | ||
"id": "168ac7aa-17be-4d43-9948-2c1561704f76", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import io\n", | ||
"import os\n", | ||
"import requests\n", | ||
"import pathlib\n", | ||
"\n", | ||
"from pathlib import Path\n", | ||
"from urllib.parse import urlsplit\n", | ||
"from saxonpy import PySaxonProcessor, PyXdmValue\n", | ||
"from zipfile import ZipFile\n", | ||
"\n", | ||
"from datetime import datetime\n", | ||
"# from inspect import getmembers, signature" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 8, | ||
"id": "4130078c-f5c9-453d-a097-daee63e62729", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"def transform(s, xsl, o, parameters=[]):\n", | ||
" # no change in behavior\n", | ||
" proc.set_configuration_property(\"xi\", \"on\")\n", | ||
" saxon = proc.new_xslt_processor()\n", | ||
" saxon.set_source(file_name=os.path.abspath(s))\n", | ||
" for i in parameters:\n", | ||
" saxon.set_parameter(name=i, value=proc.make_string_value(parameters[i]))\n", | ||
" saxon.compile_stylesheet(stylesheet_file=os.path.abspath(xsl))\n", | ||
" saxon.set_output_file(os.path.abspath(o))\n", | ||
" saxon.transform_to_string()\n", | ||
" if saxon.exception_occurred():\n", | ||
" #print(getmembers(saxon))\n", | ||
" saxon.get_error_message(0)\n", | ||
" for i in range(saxon.exception_count()-1):\n", | ||
" print(saxon.get_error_message(0))\n", | ||
" print(os.path.abspath(s)+\" - \"+os.path.abspath(xsl)+\" -> \"+os.path.abspath(o)+\" failed\")\n", | ||
" return o # for chaining\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"id": "755ff6ce-51e3-4758-be5e-c3a778d8bb3e", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"## Step 1: Expand References\n", | ||
"\n", | ||
"The WIBARAB Feature Documents contain " | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.6" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.