tripper 0.4.2__tar.gz → 0.4.3__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.2 → tripper-0.4.3}/.github/workflows/ci_cd_updated_main.yml +1 -1
- {tripper-0.4.2 → tripper-0.4.3}/.github/workflows/ci_tests.yml +2 -2
- {tripper-0.4.2 → tripper-0.4.3}/.hooks/generate-context-and-doc.sh +6 -0
- {tripper-0.4.2 → tripper-0.4.3}/.pre-commit-config.yaml +3 -3
- {tripper-0.4.2 → tripper-0.4.3}/CHANGELOG.md +47 -1
- {tripper-0.4.2 → tripper-0.4.3}/PKG-INFO +41 -18
- {tripper-0.4.2 → tripper-0.4.3}/README.md +29 -8
- tripper-0.4.3/docs/datadoc/classdoc.md +60 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/datadoc/customisation.md +14 -7
- {tripper-0.4.2 → tripper-0.4.3}/docs/datadoc/documenting-a-resource.md +13 -13
- tripper-0.4.3/docs/datadoc/fetching-resources-from-a-triplestore.md +122 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/datadoc/introduction.md +1 -1
- {tripper-0.4.2 → tripper-0.4.3}/docs/datadoc/keywords.md +76 -1
- {tripper-0.4.2 → tripper-0.4.3}/docs/datadoc/prefixes.md +1 -1
- {tripper-0.4.2 → tripper-0.4.3}/docs/figs/dataset.drawio +631 -56
- tripper-0.4.3/docs/figs/dataset.png +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/index.md +29 -8
- {tripper-0.4.2 → tripper-0.4.3}/docs/session.md +5 -1
- {tripper-0.4.2 → tripper-0.4.3}/docs/tutorial.md +3 -6
- {tripper-0.4.2 → tripper-0.4.3}/docs/units/units.md +49 -18
- tripper-0.4.3/examples/classdoc/mysimulation.py +15 -0
- tripper-0.4.3/examples/classdoc/mysimulation.yaml +42 -0
- {tripper-0.4.2 → tripper-0.4.3}/mkdocs.yml +2 -0
- {tripper-0.4.2 → tripper-0.4.3}/pyproject.toml +15 -11
- {tripper-0.4.2 → tripper-0.4.3}/tests/backends/test_sparqlwrapper_graphdb_fuseki.py +7 -5
- {tripper-0.4.2 → tripper-0.4.3}/tests/datadoc/test_context.py +98 -4
- {tripper-0.4.2 → tripper-0.4.3}/tests/datadoc/test_dataaccess.py +31 -9
- {tripper-0.4.2 → tripper-0.4.3}/tests/datadoc/test_datadoc_cli.py +37 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/datadoc/test_dataset.py +190 -42
- {tripper-0.4.2 → tripper-0.4.3}/tests/datadoc/test_keywords.py +1 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/datadoc/test_tabledoc.py +2 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/input/semdata-context.json +2 -2
- {tripper-0.4.2 → tripper-0.4.3}/tests/input/semdata.yaml +2 -1
- {tripper-0.4.2 → tripper-0.4.3}/tests/test_literals.py +55 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/test_markdown_doctest.py +17 -1
- {tripper-0.4.2 → tripper-0.4.3}/tests/test_namespace.py +4 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/test_utils.py +1 -1
- {tripper-0.4.2 → tripper-0.4.3}/tests/units/test_units.py +42 -7
- {tripper-0.4.2 → tripper-0.4.3}/tripper/__init__.py +1 -1
- {tripper-0.4.2 → tripper-0.4.3}/tripper/context/0.3/context.json +44 -2
- {tripper-0.4.2 → tripper-0.4.3}/tripper/context/0.3/keywords.yaml +94 -1
- tripper-0.4.3/tripper/context/process/0.1/context.json +402 -0
- tripper-0.4.3/tripper/context/process/0.1/keywords.yaml +117 -0
- {tripper-0.4.2 → tripper-0.4.3}/tripper/datadoc/__init__.py +4 -0
- {tripper-0.4.2 → tripper-0.4.3}/tripper/datadoc/clitool.py +13 -13
- {tripper-0.4.2 → tripper-0.4.3}/tripper/datadoc/context.py +116 -46
- {tripper-0.4.2 → tripper-0.4.3}/tripper/datadoc/dataaccess.py +50 -20
- {tripper-0.4.2 → tripper-0.4.3}/tripper/datadoc/dataset.py +403 -105
- {tripper-0.4.2 → tripper-0.4.3}/tripper/datadoc/errors.py +8 -0
- {tripper-0.4.2 → tripper-0.4.3}/tripper/datadoc/keywords.py +46 -13
- {tripper-0.4.2 → tripper-0.4.3}/tripper/datadoc/tabledoc.py +2 -2
- {tripper-0.4.2 → tripper-0.4.3}/tripper/literal.py +101 -9
- {tripper-0.4.2 → tripper-0.4.3}/tripper/namespace.py +3 -0
- {tripper-0.4.2 → tripper-0.4.3}/tripper/units/units.py +114 -26
- {tripper-0.4.2 → tripper-0.4.3}/tripper/utils.py +15 -77
- {tripper-0.4.2 → tripper-0.4.3}/.github/dependabot.yml +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/.github/pull_request_template.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/.github/workflows/cd_release.yml +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/.github/workflows/ci_automerge_dependency_prs.yml +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/.github/workflows/ci_check_dependencies.yml +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/.github/workflows/ci_update_dependencies.yml +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/.gitignore +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/.hooks/markdown-doctest.sh +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/LICENSE +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/MANIFEST.in +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/CHANGELOG.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/LICENSE.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/.pages +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/backends/.pages +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/backends/collection.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/backends/ontopy.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/backends/rdflib.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/backends/sparqlwrapper.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/convert/.pages +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/convert/convert.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/datadoc/.pages +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/datadoc/clitool.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/datadoc/context.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/datadoc/dataaccess.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/datadoc/dataset.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/datadoc/errors.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/datadoc/keywords.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/datadoc/tabledoc.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/errors.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/interface.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/literal.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/mappings/.pages +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/mappings/mappings.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/namespace.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/session.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/triplestore.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/triplestore_extend.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/units/.pages +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/units/units.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/api_reference/utils.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/backend_discovery.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/css/reference.css +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/developers.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/figs/.gitignore +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/figs/dataset-Consumer.png +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/figs/dataset-Consumer1.png +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/figs/dataset-Consumer2.png +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/figs/dataset-Dataset.png +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/figs/dataset-Provider.png +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/figs/semdata.png +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/figs/tripper_logo.png +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/figs/tripper_logo.svg +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/figs/tripper_logo_w_name.png +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/figs/tripper_logo_w_name.svg +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/known-issues.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/mappings/figs/function_emmo.svg +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/planned-backends.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/docs/tools/datadoc.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/examples/workflow-mappings/README.md +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/examples/workflow-mappings/knowledge-base.svg +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/examples/workflow-mappings/route.svg +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/examples/workflow-mappings/workflow.svg +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/examples/workflow-mappings/workflow_mappings.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/examples/workflow-mappings/workflow_w_pipes.svg +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/backends/__init__.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/backends/datadocumentation_sample.yaml +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/backends/datadocumentation_sample2.yaml +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/backends/dummy.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/backends/test_collection.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/backends/test_rdflib.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/backends/test_sparqlwrapper.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/conftest.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/convert/test_convert.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/datadoc/dataset_paths.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/input/77600-23-001_5kV_400x_m001.tif +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/input/custom_context.yaml +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/input/mappings.ttl +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/input/openfile.txt +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/input/semdata.csv +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/input/session.yaml +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/input/tem.csv +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/mappings/test_cost.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/mappings/test_function.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/mappings/test_mappings.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/ontologies/family.ttl +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/ontologies/food-more.ttl +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/ontologies/food.ttl +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/output/.gitignore +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/paths.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/test_add_function.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/test_custom_backend.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/test_eval_function.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/test_get_data.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/test_session.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/test_sparql.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tests/test_triplestore.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tripper/backends/__init__.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tripper/backends/collection.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tripper/backends/ontopy.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tripper/backends/rdflib.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tripper/backends/sparqlwrapper.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tripper/context/0.2/context.json +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tripper/convert/__init__.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tripper/convert/convert.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tripper/errors.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tripper/interface.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tripper/mappings/__init__.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tripper/mappings/mappings.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tripper/session.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tripper/triplestore.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tripper/triplestore_extend.py +0 -0
- {tripper-0.4.2 → tripper-0.4.3}/tripper/units/__init__.py +0 -0
|
@@ -24,7 +24,7 @@ jobs:
|
|
|
24
24
|
update_python_api_ref: true
|
|
25
25
|
package_dirs: tripper
|
|
26
26
|
update_docs_landing_page: true
|
|
27
|
-
python_version: "3.
|
|
27
|
+
python_version: "3.12"
|
|
28
28
|
doc_extras: "[docs]"
|
|
29
29
|
changelog_exclude_labels: "skip_changelog,duplicate,question,invalid,wontfix"
|
|
30
30
|
docs_framework: mkdocs
|
|
@@ -79,7 +79,7 @@ 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"]
|
|
82
|
+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14.0-rc.2"]
|
|
83
83
|
|
|
84
84
|
steps:
|
|
85
85
|
- name: Checkout tripper
|
|
@@ -118,7 +118,7 @@ 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"]
|
|
121
|
+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14.0-rc.2"]
|
|
122
122
|
|
|
123
123
|
steps:
|
|
124
124
|
- name: Checkout tripper
|
|
@@ -10,5 +10,11 @@ python tripper/datadoc/keywords.py \
|
|
|
10
10
|
--keywords=docs/datadoc/keywords.md \
|
|
11
11
|
--prefixes=docs/datadoc/prefixes.md
|
|
12
12
|
|
|
13
|
+
python tripper/datadoc/keywords.py \
|
|
14
|
+
--context=tripper/context/process/0.1/context.json \
|
|
15
|
+
--keywords=docs/datadoc/keywords-process.md \
|
|
16
|
+
--prefixes=docs/datadoc/prefixes-process.md
|
|
17
|
+
|
|
18
|
+
|
|
13
19
|
# Don't crash pre-commit in case the above fails on GitHub
|
|
14
20
|
exit 0
|
|
@@ -19,7 +19,7 @@ ci:
|
|
|
19
19
|
# hooks
|
|
20
20
|
repos:
|
|
21
21
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
22
|
-
rev:
|
|
22
|
+
rev: v6.0.0
|
|
23
23
|
hooks:
|
|
24
24
|
- id: end-of-file-fixer
|
|
25
25
|
exclude: ^.*\.(svg)$
|
|
@@ -47,14 +47,14 @@ repos:
|
|
|
47
47
|
args: [--line-length=79]
|
|
48
48
|
|
|
49
49
|
- repo: https://github.com/PyCQA/bandit
|
|
50
|
-
rev: 1.8.
|
|
50
|
+
rev: 1.8.6
|
|
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.17.1
|
|
58
58
|
hooks:
|
|
59
59
|
- id: mypy
|
|
60
60
|
exclude: ^tests/.*$
|
|
@@ -1,6 +1,52 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [v0.4.
|
|
3
|
+
## [v0.4.3](https://github.com/EMMC-ASBL/tripper/tree/v0.4.3) (2025-08-19)
|
|
4
|
+
|
|
5
|
+
[Full Changelog](https://github.com/EMMC-ASBL/tripper/compare/v0.4.2...v0.4.3)
|
|
6
|
+
|
|
7
|
+
**Closed issues:**
|
|
8
|
+
|
|
9
|
+
- inconsistent usage when filtering searches [\#396](https://github.com/EMMC-ASBL/tripper/issues/396)
|
|
10
|
+
- correct criterias to criteria [\#392](https://github.com/EMMC-ASBL/tripper/issues/392)
|
|
11
|
+
- Add `hasCurator` and `hasCurationDate` properties to resources [\#390](https://github.com/EMMC-ASBL/tripper/issues/390)
|
|
12
|
+
- Support for documenting not \(yet\) existing resources [\#369](https://github.com/EMMC-ASBL/tripper/issues/369)
|
|
13
|
+
- Make the generated keywords documentation look better [\#365](https://github.com/EMMC-ASBL/tripper/issues/365)
|
|
14
|
+
- Speed up tripper.dataset.save\_data\(\) [\#337](https://github.com/EMMC-ASBL/tripper/issues/337)
|
|
15
|
+
- Example in documentation of search\_iris iw wrong. [\#323](https://github.com/EMMC-ASBL/tripper/issues/323)
|
|
16
|
+
- get\_jsonld\_context does not support PosixPath [\#322](https://github.com/EMMC-ASBL/tripper/issues/322)
|
|
17
|
+
- Set up a triplestore on the PhysMet Portal [\#315](https://github.com/EMMC-ASBL/tripper/issues/315)
|
|
18
|
+
- Make converting a large table of datasets to RDF faster [\#305](https://github.com/EMMC-ASBL/tripper/issues/305)
|
|
19
|
+
- Ensure dataset is TEM schema compliant [\#293](https://github.com/EMMC-ASBL/tripper/issues/293)
|
|
20
|
+
- Define schema for TEM dataset queries [\#292](https://github.com/EMMC-ASBL/tripper/issues/292)
|
|
21
|
+
|
|
22
|
+
**Merged pull requests:**
|
|
23
|
+
|
|
24
|
+
- Updated installation instructions on the readme page. [\#415](https://github.com/EMMC-ASBL/tripper/pull/415) ([jesper-friis](https://github.com/jesper-friis))
|
|
25
|
+
- Add support for Python 3.14 [\#414](https://github.com/EMMC-ASBL/tripper/pull/414) ([jesper-friis](https://github.com/jesper-friis))
|
|
26
|
+
- \[pre-commit.ci\] pre-commit autoupdate [\#412](https://github.com/EMMC-ASBL/tripper/pull/412) ([pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci))
|
|
27
|
+
- Updated dataset figure [\#410](https://github.com/EMMC-ASBL/tripper/pull/410) ([jesper-friis](https://github.com/jesper-friis))
|
|
28
|
+
- Include sparqlwrapper in dependencies for datadoc [\#409](https://github.com/EMMC-ASBL/tripper/pull/409) ([jesper-friis](https://github.com/jesper-friis))
|
|
29
|
+
- \[pre-commit.ci\] pre-commit autoupdate [\#408](https://github.com/EMMC-ASBL/tripper/pull/408) ([pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci))
|
|
30
|
+
- Updated figures [\#407](https://github.com/EMMC-ASBL/tripper/pull/407) ([jesper-friis](https://github.com/jesper-friis))
|
|
31
|
+
- Date and time literals [\#406](https://github.com/EMMC-ASBL/tripper/pull/406) ([jesper-friis](https://github.com/jesper-friis))
|
|
32
|
+
- Added keywords `hasCurator` and `hasCurationDate` [\#405](https://github.com/EMMC-ASBL/tripper/pull/405) ([jesper-friis](https://github.com/jesper-friis))
|
|
33
|
+
- Build documentation with Python 3.12 [\#404](https://github.com/EMMC-ASBL/tripper/pull/404) ([jesper-friis](https://github.com/jesper-friis))
|
|
34
|
+
- Skip running doctest on session.md if Fuseki is not running [\#403](https://github.com/EMMC-ASBL/tripper/pull/403) ([jesper-friis](https://github.com/jesper-friis))
|
|
35
|
+
- Fix issue \#396 [\#401](https://github.com/EMMC-ASBL/tripper/pull/401) ([jesper-friis](https://github.com/jesper-friis))
|
|
36
|
+
- Updated figure with basic relations [\#400](https://github.com/EMMC-ASBL/tripper/pull/400) ([jesper-friis](https://github.com/jesper-friis))
|
|
37
|
+
- Added \_\_contains\_\_\(\) method to namespace [\#399](https://github.com/EMMC-ASBL/tripper/pull/399) ([jesper-friis](https://github.com/jesper-friis))
|
|
38
|
+
- Run mkdocs with Python 3.13 instead of 3.9 [\#398](https://github.com/EMMC-ASBL/tripper/pull/398) ([jesper-friis](https://github.com/jesper-friis))
|
|
39
|
+
- added a file about how to search and delete resources in the ts [\#397](https://github.com/EMMC-ASBL/tripper/pull/397) ([francescalb](https://github.com/francescalb))
|
|
40
|
+
- Update using criteria in search [\#395](https://github.com/EMMC-ASBL/tripper/pull/395) ([francescalb](https://github.com/francescalb))
|
|
41
|
+
- Keywords inverse [\#394](https://github.com/EMMC-ASBL/tripper/pull/394) ([jesper-friis](https://github.com/jesper-friis))
|
|
42
|
+
- Keywords inverse [\#393](https://github.com/EMMC-ASBL/tripper/pull/393) ([jesper-friis](https://github.com/jesper-friis))
|
|
43
|
+
- Added keywords for documenting characterisation processes [\#391](https://github.com/EMMC-ASBL/tripper/pull/391) ([jesper-friis](https://github.com/jesper-friis))
|
|
44
|
+
- WIP: Update classes [\#388](https://github.com/EMMC-ASBL/tripper/pull/388) ([jesper-friis](https://github.com/jesper-friis))
|
|
45
|
+
- Improved control when storing to the triplestore [\#387](https://github.com/EMMC-ASBL/tripper/pull/387) ([jesper-friis](https://github.com/jesper-friis))
|
|
46
|
+
- Fix test\_markdown\_doctest [\#383](https://github.com/EMMC-ASBL/tripper/pull/383) ([jesper-friis](https://github.com/jesper-friis))
|
|
47
|
+
- Added ureg.get\_quantity\(\) method to units module [\#381](https://github.com/EMMC-ASBL/tripper/pull/381) ([jesper-friis](https://github.com/jesper-friis))
|
|
48
|
+
|
|
49
|
+
## [v0.4.2](https://github.com/EMMC-ASBL/tripper/tree/v0.4.2) (2025-04-23)
|
|
4
50
|
|
|
5
51
|
[Full Changelog](https://github.com/EMMC-ASBL/tripper/compare/v0.4.1...v0.4.2)
|
|
6
52
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tripper
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.3
|
|
4
4
|
Summary: A triplestore wrapper for Python.
|
|
5
5
|
Keywords: triplestore,ontology,RDF
|
|
6
6
|
Author-email: SINTEF <TEAM4.0@sintef.no>
|
|
@@ -15,15 +15,22 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
19
|
Classifier: Environment :: Plugins
|
|
19
20
|
Classifier: Natural Language :: English
|
|
20
21
|
Classifier: Operating System :: OS Independent
|
|
21
22
|
License-File: LICENSE
|
|
22
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" and ( python_version<='3.13')
|
|
25
|
+
Requires-Dist: emmontopy>=0.5.0,<0.7.1 ; extra == "backends" and ( python_version<'3.13')
|
|
26
|
+
Requires-Dist: graphviz>=0.20.1,<0.20.2 ; extra == "backends"
|
|
27
|
+
Requires-Dist: numpy<2.1.0 ; extra == "backends" and ( python_version=='3.13')
|
|
28
|
+
Requires-Dist: rdflib>=6.3.0,<7.0.0 ; extra == "backends"
|
|
23
29
|
Requires-Dist: tripper[mappings] ; extra == "datadoc"
|
|
24
|
-
Requires-Dist: PyLD>=2.0.0,<2.0.5 ; extra == "datadoc"
|
|
30
|
+
Requires-Dist: PyLD>=2.0.0,<2.0.5 ; extra == "datadoc" and ( python_version<='3.13')
|
|
25
31
|
Requires-Dist: PyYaml>=3.0.0,<6.0.3 ; extra == "datadoc"
|
|
26
32
|
Requires-Dist: requests>=2.0.0,<3.4.1 ; extra == "datadoc"
|
|
33
|
+
Requires-Dist: sparqlwrapper>=2.0.0,<2.0.1 ; extra == "datadoc"
|
|
27
34
|
Requires-Dist: tripper[pre-commit, docs] ; extra == "dev"
|
|
28
35
|
Requires-Dist: tripper[testing] ; extra == "docs"
|
|
29
36
|
Requires-Dist: mike==2.1.3 ; extra == "docs"
|
|
@@ -36,14 +43,8 @@ Requires-Dist: mkdocstrings==0.27.0 ; extra == "docs"
|
|
|
36
43
|
Requires-Dist: mkdocstrings-python-legacy==0.2.4 ; extra == "docs"
|
|
37
44
|
Requires-Dist: tripper[units] ; extra == "mappings"
|
|
38
45
|
Requires-Dist: pre-commit==4.0.1 ; extra == "pre-commit"
|
|
39
|
-
Requires-Dist: pylint==3.3.4 ; extra == "pre-commit"
|
|
40
|
-
Requires-Dist: tripper[datadoc,
|
|
41
|
-
Requires-Dist: dlite-python>=0.5.27 ; extra == "testing" and ( python_version>='3.8')
|
|
42
|
-
Requires-Dist: emmontopy>=0.5.0,<0.7.1 ; extra == "testing" and ( python_version<'3.13')
|
|
43
|
-
Requires-Dist: graphviz>=0.20.1,<0.20.2 ; extra == "testing"
|
|
44
|
-
Requires-Dist: numpy<2.1.0 ; extra == "testing" and ( python_version>='3.13')
|
|
45
|
-
Requires-Dist: rdflib>=6.3.0,<7.0.0 ; extra == "testing"
|
|
46
|
-
Requires-Dist: sparqlwrapper>=2.0.0,<2.0.1 ; extra == "testing"
|
|
46
|
+
Requires-Dist: pylint==3.3.4 ; extra == "pre-commit" and ( python_version>='3.9')
|
|
47
|
+
Requires-Dist: tripper[datadoc, backends, testing-core] ; extra == "testing"
|
|
47
48
|
Requires-Dist: pytest==8.3.4 ; extra == "testing-core"
|
|
48
49
|
Requires-Dist: pytest-cov==5.0.0 ; extra == "testing-core" and ( python_version<'3.9')
|
|
49
50
|
Requires-Dist: pytest-cov==6.0.0 ; extra == "testing-core" and ( python_version>='3.9')
|
|
@@ -56,6 +57,7 @@ Project-URL: Home, https://github.com/EMMC-ASBL/tripper
|
|
|
56
57
|
Project-URL: Issue Tracker, https://github.com/EMMC-ASBL/tripper/issues
|
|
57
58
|
Project-URL: Package, https://pypi.org/project/tripper
|
|
58
59
|
Project-URL: Source, https://github.com/EMMC-ASBL/tripper
|
|
60
|
+
Provides-Extra: backends
|
|
59
61
|
Provides-Extra: datadoc
|
|
60
62
|
Provides-Extra: dev
|
|
61
63
|
Provides-Extra: docs
|
|
@@ -93,10 +95,10 @@ It strives for simplicity and is modelled after [rdflib] (with a few simplificat
|
|
|
93
95
|
In Tripper:
|
|
94
96
|
|
|
95
97
|
* All IRIs are represented by Python strings.
|
|
96
|
-
Example: `
|
|
98
|
+
Example: `https://w3id.org/emmo#Metre`
|
|
97
99
|
|
|
98
|
-
* Blank nodes are strings starting with
|
|
99
|
-
Example: `
|
|
100
|
+
* Blank nodes are strings starting with `_:`.
|
|
101
|
+
Example: `_:bnode1`
|
|
100
102
|
|
|
101
103
|
* Literals are constructed with [`tripper.Literal`][Literal].
|
|
102
104
|
Example: `tripper.Literal(3.14, datatype=XSD.float)`
|
|
@@ -137,20 +139,40 @@ Installation
|
|
|
137
139
|
Tripper has by itself no dependencies outside the standard library, but the triplestore backends may have specific dependencies.
|
|
138
140
|
|
|
139
141
|
|
|
140
|
-
The package can be installed from [PyPI] using `pip
|
|
142
|
+
The package can be installed from [PyPI] using `pip`.
|
|
143
|
+
A minimal installation can be done with
|
|
141
144
|
|
|
142
145
|
```shell
|
|
143
146
|
pip install tripper
|
|
144
147
|
```
|
|
145
148
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
+
but typically, you would also like to install the requirements needed by the backends, the tripper sub-packages and extra features.
|
|
150
|
+
The requirements for the backends are listed in the table above, while sub-packages and extra features are enabled by specifying one or more of the "extras" listed in the table below when installing Tripper.
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
For example, the following command will install Tripper with the [tripper.datadoc] sub-package and the rdflib backend enabled:
|
|
149
154
|
|
|
150
155
|
```shell
|
|
151
|
-
pip install rdflib
|
|
156
|
+
pip install tripper[datadoc] rdflib
|
|
152
157
|
```
|
|
153
158
|
|
|
159
|
+
Developers should install Tripper with the `dev` extras and enable [pre-commit]:
|
|
160
|
+
|
|
161
|
+
```shell
|
|
162
|
+
pip install tripper[dev]
|
|
163
|
+
pre-commit install # Enable pre-commit and installing hooks
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
| Extras | Description of dependencies | Implies |
|
|
168
|
+
|----------|--------------------------------------------------------------------|------------------|
|
|
169
|
+
| units | Required by the [tripper.units] sub-package. | |
|
|
170
|
+
| mappings | Required by the [tripper.mappings] sub-package. | units |
|
|
171
|
+
| datadoc | Required by the [tripper.datadoc] sub-package. | mappings |
|
|
172
|
+
| backends | Installs dependencies for all backends | |
|
|
173
|
+
| testing | For testing. | datadoc,backends |
|
|
174
|
+
| docs | For generation of documentation | testing |
|
|
175
|
+
| dev | For developers. Installs all dependencies, including [pre-commit]. | dev |
|
|
154
176
|
|
|
155
177
|
|
|
156
178
|
|
|
@@ -200,4 +222,5 @@ We gratefully acknowledge the following projects for supporting the development
|
|
|
200
222
|
[StarDog]: https://www.stardog.com/
|
|
201
223
|
[GraphDB]: https://www.ontotext.com/products/graphdb/
|
|
202
224
|
[Pint]: https://pint.readthedocs.io/en/stable/
|
|
225
|
+
[pre-commit]: https://pre-commit.com/
|
|
203
226
|
|
|
@@ -26,10 +26,10 @@ It strives for simplicity and is modelled after [rdflib] (with a few simplificat
|
|
|
26
26
|
In Tripper:
|
|
27
27
|
|
|
28
28
|
* All IRIs are represented by Python strings.
|
|
29
|
-
Example: `
|
|
29
|
+
Example: `https://w3id.org/emmo#Metre`
|
|
30
30
|
|
|
31
|
-
* Blank nodes are strings starting with
|
|
32
|
-
Example: `
|
|
31
|
+
* Blank nodes are strings starting with `_:`.
|
|
32
|
+
Example: `_:bnode1`
|
|
33
33
|
|
|
34
34
|
* Literals are constructed with [`tripper.Literal`][Literal].
|
|
35
35
|
Example: `tripper.Literal(3.14, datatype=XSD.float)`
|
|
@@ -70,20 +70,40 @@ Installation
|
|
|
70
70
|
Tripper has by itself no dependencies outside the standard library, but the triplestore backends may have specific dependencies.
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
The package can be installed from [PyPI] using `pip
|
|
73
|
+
The package can be installed from [PyPI] using `pip`.
|
|
74
|
+
A minimal installation can be done with
|
|
74
75
|
|
|
75
76
|
```shell
|
|
76
77
|
pip install tripper
|
|
77
78
|
```
|
|
78
79
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
but typically, you would also like to install the requirements needed by the backends, the tripper sub-packages and extra features.
|
|
81
|
+
The requirements for the backends are listed in the table above, while sub-packages and extra features are enabled by specifying one or more of the "extras" listed in the table below when installing Tripper.
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
For example, the following command will install Tripper with the [tripper.datadoc] sub-package and the rdflib backend enabled:
|
|
82
85
|
|
|
83
86
|
```shell
|
|
84
|
-
pip install rdflib
|
|
87
|
+
pip install tripper[datadoc] rdflib
|
|
85
88
|
```
|
|
86
89
|
|
|
90
|
+
Developers should install Tripper with the `dev` extras and enable [pre-commit]:
|
|
91
|
+
|
|
92
|
+
```shell
|
|
93
|
+
pip install tripper[dev]
|
|
94
|
+
pre-commit install # Enable pre-commit and installing hooks
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
| Extras | Description of dependencies | Implies |
|
|
99
|
+
|----------|--------------------------------------------------------------------|------------------|
|
|
100
|
+
| units | Required by the [tripper.units] sub-package. | |
|
|
101
|
+
| mappings | Required by the [tripper.mappings] sub-package. | units |
|
|
102
|
+
| datadoc | Required by the [tripper.datadoc] sub-package. | mappings |
|
|
103
|
+
| backends | Installs dependencies for all backends | |
|
|
104
|
+
| testing | For testing. | datadoc,backends |
|
|
105
|
+
| docs | For generation of documentation | testing |
|
|
106
|
+
| dev | For developers. Installs all dependencies, including [pre-commit]. | dev |
|
|
87
107
|
|
|
88
108
|
|
|
89
109
|
|
|
@@ -133,3 +153,4 @@ We gratefully acknowledge the following projects for supporting the development
|
|
|
133
153
|
[StarDog]: https://www.stardog.com/
|
|
134
154
|
[GraphDB]: https://www.ontotext.com/products/graphdb/
|
|
135
155
|
[Pint]: https://pint.readthedocs.io/en/stable/
|
|
156
|
+
[pre-commit]: https://pre-commit.com/
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
Documenting abstract resources
|
|
2
|
+
------------------------------
|
|
3
|
+
Resources that do not exist are called *abstract resources*.
|
|
4
|
+
A typical example of an abstract resource is a procedure that has not been performed (yet), like a general description of a task in a workflow.
|
|
5
|
+
|
|
6
|
+
It is highly desirable to document such a resource as a class (i.e. in the TBox).
|
|
7
|
+
It is consistent with the physicalistic/nominalistic approach taken by major ontological frameworks for applied sciences and makes it easy to document actual executions of such a workflow task as an individual of this class.
|
|
8
|
+
|
|
9
|
+
```python
|
|
10
|
+
{
|
|
11
|
+
"@id": "ex:MySimulation",
|
|
12
|
+
"@type": "owl:Class",
|
|
13
|
+
"subClassOf": "PhysicsBasedSimulation",
|
|
14
|
+
"prefLabel": "MySimulation",
|
|
15
|
+
"elucidation": "A simulation using my physics-based materials models.",
|
|
16
|
+
"isParticipatedBy": {
|
|
17
|
+
"@id": "ex:MyModel",
|
|
18
|
+
"@type": "owl:Class" # restrictionType defaults to some
|
|
19
|
+
},
|
|
20
|
+
"command": "mymodel infile.txt -o outfile.txt", # Command to execute the model
|
|
21
|
+
"workdir": ".", # Relative path to working directory
|
|
22
|
+
"environment": {"VAR1": "val1", "VAR2": "val2"}, # Environment variables (JSON-encoded)
|
|
23
|
+
"install_command": "pip install git+ssh://git@github.com:MyProj/myrepo.git@master",
|
|
24
|
+
"hasInput": [
|
|
25
|
+
{
|
|
26
|
+
"@id": "ex:MyInputDataset",
|
|
27
|
+
"@type": "owl:Class",
|
|
28
|
+
"subClassOf": ["dcat:Dataset", "emmo:Dataset"],
|
|
29
|
+
"restrictionType": "exactly 1", # defaults to "some"
|
|
30
|
+
"prefLabel": "MyInputDataset.",
|
|
31
|
+
"elucidation": "My input dataset.",
|
|
32
|
+
"distribution": {
|
|
33
|
+
"accessURL": "file:./infile.txt",
|
|
34
|
+
"accessService": {
|
|
35
|
+
"conformsTo": "https://github.com/SINTEF/dlite/",
|
|
36
|
+
"generator": "ex:inputplugin" # for generating input
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"hasOutput": [
|
|
42
|
+
{
|
|
43
|
+
"@id": "ex:MyOutputDataset",
|
|
44
|
+
"@type": "owl:Class",
|
|
45
|
+
"subClassOf": ["dcat:Dataset", "emmo:Dataset"],
|
|
46
|
+
"restrictionType": "exactly 1", # defaults to "some"
|
|
47
|
+
"prefLabel": "MyOutputDataset.",
|
|
48
|
+
"elucidation": "My output dataset.",
|
|
49
|
+
"distribution": {
|
|
50
|
+
"accessURL": "file:./outfile.txt",
|
|
51
|
+
"accessService": {
|
|
52
|
+
"conformsTo": "https://github.com/SINTEF/dlite/",
|
|
53
|
+
"parser": "ex:outputplugin", # for parsing output
|
|
54
|
+
"generator": "ex:outputplugin" # for storing output to external storage
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
```
|
|
@@ -13,7 +13,7 @@ Tripper already include a default list of [predefined prefixes].
|
|
|
13
13
|
Additional prefixed can be provided in two ways.
|
|
14
14
|
|
|
15
15
|
### With the `prefixes` argument
|
|
16
|
-
Several functions in the API (like [
|
|
16
|
+
Several functions in the API (like [store()], [told()] and [TableDoc.parse_csv()]) takes a `prefixes` argument with which additional namespace prefixes can provided.
|
|
17
17
|
|
|
18
18
|
This may be handy when used from the Python API.
|
|
19
19
|
|
|
@@ -177,9 +177,9 @@ You can save this context to a triplestore with
|
|
|
177
177
|
>>> ts = Triplestore("rdflib")
|
|
178
178
|
>>> save_datadoc( # doctest: +ELLIPSIS
|
|
179
179
|
... ts,
|
|
180
|
-
...
|
|
180
|
+
... "https://raw.githubusercontent.com/EMMC-ASBL/tripper/refs/heads/master/tests/input/custom_context.yaml",
|
|
181
181
|
... )
|
|
182
|
-
|
|
182
|
+
{'@context': ...}
|
|
183
183
|
|
|
184
184
|
```
|
|
185
185
|
|
|
@@ -191,25 +191,31 @@ The content of the triplestore should now be
|
|
|
191
191
|
@prefix dcat: <http://www.w3.org/ns/dcat#> .
|
|
192
192
|
@prefix kb: <http://example.com/kb#> .
|
|
193
193
|
@prefix myonto: <http://example.com/myonto#> .
|
|
194
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
194
195
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
195
196
|
<BLANKLINE>
|
|
196
|
-
kb:sampleA a
|
|
197
|
+
kb:sampleA a rdfs:Resource,
|
|
198
|
+
dcat:Resource,
|
|
197
199
|
chameo:Sample ;
|
|
198
200
|
myonto:fromBatch kb:batch1 .
|
|
199
201
|
<BLANKLINE>
|
|
200
|
-
kb:sampleB a
|
|
202
|
+
kb:sampleB a rdfs:Resource,
|
|
203
|
+
dcat:Resource,
|
|
201
204
|
chameo:Sample ;
|
|
202
205
|
myonto:fromBatch kb:batch1 .
|
|
203
206
|
<BLANKLINE>
|
|
204
|
-
kb:sampleC a
|
|
207
|
+
kb:sampleC a rdfs:Resource,
|
|
208
|
+
dcat:Resource,
|
|
205
209
|
chameo:Sample ;
|
|
206
210
|
myonto:fromBatch kb:batch2 .
|
|
207
211
|
<BLANKLINE>
|
|
208
212
|
kb:batch2 a myonto:Batch,
|
|
213
|
+
rdfs:Resource,
|
|
209
214
|
dcat:Resource ;
|
|
210
215
|
myonto:batchNumber 2 .
|
|
211
216
|
<BLANKLINE>
|
|
212
217
|
kb:batch1 a myonto:Batch,
|
|
218
|
+
rdfs:Resource,
|
|
213
219
|
dcat:Resource ;
|
|
214
220
|
myonto:batchNumber 1 .
|
|
215
221
|
<BLANKLINE>
|
|
@@ -239,10 +245,11 @@ Instead, the list of available resource types should be stored and retrieved fro
|
|
|
239
245
|
[Python dict]: #python-dict
|
|
240
246
|
[resource types]: introduction.md#resource-types
|
|
241
247
|
[Documenting a resource]: documenting-a-resource.md
|
|
248
|
+
[Search for and fetching resources]: fetching-resources-from-a-triplestore.md
|
|
242
249
|
[predefined prefixes]: prefixes.md
|
|
243
250
|
[predefined keywords]: keywords.md
|
|
244
251
|
[default context]: https://raw.githubusercontent.com/EMMC-ASBL/tripper/refs/heads/master/tripper/context/0.2/context.json
|
|
245
|
-
[
|
|
252
|
+
[store()]: ../api_reference/datadoc/dataset.md#tripper.datadoc.dataset.store
|
|
246
253
|
[told()]: ../api_reference/datadoc/dataset.md#tripper.datadoc.dataset.told
|
|
247
254
|
[save_datadoc()]: ../api_reference/datadoc/dataset.md#tripper.datadoc.dataset.save_datadoc
|
|
248
255
|
[TableDoc]: ../api_reference/datadoc/tabledoc.md/#tripper.datadoc.tabledoc.TableDoc
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Documenting a resource
|
|
2
2
|
======================
|
|
3
|
-
In the [tripper.datadoc] sub-package
|
|
4
|
-
However, the API tries to hide
|
|
3
|
+
In the [tripper.datadoc] sub-package, the documents documenting the resources internally represented as [JSON-LD] documents are stored as Python dicts.
|
|
4
|
+
However, the API tries to hide the complexities of JSON-LD behind simple interfaces.
|
|
5
5
|
To support different use cases, the sub-package provide several interfaces for data documentation, including Python dicts, YAML files and tables.
|
|
6
6
|
These are further described below.
|
|
7
7
|
|
|
@@ -37,7 +37,7 @@ We therefore have to define them explicitly
|
|
|
37
37
|
|
|
38
38
|
```python
|
|
39
39
|
>>> prefixes = {
|
|
40
|
-
... "sem": "https://w3id.
|
|
40
|
+
... "sem": "https://w3id.org/emmo/domain/sem/0.1#",
|
|
41
41
|
... "kb": "http://example.com/kb/"
|
|
42
42
|
... }
|
|
43
43
|
|
|
@@ -60,7 +60,7 @@ We therefore have to define them explicitly
|
|
|
60
60
|
{
|
|
61
61
|
"@context": "https://raw.githubusercontent.com/EMMC-ASBL/tripper/refs/heads/master/tripper/context/0.3/context.json",
|
|
62
62
|
"@id": "http://example.com/kb/image1",
|
|
63
|
-
"@type": "https://w3id.
|
|
63
|
+
"@type": "https://w3id.org/emmo/domain/sem/0.1#SEMImage",
|
|
64
64
|
"creator": {
|
|
65
65
|
"@type": [
|
|
66
66
|
"http://xmlns.com/foaf/0.1/Agent",
|
|
@@ -77,14 +77,14 @@ We therefore have to define them explicitly
|
|
|
77
77
|
}
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
You can use [
|
|
80
|
+
You can use [store()] to save this documentation to a triplestore.
|
|
81
81
|
Since the prefixes "sem" and "kb" are not included in the [Predefined prefixes], they are have to be provided explicitly.
|
|
82
82
|
|
|
83
83
|
```python
|
|
84
84
|
>>> from tripper import Triplestore
|
|
85
|
-
>>> from tripper.datadoc import
|
|
85
|
+
>>> from tripper.datadoc import store
|
|
86
86
|
>>> ts = Triplestore(backend="rdflib")
|
|
87
|
-
>>> d =
|
|
87
|
+
>>> d = store(ts, dataset, prefixes=prefixes)
|
|
88
88
|
|
|
89
89
|
```
|
|
90
90
|
|
|
@@ -104,7 +104,7 @@ You can use `ts.serialize()` to list the content of the triplestore (defaults to
|
|
|
104
104
|
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
105
105
|
@prefix kb: <http://example.com/kb/> .
|
|
106
106
|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
107
|
-
@prefix sem: <https://w3id.
|
|
107
|
+
@prefix sem: <https://w3id.org/emmo/domain/sem/0.1#> .
|
|
108
108
|
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
109
109
|
|
|
110
110
|
kb:image1 a sem:SEMImage ;
|
|
@@ -119,7 +119,7 @@ kb:image1 a sem:SEMImage ;
|
|
|
119
119
|
```
|
|
120
120
|
|
|
121
121
|
Note that the image implicitly has been declared to be an individual of the classes `dcat:Dataset` and `emmo:Dataset`.
|
|
122
|
-
This is because the `type` argument of [
|
|
122
|
+
This is because the `type` argument of [store()] defaults to "dataset".
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
### Multi-resource dict
|
|
@@ -145,11 +145,11 @@ Saving [semdata.yaml] to a triplestore can e.g. be done with
|
|
|
145
145
|
|
|
146
146
|
```python
|
|
147
147
|
>>> from tripper.datadoc import save_datadoc
|
|
148
|
-
>>> save_datadoc( # doctest: +ELLIPSIS
|
|
148
|
+
>>> save_datadoc( # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
|
|
149
149
|
... ts,
|
|
150
150
|
... "https://raw.githubusercontent.com/EMMC-ASBL/tripper/refs/heads/master/tests/input/semdata.yaml"
|
|
151
151
|
... )
|
|
152
|
-
|
|
152
|
+
{'@graph': [...], ...}
|
|
153
153
|
|
|
154
154
|
```
|
|
155
155
|
|
|
@@ -186,7 +186,7 @@ The below example shows how to save all datasets listed in the CSV file [semdata
|
|
|
186
186
|
>>> td = TableDoc.parse_csv(
|
|
187
187
|
... "https://raw.githubusercontent.com/EMMC-ASBL/tripper/refs/heads/master/tests/input/semdata.csv",
|
|
188
188
|
... prefixes={
|
|
189
|
-
... "sem": "https://w3id.
|
|
189
|
+
... "sem": "https://w3id.org/emmo/domain/sem/0.1#",
|
|
190
190
|
... "semdata": "https://he-matchmaker.eu/data/sem/",
|
|
191
191
|
... "sample": "https://he-matchmaker.eu/sample/",
|
|
192
192
|
... "mat": "https://he-matchmaker.eu/material/",
|
|
@@ -215,7 +215,7 @@ The below example shows how to save all datasets listed in the CSV file [semdata
|
|
|
215
215
|
[emmo:Dataset]: https://w3id.org/emmo#EMMO_194e367c_9783_4bf5_96d0_9ad597d48d9a
|
|
216
216
|
[oteio:Generator]: https://w3id.org/emmo/domain/oteio/Generator
|
|
217
217
|
[oteio:Parser]: https://w3id.org/emmo/domain/oteio/Parser
|
|
218
|
-
[
|
|
218
|
+
[store()]: ../api_reference/datadoc/dataset.md/#tripper.datadoc.dataset.store
|
|
219
219
|
[told()]: ../api_reference/datadoc/dataset.md/#tripper.datadoc.dataset.told
|
|
220
220
|
[save_datadoc()]:
|
|
221
221
|
../api_reference/datadoc/dataset.md/#tripper.datadoc.dataset.save_datadoc
|