tripper 0.4.3__tar.gz → 0.5.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tripper-0.4.3 → tripper-0.5.2}/.github/workflows/cd_release.yml +1 -1
- {tripper-0.4.3 → tripper-0.5.2}/.github/workflows/ci_tests.yml +11 -12
- {tripper-0.4.3 → tripper-0.5.2}/.gitignore +5 -0
- tripper-0.5.2/.hooks/generate-context-and-doc.sh +23 -0
- {tripper-0.4.3 → tripper-0.5.2}/.pre-commit-config.yaml +9 -6
- {tripper-0.4.3 → tripper-0.5.2}/CHANGELOG.md +113 -0
- {tripper-0.4.3 → tripper-0.5.2}/LICENSE +1 -1
- {tripper-0.4.3 → tripper-0.5.2}/PKG-INFO +9 -7
- {tripper-0.4.3 → tripper-0.5.2}/README.md +1 -1
- tripper-0.5.2/docs/api_reference/datadoc/prefixes.md +3 -0
- tripper-0.5.2/docs/api_reference/datadoc/utils.md +3 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/datadoc/customisation.md +113 -8
- {tripper-0.4.3 → tripper-0.5.2}/docs/datadoc/documenting-a-resource.md +87 -7
- {tripper-0.4.3 → tripper-0.5.2}/docs/datadoc/fetching-resources-from-a-triplestore.md +1 -1
- {tripper-0.4.3 → tripper-0.5.2}/docs/datadoc/introduction.md +0 -13
- tripper-0.5.2/docs/datadoc/keywords-process.md +573 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/datadoc/keywords.md +411 -421
- tripper-0.5.2/docs/datadoc/prefixes-process.md +37 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/datadoc/prefixes.md +29 -24
- {tripper-0.4.3 → tripper-0.5.2}/docs/developers.md +31 -5
- tripper-0.5.2/docs/figs/basic_relations.png +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/figs/dataset.drawio +247 -51
- {tripper-0.4.3 → tripper-0.5.2}/docs/index.md +1 -1
- {tripper-0.4.3 → tripper-0.5.2}/docs/session.md +33 -5
- {tripper-0.4.3 → tripper-0.5.2}/docs/tools/datadoc.md +5 -4
- {tripper-0.4.3 → tripper-0.5.2}/docs/tutorial.md +18 -0
- {tripper-0.4.3 → tripper-0.5.2}/examples/classdoc/mysimulation.yaml +6 -4
- {tripper-0.4.3 → tripper-0.5.2}/examples/workflow-mappings/workflow_mappings.py +5 -1
- {tripper-0.4.3 → tripper-0.5.2}/pyproject.toml +19 -9
- {tripper-0.4.3 → tripper-0.5.2}/tests/backends/datadocumentation_sample.yaml +5 -3
- {tripper-0.4.3 → tripper-0.5.2}/tests/backends/datadocumentation_sample2.yaml +5 -3
- tripper-0.4.3/tests/backends/test_sparqlwrapper_graphdb_fuseki.py → tripper-0.5.2/tests/backends/test_backends_sparql.py +36 -69
- {tripper-0.4.3 → tripper-0.5.2}/tests/backends/test_sparqlwrapper.py +3 -5
- {tripper-0.4.3 → tripper-0.5.2}/tests/datadoc/test_context.py +160 -5
- {tripper-0.4.3 → tripper-0.5.2}/tests/datadoc/test_dataaccess.py +12 -5
- {tripper-0.4.3 → tripper-0.5.2}/tests/datadoc/test_datadoc_cli.py +5 -2
- tripper-0.5.2/tests/datadoc/test_datadoc_utils.py +162 -0
- tripper-0.5.2/tests/datadoc/test_dataset.py +1154 -0
- tripper-0.5.2/tests/datadoc/test_keywords.py +807 -0
- tripper-0.5.2/tests/datadoc/test_prefixes.py +83 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/datadoc/test_tabledoc.py +165 -39
- tripper-0.5.2/tests/input/batchdata.csv +6 -0
- tripper-0.5.2/tests/input/custom_keywords.yaml +44 -0
- tripper-0.5.2/tests/input/invalid_keywords0.yaml +17 -0
- tripper-0.5.2/tests/input/invalid_keywords1.yaml +18 -0
- tripper-0.5.2/tests/input/invalid_keywords2.yaml +18 -0
- tripper-0.5.2/tests/input/invalid_keywords3.yaml +16 -0
- tripper-0.5.2/tests/input/invalid_keywords4.yaml +16 -0
- tripper-0.5.2/tests/input/invalid_keywords5.yaml +18 -0
- tripper-0.5.2/tests/input/invalid_keywords6.yaml +17 -0
- tripper-0.5.2/tests/input/invalid_keywords7.yaml +18 -0
- tripper-0.5.2/tests/input/invalid_keywords8.yaml +17 -0
- tripper-0.5.2/tests/input/invalid_keywords9.yaml +17 -0
- tripper-0.5.2/tests/input/keywords.csv +4 -0
- tripper-0.5.2/tests/input/new_keywords.csv +4 -0
- tripper-0.5.2/tests/input/semdata-context-ext.json +20 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/input/semdata-context.json +6 -7
- {tripper-0.4.3 → tripper-0.5.2}/tests/input/semdata.csv +3 -3
- {tripper-0.4.3 → tripper-0.5.2}/tests/input/semdata.yaml +4 -3
- {tripper-0.4.3 → tripper-0.5.2}/tests/input/session.yaml +8 -0
- tripper-0.5.2/tests/input/tem.xlsx +0 -0
- tripper-0.5.2/tests/input/valid_keywords.yaml +17 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/mappings/test_mappings.py +1 -4
- {tripper-0.4.3 → tripper-0.5.2}/tests/ontologies/family.ttl +62 -17
- {tripper-0.4.3 → tripper-0.5.2}/tests/output/.gitignore +2 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/test_add_function.py +3 -12
- {tripper-0.4.3 → tripper-0.5.2}/tests/test_namespace.py +26 -1
- {tripper-0.4.3 → tripper-0.5.2}/tests/test_session.py +8 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/test_sparql.py +25 -43
- {tripper-0.4.3 → tripper-0.5.2}/tests/test_triplestore.py +21 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/test_utils.py +91 -6
- {tripper-0.4.3 → tripper-0.5.2}/tests/units/test_units.py +5 -4
- {tripper-0.4.3 → tripper-0.5.2}/tripper/__init__.py +7 -1
- {tripper-0.4.3 → tripper-0.5.2}/tripper/backends/collection.py +1 -1
- {tripper-0.4.3 → tripper-0.5.2}/tripper/backends/rdflib.py +15 -19
- {tripper-0.4.3 → tripper-0.5.2}/tripper/backends/sparqlwrapper.py +38 -7
- {tripper-0.4.3 → tripper-0.5.2}/tripper/context/0.3/context.json +186 -67
- {tripper-0.4.3 → tripper-0.5.2}/tripper/context/0.3/keywords.yaml +164 -121
- tripper-0.5.2/tripper/context/0.3/prefixes.yaml +33 -0
- tripper-0.5.2/tripper/context/datadoc.ttl +159 -0
- tripper-0.5.2/tripper/context/owl-restrictions.json +13 -0
- {tripper-0.4.3 → tripper-0.5.2}/tripper/context/process/0.1/context.json +186 -67
- {tripper-0.4.3 → tripper-0.5.2}/tripper/context/process/0.1/keywords.yaml +12 -6
- {tripper-0.4.3 → tripper-0.5.2}/tripper/datadoc/__init__.py +3 -2
- {tripper-0.4.3 → tripper-0.5.2}/tripper/datadoc/clitool.py +32 -3
- {tripper-0.4.3 → tripper-0.5.2}/tripper/datadoc/context.py +272 -54
- {tripper-0.4.3 → tripper-0.5.2}/tripper/datadoc/dataaccess.py +4 -3
- {tripper-0.4.3 → tripper-0.5.2}/tripper/datadoc/dataset.py +432 -247
- tripper-0.5.2/tripper/datadoc/errors.py +74 -0
- tripper-0.5.2/tripper/datadoc/keywords.py +2130 -0
- tripper-0.5.2/tripper/datadoc/prefixes.py +75 -0
- tripper-0.5.2/tripper/datadoc/tabledoc.py +649 -0
- tripper-0.5.2/tripper/datadoc/utils.py +266 -0
- {tripper-0.4.3 → tripper-0.5.2}/tripper/errors.py +4 -0
- {tripper-0.4.3 → tripper-0.5.2}/tripper/interface.py +12 -0
- {tripper-0.4.3 → tripper-0.5.2}/tripper/mappings/mappings.py +1 -1
- {tripper-0.4.3 → tripper-0.5.2}/tripper/namespace.py +62 -0
- {tripper-0.4.3 → tripper-0.5.2}/tripper/triplestore.py +147 -8
- tripper-0.5.2/tripper/units/.gitignore +1 -0
- {tripper-0.4.3 → tripper-0.5.2}/tripper/units/units.py +3 -5
- {tripper-0.4.3 → tripper-0.5.2}/tripper/utils.py +179 -20
- tripper-0.4.3/.hooks/generate-context-and-doc.sh +0 -20
- tripper-0.4.3/tests/datadoc/test_dataset.py +0 -715
- tripper-0.4.3/tests/datadoc/test_keywords.py +0 -177
- tripper-0.4.3/tripper/datadoc/errors.py +0 -43
- tripper-0.4.3/tripper/datadoc/keywords.py +0 -580
- tripper-0.4.3/tripper/datadoc/tabledoc.py +0 -395
- {tripper-0.4.3 → tripper-0.5.2}/.github/dependabot.yml +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/.github/pull_request_template.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/.github/workflows/ci_automerge_dependency_prs.yml +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/.github/workflows/ci_cd_updated_main.yml +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/.github/workflows/ci_check_dependencies.yml +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/.github/workflows/ci_update_dependencies.yml +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/.hooks/markdown-doctest.sh +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/MANIFEST.in +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/CHANGELOG.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/LICENSE.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/.pages +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/backends/.pages +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/backends/collection.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/backends/ontopy.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/backends/rdflib.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/backends/sparqlwrapper.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/convert/.pages +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/convert/convert.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/datadoc/.pages +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/datadoc/clitool.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/datadoc/context.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/datadoc/dataaccess.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/datadoc/dataset.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/datadoc/errors.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/datadoc/keywords.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/datadoc/tabledoc.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/errors.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/interface.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/literal.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/mappings/.pages +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/mappings/mappings.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/namespace.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/session.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/triplestore.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/triplestore_extend.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/units/.pages +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/units/units.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/api_reference/utils.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/backend_discovery.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/css/reference.css +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/datadoc/classdoc.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/figs/.gitignore +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/figs/dataset-Consumer.png +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/figs/dataset-Consumer1.png +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/figs/dataset-Consumer2.png +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/figs/dataset-Dataset.png +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/figs/dataset-Provider.png +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/figs/dataset.png +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/figs/semdata.png +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/figs/tripper_logo.png +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/figs/tripper_logo.svg +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/figs/tripper_logo_w_name.png +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/figs/tripper_logo_w_name.svg +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/known-issues.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/mappings/figs/function_emmo.svg +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/planned-backends.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/docs/units/units.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/examples/classdoc/mysimulation.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/examples/workflow-mappings/README.md +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/examples/workflow-mappings/knowledge-base.svg +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/examples/workflow-mappings/route.svg +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/examples/workflow-mappings/workflow.svg +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/examples/workflow-mappings/workflow_w_pipes.svg +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/mkdocs.yml +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/backends/__init__.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/backends/dummy.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/backends/test_collection.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/backends/test_rdflib.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/conftest.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/convert/test_convert.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/datadoc/dataset_paths.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/input/77600-23-001_5kV_400x_m001.tif +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/input/custom_context.yaml +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/input/mappings.ttl +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/input/openfile.txt +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/input/tem.csv +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/mappings/test_cost.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/mappings/test_function.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/ontologies/food-more.ttl +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/ontologies/food.ttl +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/paths.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/test_custom_backend.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/test_eval_function.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/test_get_data.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/test_literals.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tests/test_markdown_doctest.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tripper/backends/__init__.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tripper/backends/ontopy.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tripper/context/0.2/context.json +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tripper/convert/__init__.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tripper/convert/convert.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tripper/literal.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tripper/mappings/__init__.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tripper/session.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tripper/triplestore_extend.py +0 -0
- {tripper-0.4.3 → tripper-0.5.2}/tripper/units/__init__.py +0 -0
|
@@ -5,7 +5,7 @@ on:
|
|
|
5
5
|
push:
|
|
6
6
|
branches:
|
|
7
7
|
- 'master'
|
|
8
|
-
- 'push-action/**' # Allow pushing to protected branches
|
|
8
|
+
- 'push-action/**' # Allow pushing to protected branches
|
|
9
9
|
|
|
10
10
|
jobs:
|
|
11
11
|
basic-tests:
|
|
@@ -55,7 +55,7 @@ jobs:
|
|
|
55
55
|
- name: Run Safety CLI to check for vulnerabilities
|
|
56
56
|
uses: pyupio/safety-action@v1
|
|
57
57
|
with:
|
|
58
|
-
api-key: ${{ secrets.
|
|
58
|
+
api-key: ${{ secrets.SAFETY_API_KEY2 }}
|
|
59
59
|
args: --detailed-output # To always see detailed output from this action
|
|
60
60
|
|
|
61
61
|
pytest:
|
|
@@ -79,20 +79,20 @@ jobs:
|
|
|
79
79
|
strategy:
|
|
80
80
|
fail-fast: false
|
|
81
81
|
matrix:
|
|
82
|
-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14
|
|
82
|
+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
83
83
|
|
|
84
84
|
steps:
|
|
85
85
|
- name: Checkout tripper
|
|
86
|
-
uses: actions/checkout@
|
|
86
|
+
uses: actions/checkout@v6
|
|
87
87
|
|
|
88
88
|
- name: Set up Python ${{ matrix.python-version }}
|
|
89
|
-
uses: actions/setup-python@
|
|
89
|
+
uses: actions/setup-python@v6
|
|
90
90
|
with:
|
|
91
91
|
python-version: ${{ matrix.python-version }}
|
|
92
92
|
|
|
93
93
|
- name: Install dependencies
|
|
94
94
|
run: |
|
|
95
|
-
sudo apt install graphviz
|
|
95
|
+
# sudo apt install graphviz
|
|
96
96
|
python -m pip install -U pip
|
|
97
97
|
pip install -U setuptools wheel flit
|
|
98
98
|
pip install -e .[testing]
|
|
@@ -105,7 +105,7 @@ jobs:
|
|
|
105
105
|
|
|
106
106
|
- name: Upload coverage to Codecov
|
|
107
107
|
if: matrix.python-version == '3.11' && github.repository == 'EMMC-ASBL/tripper'
|
|
108
|
-
uses: codecov/codecov-action@
|
|
108
|
+
uses: codecov/codecov-action@v6
|
|
109
109
|
with:
|
|
110
110
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
111
111
|
|
|
@@ -118,20 +118,19 @@ jobs:
|
|
|
118
118
|
strategy:
|
|
119
119
|
fail-fast: false
|
|
120
120
|
matrix:
|
|
121
|
-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14
|
|
121
|
+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
122
122
|
|
|
123
123
|
steps:
|
|
124
124
|
- name: Checkout tripper
|
|
125
|
-
uses: actions/checkout@
|
|
125
|
+
uses: actions/checkout@v6
|
|
126
126
|
|
|
127
127
|
- name: Set up Python ${{ matrix.python-version }}
|
|
128
|
-
uses: actions/setup-python@
|
|
128
|
+
uses: actions/setup-python@v6
|
|
129
129
|
with:
|
|
130
130
|
python-version: ${{ matrix.python-version }}
|
|
131
131
|
|
|
132
|
-
- name: Install dependencies
|
|
132
|
+
- name: Install minimal dependencies
|
|
133
133
|
run: |
|
|
134
|
-
sudo apt install graphviz
|
|
135
134
|
python -m pip install -U pip
|
|
136
135
|
pip install -U setuptools wheel flit
|
|
137
136
|
pip install -e .[testing-core]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Enter repository root directory
|
|
4
|
+
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
5
|
+
cd "$HERE"/..
|
|
6
|
+
|
|
7
|
+
# Generate JSON-LD context and keyword documentation
|
|
8
|
+
python tripper/datadoc/keywords.py \
|
|
9
|
+
--explanation \
|
|
10
|
+
--special-keywords \
|
|
11
|
+
--write-context=tripper/context/0.3/context.json \
|
|
12
|
+
--write-kw-md=docs/datadoc/keywords.md \
|
|
13
|
+
--write-prefixes=docs/datadoc/prefixes.md
|
|
14
|
+
|
|
15
|
+
python tripper/datadoc/keywords.py \
|
|
16
|
+
--explanation \
|
|
17
|
+
--write-context=tripper/context/process/0.1/context.json \
|
|
18
|
+
--write-kw-md=docs/datadoc/keywords-process.md \
|
|
19
|
+
--write-prefixes=docs/datadoc/prefixes-process.md
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# Don't crash pre-commit in case the above fails on GitHub
|
|
23
|
+
exit 0
|
|
@@ -32,7 +32,7 @@ repos:
|
|
|
32
32
|
args: [--markdown-linebreak-ext=md]
|
|
33
33
|
|
|
34
34
|
- repo: https://github.com/PyCQA/isort
|
|
35
|
-
rev:
|
|
35
|
+
rev: 9.0.0a3
|
|
36
36
|
hooks:
|
|
37
37
|
- id: isort
|
|
38
38
|
args:
|
|
@@ -40,21 +40,21 @@ repos:
|
|
|
40
40
|
- --filter-files
|
|
41
41
|
- --skip-gitignore
|
|
42
42
|
|
|
43
|
-
- repo: https://github.com/psf/black
|
|
44
|
-
rev:
|
|
43
|
+
- repo: https://github.com/psf/black-pre-commit-mirror
|
|
44
|
+
rev: 26.3.1
|
|
45
45
|
hooks:
|
|
46
46
|
- id: black
|
|
47
47
|
args: [--line-length=79]
|
|
48
48
|
|
|
49
49
|
- repo: https://github.com/PyCQA/bandit
|
|
50
|
-
rev: 1.
|
|
50
|
+
rev: 1.9.4
|
|
51
51
|
hooks:
|
|
52
52
|
- id: bandit
|
|
53
53
|
args: ["-r"]
|
|
54
54
|
files: ^tripper/.*$
|
|
55
55
|
|
|
56
56
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
57
|
-
rev: v1.
|
|
57
|
+
rev: v1.20.2
|
|
58
58
|
hooks:
|
|
59
59
|
- id: mypy
|
|
60
60
|
exclude: ^tests/.*$
|
|
@@ -64,11 +64,14 @@ repos:
|
|
|
64
64
|
- "pydantic"
|
|
65
65
|
|
|
66
66
|
- repo: https://github.com/SINTEF/ci-cd
|
|
67
|
-
rev: v2.
|
|
67
|
+
rev: v2.10.0
|
|
68
68
|
hooks:
|
|
69
69
|
- id: docs-api-reference
|
|
70
70
|
args:
|
|
71
71
|
- --package-dir=tripper
|
|
72
|
+
- --unwanted-folder=__pycache__
|
|
73
|
+
- --unwanted-folder=context
|
|
74
|
+
- --unwanted-folder=old
|
|
72
75
|
- id: docs-landing-page
|
|
73
76
|
# - id: update-pyproject
|
|
74
77
|
|
|
@@ -1,5 +1,118 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [v0.5.2](https://github.com/EMMC-ASBL/tripper/tree/v0.5.2) (2026-05-11)
|
|
4
|
+
|
|
5
|
+
[Full Changelog](https://github.com/EMMC-ASBL/tripper/compare/v0.5.1...v0.5.2)
|
|
6
|
+
|
|
7
|
+
**Merged pull requests:**
|
|
8
|
+
|
|
9
|
+
- Do not fail when wikidata stops access [\#544](https://github.com/EMMC-ASBL/tripper/pull/544) ([francescalb](https://github.com/francescalb))
|
|
10
|
+
|
|
11
|
+
## [v0.5.1](https://github.com/EMMC-ASBL/tripper/tree/v0.5.1) (2026-04-29)
|
|
12
|
+
|
|
13
|
+
[Full Changelog](https://github.com/EMMC-ASBL/tripper/compare/v0.5.0...v0.5.1)
|
|
14
|
+
|
|
15
|
+
**Closed issues:**
|
|
16
|
+
|
|
17
|
+
- TableDoc - add semantics to content of braces prepended to the header [\#529](https://github.com/EMMC-ASBL/tripper/issues/529)
|
|
18
|
+
- Restrictions on individuals [\#488](https://github.com/EMMC-ASBL/tripper/issues/488)
|
|
19
|
+
- Improve description of classes [\#460](https://github.com/EMMC-ASBL/tripper/issues/460)
|
|
20
|
+
- One prefix can now point to two different namespaces [\#452](https://github.com/EMMC-ASBL/tripper/issues/452)
|
|
21
|
+
|
|
22
|
+
**Merged pull requests:**
|
|
23
|
+
|
|
24
|
+
- Iri in restrictions are not treated correctly when parsed into ts [\#542](https://github.com/EMMC-ASBL/tripper/pull/542) ([francescalb](https://github.com/francescalb))
|
|
25
|
+
- \[pre-commit.ci\] pre-commit autoupdate [\#541](https://github.com/EMMC-ASBL/tripper/pull/541) ([pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci))
|
|
26
|
+
- Do not infer restrictions on annotation properties [\#540](https://github.com/EMMC-ASBL/tripper/pull/540) ([francescalb](https://github.com/francescalb))
|
|
27
|
+
- Added parsing of excel and semantics to header braces in tabledoc [\#539](https://github.com/EMMC-ASBL/tripper/pull/539) ([jesper-friis](https://github.com/jesper-friis))
|
|
28
|
+
- Avoid injecting default context [\#538](https://github.com/EMMC-ASBL/tripper/pull/538) ([jesper-friis](https://github.com/jesper-friis))
|
|
29
|
+
- Add documentation on how to make sure that new classes exist in context [\#537](https://github.com/EMMC-ASBL/tripper/pull/537) ([francescalb](https://github.com/francescalb))
|
|
30
|
+
- \[pre-commit.ci\] pre-commit autoupdate [\#528](https://github.com/EMMC-ASBL/tripper/pull/528) ([pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci))
|
|
31
|
+
- Removed automatic detection of datamodel in tripper dataset [\#526](https://github.com/EMMC-ASBL/tripper/pull/526) ([francescalb](https://github.com/francescalb))
|
|
32
|
+
- Changed prefix `accr:` to `rights:` [\#525](https://github.com/EMMC-ASBL/tripper/pull/525) ([jesper-friis](https://github.com/jesper-friis))
|
|
33
|
+
- Fixed formatting of keywords [\#521](https://github.com/EMMC-ASBL/tripper/pull/521) ([jesper-friis](https://github.com/jesper-friis))
|
|
34
|
+
- Made altLabel and label language strings [\#519](https://github.com/EMMC-ASBL/tripper/pull/519) ([jesper-friis](https://github.com/jesper-friis))
|
|
35
|
+
- Made test\_backends\_sparql.py slightly more robust [\#518](https://github.com/EMMC-ASBL/tripper/pull/518) ([jesper-friis](https://github.com/jesper-friis))
|
|
36
|
+
- \[pre-commit.ci\] pre-commit autoupdate [\#517](https://github.com/EMMC-ASBL/tripper/pull/517) ([pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci))
|
|
37
|
+
- Corrected infering name from iri. [\#516](https://github.com/EMMC-ASBL/tripper/pull/516) ([francescalb](https://github.com/francescalb))
|
|
38
|
+
- \[pre-commit.ci\] pre-commit autoupdate [\#515](https://github.com/EMMC-ASBL/tripper/pull/515) ([pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci))
|
|
39
|
+
- Individual restrictions [\#514](https://github.com/EMMC-ASBL/tripper/pull/514) ([jesper-friis](https://github.com/jesper-friis))
|
|
40
|
+
- Keywords with context input [\#513](https://github.com/EMMC-ASBL/tripper/pull/513) ([jesper-friis](https://github.com/jesper-friis))
|
|
41
|
+
- Restrictions to iris [\#512](https://github.com/EMMC-ASBL/tripper/pull/512) ([francescalb](https://github.com/francescalb))
|
|
42
|
+
- \[pre-commit.ci\] pre-commit autoupdate [\#511](https://github.com/EMMC-ASBL/tripper/pull/511) ([pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci))
|
|
43
|
+
- Added support for multiple labels in keywords [\#508](https://github.com/EMMC-ASBL/tripper/pull/508) ([jesper-friis](https://github.com/jesper-friis))
|
|
44
|
+
- Make TableDoc.save return the saved JSON-LD [\#507](https://github.com/EMMC-ASBL/tripper/pull/507) ([jesper-friis](https://github.com/jesper-friis))
|
|
45
|
+
- Improved error message when missing prefix [\#506](https://github.com/EMMC-ASBL/tripper/pull/506) ([francescalb](https://github.com/francescalb))
|
|
46
|
+
- \[pre-commit.ci\] pre-commit autoupdate [\#505](https://github.com/EMMC-ASBL/tripper/pull/505) ([pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci))
|
|
47
|
+
- Changed sxd:date to xsd:dateTime in keywords [\#504](https://github.com/EMMC-ASBL/tripper/pull/504) ([jesper-friis](https://github.com/jesper-friis))
|
|
48
|
+
- Restrictions on individuals [\#503](https://github.com/EMMC-ASBL/tripper/pull/503) ([jesper-friis](https://github.com/jesper-friis))
|
|
49
|
+
- Correct rdf serialisation [\#502](https://github.com/EMMC-ASBL/tripper/pull/502) ([jesper-friis](https://github.com/jesper-friis))
|
|
50
|
+
- Skip tests depending on dlite if dlite is not available [\#501](https://github.com/EMMC-ASBL/tripper/pull/501) ([jesper-friis](https://github.com/jesper-friis))
|
|
51
|
+
- Removed unnecessary warning [\#500](https://github.com/EMMC-ASBL/tripper/pull/500) ([jesper-friis](https://github.com/jesper-friis))
|
|
52
|
+
- Update jsonld to rdf [\#499](https://github.com/EMMC-ASBL/tripper/pull/499) ([francescalb](https://github.com/francescalb))
|
|
53
|
+
- context is in many places forced to use default even when this is not desired [\#498](https://github.com/EMMC-ASBL/tripper/pull/498) ([francescalb](https://github.com/francescalb))
|
|
54
|
+
- Annotation mappings for generated keywords [\#497](https://github.com/EMMC-ASBL/tripper/pull/497) ([jesper-friis](https://github.com/jesper-friis))
|
|
55
|
+
- Added --set-prefix option to keywords [\#496](https://github.com/EMMC-ASBL/tripper/pull/496) ([jesper-friis](https://github.com/jesper-friis))
|
|
56
|
+
- \[pre-commit.ci\] pre-commit autoupdate [\#495](https://github.com/EMMC-ASBL/tripper/pull/495) ([pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci))
|
|
57
|
+
- Fixed use of deprecated `yamlfile` argument to get\_keywords\(\) [\#494](https://github.com/EMMC-ASBL/tripper/pull/494) ([jesper-friis](https://github.com/jesper-friis))
|
|
58
|
+
- Added prefix argument to keywords tool [\#492](https://github.com/EMMC-ASBL/tripper/pull/492) ([francescalb](https://github.com/francescalb))
|
|
59
|
+
- \[pre-commit.ci\] pre-commit autoupdate [\#489](https://github.com/EMMC-ASBL/tripper/pull/489) ([pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci))
|
|
60
|
+
- \[pre-commit.ci\] pre-commit autoupdate [\#487](https://github.com/EMMC-ASBL/tripper/pull/487) ([pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci))
|
|
61
|
+
- Added reverse mapping to Namespace objects using the \_\_call\_\_\(\) method. [\#483](https://github.com/EMMC-ASBL/tripper/pull/483) ([jesper-friis](https://github.com/jesper-friis))
|
|
62
|
+
- Added --redefine option to datadoc tool and corrected Keywords.\_keywords\_list\(\) method [\#482](https://github.com/EMMC-ASBL/tripper/pull/482) ([jesper-friis](https://github.com/jesper-friis))
|
|
63
|
+
- Update keywords for manufactured product [\#481](https://github.com/EMMC-ASBL/tripper/pull/481) ([jesper-friis](https://github.com/jesper-friis))
|
|
64
|
+
- 460 improve description of classes [\#479](https://github.com/EMMC-ASBL/tripper/pull/479) ([jesper-friis](https://github.com/jesper-friis))
|
|
65
|
+
- Restore license [\#478](https://github.com/EMMC-ASBL/tripper/pull/478) ([jesper-friis](https://github.com/jesper-friis))
|
|
66
|
+
- \[pre-commit.ci\] pre-commit autoupdate [\#477](https://github.com/EMMC-ASBL/tripper/pull/477) ([pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci))
|
|
67
|
+
- Allow to filter generated markdown documentation on namespaces [\#476](https://github.com/EMMC-ASBL/tripper/pull/476) ([jesper-friis](https://github.com/jesper-friis))
|
|
68
|
+
- Speedup [\#474](https://github.com/EMMC-ASBL/tripper/pull/474) ([jesper-friis](https://github.com/jesper-friis))
|
|
69
|
+
- Make it possible to duplicate nested table headers [\#467](https://github.com/EMMC-ASBL/tripper/pull/467) ([jesper-friis](https://github.com/jesper-friis))
|
|
70
|
+
|
|
71
|
+
## [v0.5.0](https://github.com/EMMC-ASBL/tripper/tree/v0.5.0) (2025-11-22)
|
|
72
|
+
|
|
73
|
+
[Full Changelog](https://github.com/EMMC-ASBL/tripper/compare/v0.4.3...v0.5.0)
|
|
74
|
+
|
|
75
|
+
**Closed issues:**
|
|
76
|
+
|
|
77
|
+
- Add functions for storing/loading namespace prefixes and URIs to/from the KB [\#441](https://github.com/EMMC-ASBL/tripper/issues/441)
|
|
78
|
+
- Several tests are never run because of error in importsatetemtn fpr pyld [\#427](https://github.com/EMMC-ASBL/tripper/issues/427)
|
|
79
|
+
- Fix the safety workflow by creating a Safety account and add a key to the workflow [\#423](https://github.com/EMMC-ASBL/tripper/issues/423)
|
|
80
|
+
- Add methods to the Keywords class for adding new prefixes [\#422](https://github.com/EMMC-ASBL/tripper/issues/422)
|
|
81
|
+
- Why is the test wit the ontopy backend skipped? [\#334](https://github.com/EMMC-ASBL/tripper/issues/334)
|
|
82
|
+
|
|
83
|
+
**Merged pull requests:**
|
|
84
|
+
|
|
85
|
+
- Fixed some bugs in Keywords [\#473](https://github.com/EMMC-ASBL/tripper/pull/473) ([jesper-friis](https://github.com/jesper-friis))
|
|
86
|
+
- Added missing keywords [\#470](https://github.com/EMMC-ASBL/tripper/pull/470) ([jesper-friis](https://github.com/jesper-friis))
|
|
87
|
+
- Update keywords [\#469](https://github.com/EMMC-ASBL/tripper/pull/469) ([jesper-friis](https://github.com/jesper-friis))
|
|
88
|
+
- \[pre-commit.ci\] pre-commit autoupdate [\#468](https://github.com/EMMC-ASBL/tripper/pull/468) ([pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci))
|
|
89
|
+
- Remove default type for TableDoc [\#466](https://github.com/EMMC-ASBL/tripper/pull/466) ([jesper-friis](https://github.com/jesper-friis))
|
|
90
|
+
- Allow keyword redefinition [\#465](https://github.com/EMMC-ASBL/tripper/pull/465) ([francescalb](https://github.com/francescalb))
|
|
91
|
+
- \[pre-commit.ci\] pre-commit autoupdate [\#464](https://github.com/EMMC-ASBL/tripper/pull/464) ([pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci))
|
|
92
|
+
- Improved error message and fixed minor issue when reading data from PINK. [\#463](https://github.com/EMMC-ASBL/tripper/pull/463) ([jesper-friis](https://github.com/jesper-friis))
|
|
93
|
+
- Ensure that SPARQL queries with the rdflib backend behaves similar to sparqlwrapper [\#456](https://github.com/EMMC-ASBL/tripper/pull/456) ([jesper-friis](https://github.com/jesper-friis))
|
|
94
|
+
- Changed `check_url` to default to `base_iri` [\#455](https://github.com/EMMC-ASBL/tripper/pull/455) ([jesper-friis](https://github.com/jesper-friis))
|
|
95
|
+
- Fixed some issues with sparql backend [\#453](https://github.com/EMMC-ASBL/tripper/pull/453) ([jesper-friis](https://github.com/jesper-friis))
|
|
96
|
+
- Generate keywords file [\#451](https://github.com/EMMC-ASBL/tripper/pull/451) ([jesper-friis](https://github.com/jesper-friis))
|
|
97
|
+
- \[pre-commit.ci\] pre-commit autoupdate [\#450](https://github.com/EMMC-ASBL/tripper/pull/450) ([pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci))
|
|
98
|
+
- Added keyring tip [\#449](https://github.com/EMMC-ASBL/tripper/pull/449) ([jesper-friis](https://github.com/jesper-friis))
|
|
99
|
+
- Fix deprecation warnings [\#448](https://github.com/EMMC-ASBL/tripper/pull/448) ([jesper-friis](https://github.com/jesper-friis))
|
|
100
|
+
- Test against latest Python 3.14 instead of release candidate rc2 [\#447](https://github.com/EMMC-ASBL/tripper/pull/447) ([jesper-friis](https://github.com/jesper-friis))
|
|
101
|
+
- Restore formatting [\#446](https://github.com/EMMC-ASBL/tripper/pull/446) ([jesper-friis](https://github.com/jesper-friis))
|
|
102
|
+
- Fix formatting2 [\#445](https://github.com/EMMC-ASBL/tripper/pull/445) ([jesper-friis](https://github.com/jesper-friis))
|
|
103
|
+
- Store prefixes to triplestore [\#443](https://github.com/EMMC-ASBL/tripper/pull/443) ([jesper-friis](https://github.com/jesper-friis))
|
|
104
|
+
- Clean up keywords [\#442](https://github.com/EMMC-ASBL/tripper/pull/442) ([jesper-friis](https://github.com/jesper-friis))
|
|
105
|
+
- \[pre-commit.ci\] pre-commit autoupdate [\#439](https://github.com/EMMC-ASBL/tripper/pull/439) ([pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci))
|
|
106
|
+
- Added available\(\) method and check\_url to argument to Triplestore [\#437](https://github.com/EMMC-ASBL/tripper/pull/437) ([jesper-friis](https://github.com/jesper-friis))
|
|
107
|
+
- Added substitute\_query\(\) function [\#434](https://github.com/EMMC-ASBL/tripper/pull/434) ([jesper-friis](https://github.com/jesper-friis))
|
|
108
|
+
- Fixed minor bugs in keywords.py [\#432](https://github.com/EMMC-ASBL/tripper/pull/432) ([jesper-friis](https://github.com/jesper-friis))
|
|
109
|
+
- Fix linting warnings for bound prefixes [\#431](https://github.com/EMMC-ASBL/tripper/pull/431) ([nameloCmaS](https://github.com/nameloCmaS))
|
|
110
|
+
- Corrected importorskip for PyLD \(corrected to pyld\) [\#428](https://github.com/EMMC-ASBL/tripper/pull/428) ([francescalb](https://github.com/francescalb))
|
|
111
|
+
- \[pre-commit.ci\] pre-commit autoupdate [\#426](https://github.com/EMMC-ASBL/tripper/pull/426) ([pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci))
|
|
112
|
+
- Added add\_prefix\(\) method to keywords module. [\#424](https://github.com/EMMC-ASBL/tripper/pull/424) ([jesper-friis](https://github.com/jesper-friis))
|
|
113
|
+
- Changed pypi status to production [\#418](https://github.com/EMMC-ASBL/tripper/pull/418) ([jesper-friis](https://github.com/jesper-friis))
|
|
114
|
+
- Updated figure with basic relations [\#417](https://github.com/EMMC-ASBL/tripper/pull/417) ([jesper-friis](https://github.com/jesper-friis))
|
|
115
|
+
|
|
3
116
|
## [v0.4.3](https://github.com/EMMC-ASBL/tripper/tree/v0.4.3) (2025-08-19)
|
|
4
117
|
|
|
5
118
|
[Full Changelog](https://github.com/EMMC-ASBL/tripper/compare/v0.4.2...v0.4.3)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tripper
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.2
|
|
4
4
|
Summary: A triplestore wrapper for Python.
|
|
5
5
|
Keywords: triplestore,ontology,RDF
|
|
6
6
|
Author-email: SINTEF <TEAM4.0@sintef.no>
|
|
7
7
|
Requires-Python: >=3.8
|
|
8
8
|
Description-Content-Type: text/markdown
|
|
9
|
-
Classifier: Development Status ::
|
|
9
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
10
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.8
|
|
@@ -21,17 +21,19 @@ Classifier: Natural Language :: English
|
|
|
21
21
|
Classifier: Operating System :: OS Independent
|
|
22
22
|
License-File: LICENSE
|
|
23
23
|
Requires-Dist: typing-extensions>=4.7.0,<4.13.1; python_version < '3.9'
|
|
24
|
-
Requires-Dist: dlite-python>=0.5.27 ; extra == "backends"
|
|
25
|
-
Requires-Dist: emmontopy>=0.5.0
|
|
24
|
+
Requires-Dist: dlite-python>=0.5.27 ; extra == "backends"
|
|
25
|
+
Requires-Dist: emmontopy>=0.5.0,<=0.8.1 ; extra == "backends"
|
|
26
26
|
Requires-Dist: graphviz>=0.20.1,<0.20.2 ; extra == "backends"
|
|
27
27
|
Requires-Dist: numpy<2.1.0 ; extra == "backends" and ( python_version=='3.13')
|
|
28
28
|
Requires-Dist: rdflib>=6.3.0,<7.0.0 ; extra == "backends"
|
|
29
29
|
Requires-Dist: tripper[mappings] ; extra == "datadoc"
|
|
30
|
-
Requires-Dist:
|
|
30
|
+
Requires-Dist: keyring>=22.0.0,<25.6.1 ; extra == "datadoc"
|
|
31
|
+
Requires-Dist: PyLD>=2.0.0,<2.0.5 ; extra == "datadoc"
|
|
31
32
|
Requires-Dist: PyYaml>=3.0.0,<6.0.3 ; extra == "datadoc"
|
|
32
33
|
Requires-Dist: requests>=2.0.0,<3.4.1 ; extra == "datadoc"
|
|
33
34
|
Requires-Dist: sparqlwrapper>=2.0.0,<2.0.1 ; extra == "datadoc"
|
|
34
35
|
Requires-Dist: tripper[pre-commit, docs] ; extra == "dev"
|
|
36
|
+
Requires-Dist: virtualenvwrapper>=4.0.0 ; extra == "dev"
|
|
35
37
|
Requires-Dist: tripper[testing] ; extra == "docs"
|
|
36
38
|
Requires-Dist: mike==2.1.3 ; extra == "docs"
|
|
37
39
|
Requires-Dist: mkdocs==1.6.1 ; extra == "docs"
|
|
@@ -50,7 +52,7 @@ Requires-Dist: pytest-cov==5.0.0 ; extra == "testing-core" and ( python_version<
|
|
|
50
52
|
Requires-Dist: pytest-cov==6.0.0 ; extra == "testing-core" and ( python_version>='3.9')
|
|
51
53
|
Requires-Dist: pint>=0.21.1,<0.26 ; extra == "units" and ( python_version<'3.9')
|
|
52
54
|
Requires-Dist: pint>=0.24.1,<0.26 ; extra == "units" and ( python_version>='3.9')
|
|
53
|
-
Requires-Dist: rdflib>=6.3.0
|
|
55
|
+
Requires-Dist: rdflib>=6.3.0,<=7.6.0 ; extra == "units"
|
|
54
56
|
Project-URL: Changelog, https://github.com/EMMC-ASBL/tripper/blob/master/CHANGELOG.md
|
|
55
57
|
Project-URL: Documentation, https://EMMC-ASBL.github.io/tripper
|
|
56
58
|
Project-URL: Home, https://github.com/EMMC-ASBL/tripper
|
|
@@ -71,7 +73,7 @@ Provides-Extra: units
|
|
|
71
73
|
|
|
72
74
|
[](https://pypi.org/project/tripper)
|
|
73
75
|
[](https://emmc-asbl.github.io/tripper/latest/)
|
|
74
|
-
[](https://github.com/EMMC-ASBL/tripper/actions/workflows/ci_tests.yml)
|
|
75
77
|
[](https://zenodo.org/badge/latestdoi/547162834)
|
|
76
78
|
|
|
77
79
|
*Triplestore wrapper for Python providing a simple and consistent interface to a range of triplestore backends*
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://pypi.org/project/tripper)
|
|
4
4
|
[](https://emmc-asbl.github.io/tripper/latest/)
|
|
5
|
-
[](https://github.com/EMMC-ASBL/tripper/actions/workflows/ci_tests.yml)
|
|
6
6
|
[](https://zenodo.org/badge/latestdoi/547162834)
|
|
7
7
|
|
|
8
8
|
*Triplestore wrapper for Python providing a simple and consistent interface to a range of triplestore backends*
|
|
@@ -81,9 +81,51 @@ In your ontology you may define `fromBatch` as a object property with IRI: http:
|
|
|
81
81
|
Here the special value "@id" for the "@type" means that the value of `fromBatch` must be an IRI.
|
|
82
82
|
|
|
83
83
|
|
|
84
|
+
Creating a context with keywords from an ontology
|
|
85
|
+
-------------------------------------------------
|
|
86
|
+
Creating a context with keywords manually can be strenuous and is prone to human mistakes.
|
|
87
|
+
It is therefore advisable to only use one source of truth, namely the ontology.
|
|
88
|
+
|
|
89
|
+
The context can be generated from a triplestore with the ontology with the Keywords class:
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
from tripper import Triplestore
|
|
93
|
+
from tripper.datadoc import get_keywords
|
|
94
|
+
|
|
95
|
+
ts = Triplestore('rdflib')
|
|
96
|
+
|
|
97
|
+
ts.parse(
|
|
98
|
+
'https://raw.githubusercontent.com/EMMC-ASBL/tripper/refs/heads/master/tests/ontologies/family.ttl',
|
|
99
|
+
format='turtle',
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
kw = get_keywords() # create an Keywords instance populated with the default keywords (ddoc:datadoc)
|
|
103
|
+
# Before loading the keywords file it is required that all namespaces have a prefix.
|
|
104
|
+
# The family namespace does not have prefix by defualt and it must be added:
|
|
105
|
+
kw.add_prefix('fam', 'http://onto-ns.com/ontologies/examples/family#')
|
|
106
|
+
|
|
107
|
+
# We can now load the ontology into the keywords
|
|
108
|
+
kw.load_rdf(ts, redefine='skip') # keywords that are already defined are skipped
|
|
109
|
+
# or
|
|
110
|
+
lw.load_rdf(ts, redefine='allow') # keywords that are already defined are redefined
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
Note that there are a few considerations when generating a context from an ontology:
|
|
116
|
+
|
|
117
|
+
First of all, labels that are the same as predefined keywords must be handled with care.
|
|
118
|
+
The default behaviour is that if this is attempted, an error is raised (`redefine = raise`).
|
|
119
|
+
This choice have been made to ensure that redefining predefined keywords is a conscious decision.
|
|
120
|
+
In order to redefine an existing keyword, the argument `redefine` of the `load_rdf()` method must be set to `allow`.
|
|
121
|
+
A warning will be emitted for each keyword that is redefined.
|
|
122
|
+
In order to generate keywords from an ontology without redefining existing keywords, the `redefine` argument can be set to `skip`, in which case existing keywords are left unchanged and a warning is emitted for each new keyword that is skipped to the advantage of the existing keyword.
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
84
126
|
Providing a custom context
|
|
85
127
|
--------------------------
|
|
86
|
-
|
|
128
|
+
A custom context with defined keywords can be provided for all the interfaces described in the section [Documenting a resource].
|
|
87
129
|
|
|
88
130
|
### Python dict
|
|
89
131
|
Both for the single-resource and multi-resource dicts, you can add a `"@context"` key to the dict who's value is
|
|
@@ -229,26 +271,89 @@ The `__init__()` method of the [TableDoc] class takes a `context` argument with
|
|
|
229
271
|
The value of the `context` argument is the same as for the `@context` key of a [Python dict].
|
|
230
272
|
|
|
231
273
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
274
|
+
Multi-table workflows
|
|
275
|
+
---------------------
|
|
276
|
+
When documenting a knowledge base from multiple CSV (or YAML) tables that cross-reference each other's classes — for example, a `classes.csv` that defines domain-specific dataset types that are referenced as `hasInput`/`hasOutput` values in a `computations.csv` — you must explicitly enrich the shared context between parses.
|
|
277
|
+
|
|
278
|
+
### Why this matters
|
|
279
|
+
|
|
280
|
+
Tripper determines whether an object-property value should become an `owl:Restriction` (instead of a plain triple) by checking whether the referenced IRI is a known class in the current context.
|
|
281
|
+
When two tables are parsed independently (even with the same `context` object), classes defined in the first table are **not** automatically visible to `infer_restriction_types()` when it processes the second table.
|
|
282
|
+
|
|
283
|
+
The consequence is **silent**: for scalar string values a `"value"` restriction is still inferred, but for **list-valued** object properties (e.g. a list of two `hasInput` classes) **no restriction type is inferred at all**, and the property ends up as a plain triple rather than an `owl:Restriction` node.
|
|
284
|
+
|
|
285
|
+
### Solution: call `update_context()` between parses
|
|
286
|
+
|
|
287
|
+
After parsing the table that defines your classes, call [`update_context()`][update_context()] with its output before parsing tables that reference those classes:
|
|
288
|
+
|
|
235
289
|
|
|
236
|
-
|
|
290
|
+
```python
|
|
291
|
+
from tripper.datadoc import get_context, TableDoc
|
|
292
|
+
from tripper.datadoc.dataset import update_context
|
|
293
|
+
from tripper import Triplestore
|
|
294
|
+
|
|
295
|
+
context = get_context("https://example.org/context/", theme=None)
|
|
296
|
+
prefixes = {"myns": "https://example.org/myns/"}
|
|
297
|
+
|
|
298
|
+
ts = Triplestore("rdflib")
|
|
299
|
+
|
|
300
|
+
# 1. Parse and store the table that defines classes
|
|
301
|
+
classes_doc = TableDoc.parse_csv("classes.csv", context=context, prefixes=prefixes)
|
|
302
|
+
classes_doc.save(ts)
|
|
303
|
+
|
|
304
|
+
# 2. Register the newly-parsed classes in the shared context
|
|
305
|
+
update_context(classes_doc.asdicts(), context)
|
|
306
|
+
|
|
307
|
+
# 3. Now parse tables and store that reference those classes — restrictions will be inferred correctly
|
|
308
|
+
resources_doc = TableDoc.parse_csv("resources.csv", context=context, prefixes=prefixes)
|
|
309
|
+
resources_doc.save(ts)
|
|
310
|
+
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
This pattern applies whenever:
|
|
314
|
+
|
|
315
|
+
- One table defines classes (rows with `@type: owl:Class` or `subClassOf`).
|
|
316
|
+
- Another table documents resources whose object properties point to those classes.
|
|
317
|
+
- You want those properties to be represented as `owl:Restriction` nodes in the output graph.
|
|
318
|
+
|
|
319
|
+
If you chain more than two tables, repeat the `update_context()` call after each parse.
|
|
320
|
+
|
|
321
|
+
### Easier solution: create one dict before populating the triplestore
|
|
322
|
+
|
|
323
|
+
Technically, it is often easier to create one big dict with all the resources from all tables, and then call [store()] once on that dict. This way, all classes are visible to `infer_restriction_types()` when it processes the whole dict.
|
|
324
|
+
|
|
325
|
+
```python
|
|
326
|
+
from tripper.datadoc import get_context, TableDoc
|
|
327
|
+
from tripper.datadoc.dataset import store
|
|
328
|
+
|
|
329
|
+
context = get_context("https://example.org/context/", theme=None)
|
|
330
|
+
prefixes = {"myns": "https://example.org/myns/"}
|
|
331
|
+
|
|
332
|
+
# 1. Parse the table that defines classes
|
|
333
|
+
classes_doc = TableDoc.parse_csv("classes.csv", context=context, prefixes=prefixes)
|
|
334
|
+
|
|
335
|
+
# 2. Parse the table that defines resources that reference those classes
|
|
336
|
+
resources_doc = TableDoc.parse_csv("resources.csv", context=context, prefixes=prefixes)
|
|
337
|
+
|
|
338
|
+
# 3. Create one big dict with all resources from all tables
|
|
339
|
+
dicts = classes_doc.asdicts() + resources_doc.asdicts()
|
|
340
|
+
|
|
341
|
+
# 4. Store the big dict in the triplestore
|
|
342
|
+
store(ts, dicts, context=context)
|
|
343
|
+
```
|
|
237
344
|
|
|
238
|
-
Since JSON-LD is not designed for categorisation, new resource types should not be added in a custom JSON-LD context.
|
|
239
|
-
Instead, the list of available resource types should be stored and retrieved from the knowledge base.
|
|
240
345
|
|
|
241
346
|
|
|
242
347
|
|
|
243
348
|
[With custom context]: #with-custom-context
|
|
244
349
|
[User-defined keywords]: #user-defined-keywords
|
|
245
350
|
[Python dict]: #python-dict
|
|
246
|
-
[resource types]: introduction.md#resource-types
|
|
247
351
|
[Documenting a resource]: documenting-a-resource.md
|
|
248
352
|
[Search for and fetching resources]: fetching-resources-from-a-triplestore.md
|
|
249
353
|
[predefined prefixes]: prefixes.md
|
|
250
354
|
[predefined keywords]: keywords.md
|
|
251
355
|
[default context]: https://raw.githubusercontent.com/EMMC-ASBL/tripper/refs/heads/master/tripper/context/0.2/context.json
|
|
356
|
+
[update_context()]: ../api_reference/datadoc/dataset.md#tripper.datadoc.dataset.update_context
|
|
252
357
|
[store()]: ../api_reference/datadoc/dataset.md#tripper.datadoc.dataset.store
|
|
253
358
|
[told()]: ../api_reference/datadoc/dataset.md#tripper.datadoc.dataset.told
|
|
254
359
|
[save_datadoc()]: ../api_reference/datadoc/dataset.md#tripper.datadoc.dataset.save_datadoc
|