diff --git a/.github/workflows/cd_publish.yml b/.github/workflows/cd_publish.yml index fe675a707..800466880 100644 --- a/.github/workflows/cd_publish.yml +++ b/.github/workflows/cd_publish.yml @@ -5,9 +5,9 @@ on: types: [published] jobs: - publish: + build: name: External - uses: SINTEF/ci-cd/.github/workflows/cd_release.yml@v2.7.4 + uses: SINTEF/ci-cd/.github/workflows/cd_release.yml@v2.8.3 if: github.repository == 'emmo-repo/EMMOntoPy' && startsWith(github.ref, 'refs/tags/v') with: git_username: EMMOntoPy Developers @@ -21,8 +21,11 @@ jobs: # ontopy/__init__.py package_dirs: ontopy install_extras: "[dev]" - build_cmd: "python -m build" - publish_on_pypi: true + build_libs: build + build_cmd: "python -m build -o dists" + build_dir: dists + publish_on_pypi: false + upload_distribution: true # Update documentation update_docs: true @@ -31,5 +34,24 @@ jobs: changelog_exclude_labels: dependencies secrets: - PyPI_token: ${{ secrets.PYPI_TOKEN }} PAT: ${{ secrets.RELEASE_PAT }} + + publish: + name: Publish on PyPI + needs: build + runs-on: ubuntu-latest + environment: + name: release + url: https://pypi.org/project/EMMOntoPy + permissions: + id-token: write + + steps: + - name: Download distribution + uses: actions/download-artifact@v4 + with: + name: dist # The artifact will always be called 'dist' + path: dist + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/ci_automerge_dependabot.yml b/.github/workflows/ci_automerge_dependabot.yml index 69faf0bb6..ccb431844 100644 --- a/.github/workflows/ci_automerge_dependabot.yml +++ b/.github/workflows/ci_automerge_dependabot.yml @@ -7,7 +7,7 @@ on: jobs: update-dependabot-branch: name: External - uses: SINTEF/ci-cd/.github/workflows/ci_automerge_prs.yml@v2.7.4 + uses: SINTEF/ci-cd/.github/workflows/ci_automerge_prs.yml@v2.8.3 if: github.repository_owner == 'emmo-repo' && startsWith(github.event.pull_request.head.ref, 'dependabot/') && github.actor == 'dependabot[bot]' secrets: PAT: ${{ secrets.RELEASE_PAT }} diff --git a/.github/workflows/ci_cd_updated_master.yml b/.github/workflows/ci_cd_updated_master.yml index b85a6ad89..b2bb7173f 100644 --- a/.github/workflows/ci_cd_updated_master.yml +++ b/.github/workflows/ci_cd_updated_master.yml @@ -7,7 +7,7 @@ on: jobs: updates-to-master: name: External - uses: SINTEF/ci-cd/.github/workflows/ci_cd_updated_default_branch.yml@v2.7.4 + uses: SINTEF/ci-cd/.github/workflows/ci_cd_updated_default_branch.yml@v2.8.3 if: github.repository_owner == 'emmo-repo' with: git_username: EMMOntoPy Developers @@ -29,3 +29,5 @@ jobs: (LICENSE.txt),(LICENSE.md) (tools),(../tools) changelog_exclude_labels: dependencies + secrets: + PAT: ${{ secrets.RELEASE_PAT }} diff --git a/.github/workflows/ci_dependabot.yml b/.github/workflows/ci_dependabot.yml index 3b9e53dd8..8be5dcb20 100644 --- a/.github/workflows/ci_dependabot.yml +++ b/.github/workflows/ci_dependabot.yml @@ -11,7 +11,7 @@ on: jobs: create-collected-pr: name: External - uses: SINTEF/ci-cd/.github/workflows/ci_update_dependencies.yml@v2.7.4 + uses: SINTEF/ci-cd/.github/workflows/ci_update_dependencies.yml@v2.8.3 if: github.repository_owner == 'emmo-repo' with: git_username: EMMOntoPy Developers diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index 435f55a73..8d8b9a113 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -10,7 +10,7 @@ on: jobs: tests: name: External - uses: SINTEF/ci-cd/.github/workflows/ci_tests.yml@v2.7.4 + uses: SINTEF/ci-cd/.github/workflows/ci_tests.yml@v2.8.3 with: # General install_extras: "[dev,docs]" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 40817eabf..0fdf6860a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: check-symlinks - id: check-xml @@ -17,13 +17,13 @@ repos: args: [--markdown-linebreak-ext=md] - repo: https://github.com/ambv/black - rev: 24.4.2 + rev: 24.10.0 hooks: - id: black name: Blacken - repo: https://github.com/PyCQA/bandit - rev: '1.7.9' + rev: '1.7.10' hooks: - id: bandit args: [-r] @@ -36,7 +36,7 @@ repos: # exclude: ^tests/.*$ - repo: https://github.com/SINTEF/ci-cd - rev: v2.7.4 + rev: v2.8.3 hooks: - id: docs-api-reference args: diff --git a/CHANGELOG.md b/CHANGELOG.md index 624b71ad7..415c078b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,41 @@ # Changelog -## [v0.7.0.1](https://github.com/emmo-repo/EMMOntoPy/tree/v0.7.0.1) (2024-02-29) +## [v0.7.2](https://github.com/emmo-repo/EMMOntoPy/tree/v0.7.2) (2024-10-25) + +[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v0.7.1...v0.7.2) -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v0.7.1...v0.7.0.1) +**Closed issues:** + +- excelparser, allow for = in strings for other annotations. [\#751](https://github.com/emmo-repo/EMMOntoPy/issues/751) +- Add options to ontoconvert for adding annotations expected by FOOPS [\#728](https://github.com/emmo-repo/EMMOntoPy/issues/728) +- Remove or rename "old" version tags [\#547](https://github.com/emmo-repo/EMMOntoPy/issues/547) +- Handle old `EMMO` Python package version tags [\#272](https://github.com/emmo-repo/EMMOntoPy/issues/272) + +**Merged pull requests:** + +- Corrected publishing info [\#792](https://github.com/emmo-repo/EMMOntoPy/pull/792) ([francescalb](https://github.com/francescalb)) +- Flb/trusted publisher on pypi [\#791](https://github.com/emmo-repo/EMMOntoPy/pull/791) ([francescalb](https://github.com/francescalb)) +- Updated to owlready2==0.44 [\#780](https://github.com/emmo-repo/EMMOntoPy/pull/780) ([francescalb](https://github.com/francescalb)) +- Added release\_pat secret to ci\_cd\_updated\_master workflow [\#777](https://github.com/emmo-repo/EMMOntoPy/pull/777) ([francescalb](https://github.com/francescalb)) +- Added test for descriptions [\#766](https://github.com/emmo-repo/EMMOntoPy/pull/766) ([jesper-friis](https://github.com/jesper-friis)) +- Fixed failing test\_save in master [\#756](https://github.com/emmo-repo/EMMOntoPy/pull/756) ([jesper-friis](https://github.com/jesper-friis)) +- Added possibility for = in extra annotations defined in excelparser [\#752](https://github.com/emmo-repo/EMMOntoPy/pull/752) ([francescalb](https://github.com/francescalb)) +- Load doamin-battery instead of battinfo which is just an extra wrapping [\#745](https://github.com/emmo-repo/EMMOntoPy/pull/745) ([francescalb](https://github.com/francescalb)) +- Rewriting ontodoc based on domain-battery [\#742](https://github.com/emmo-repo/EMMOntoPy/pull/742) ([jesper-friis](https://github.com/jesper-friis)) +- Make it possible to run HermiT on EMMO [\#740](https://github.com/emmo-repo/EMMOntoPy/pull/740) ([jesper-friis](https://github.com/jesper-friis)) +- Added minor fixes for ontoconvert [\#739](https://github.com/emmo-repo/EMMOntoPy/pull/739) ([jesper-friis](https://github.com/jesper-friis)) +- Added additional recognised prefixes [\#734](https://github.com/emmo-repo/EMMOntoPy/pull/734) ([jesper-friis](https://github.com/jesper-friis)) +- Copy EMMO annotations [\#733](https://github.com/emmo-repo/EMMOntoPy/pull/733) ([jesper-friis](https://github.com/jesper-friis)) +- Add --copy-annotation option to ontoconvert [\#732](https://github.com/emmo-repo/EMMOntoPy/pull/732) ([jesper-friis](https://github.com/jesper-friis)) +- Updated list of IRIs to ignore when checking prefLabel [\#731](https://github.com/emmo-repo/EMMOntoPy/pull/731) ([jesper-friis](https://github.com/jesper-friis)) ## [v0.7.1](https://github.com/emmo-repo/EMMOntoPy/tree/v0.7.1) (2024-02-29) -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v0.7.0...v0.7.1) +[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v0.7.0.1...v0.7.1) + +## [v0.7.0.1](https://github.com/emmo-repo/EMMOntoPy/tree/v0.7.0.1) (2024-02-29) + +[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v0.7.0...v0.7.0.1) **Closed issues:** @@ -409,11 +438,13 @@ ## [v0.1.0](https://github.com/emmo-repo/EMMOntoPy/tree/v0.1.0) (2021-10-27) -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.1b...v0.1.0) +[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/34866fa72fea0b178cabbe21dfee06f735bbf373...v0.1.0) **Implemented enhancements:** - "Warning" Importing from `collections` [\#236](https://github.com/emmo-repo/EMMOntoPy/issues/236) +- Add Wu&Palmer measure [\#134](https://github.com/emmo-repo/EMMOntoPy/issues/134) +- Make EMMO-python available on pypi \(installable with pip\) [\#7](https://github.com/emmo-repo/EMMOntoPy/issues/7) **Fixed bugs:** @@ -421,6 +452,7 @@ - Fix documentation build warnings [\#250](https://github.com/emmo-repo/EMMOntoPy/issues/250) - Fix images in documentation [\#233](https://github.com/emmo-repo/EMMOntoPy/issues/233) - Circular reference from Owlready2 [\#210](https://github.com/emmo-repo/EMMOntoPy/issues/210) +- Windows paths are not handled properly [\#147](https://github.com/emmo-repo/EMMOntoPy/issues/147) **Closed issues:** @@ -443,7 +475,52 @@ - Setup Materials for MkDocs framework [\#195](https://github.com/emmo-repo/EMMOntoPy/issues/195) - Clean up demo, examples and docs [\#193](https://github.com/emmo-repo/EMMOntoPy/issues/193) - Formalize review process with checklists [\#190](https://github.com/emmo-repo/EMMOntoPy/issues/190) +- Correct updating of catalog in ontology.load [\#188](https://github.com/emmo-repo/EMMOntoPy/issues/188) +- Failing tests when lodaing battinfo [\#185](https://github.com/emmo-repo/EMMOntoPy/issues/185) - funksjon ontology.add\_class\(label, parent\) [\#183](https://github.com/emmo-repo/EMMOntoPy/issues/183) +- Fix dependatbot to 'wider' [\#182](https://github.com/emmo-repo/EMMOntoPy/issues/182) +- Change to get\_label instead of asstring in ontograph, emmodoc, ontodoc, be careful [\#158](https://github.com/emmo-repo/EMMOntoPy/issues/158) +- licence does not work with metadata [\#157](https://github.com/emmo-repo/EMMOntoPy/issues/157) +- ontograph with several roots fails [\#153](https://github.com/emmo-repo/EMMOntoPy/issues/153) +- fix redudant getlabel, get\_preferred\_label, get\_label [\#152](https://github.com/emmo-repo/EMMOntoPy/issues/152) +- add --no-catalog and default as in emmocheck for ontograph [\#150](https://github.com/emmo-repo/EMMOntoPy/issues/150) +- Use rdflib in Ontology.save\(\) to support more file formats [\#143](https://github.com/emmo-repo/EMMOntoPy/issues/143) +- Tool for publishing domain ontologies [\#140](https://github.com/emmo-repo/EMMOntoPy/issues/140) +- Convert-imported update in utils [\#138](https://github.com/emmo-repo/EMMOntoPy/issues/138) +- make tests for checking upgrade of Owlready2 [\#137](https://github.com/emmo-repo/EMMOntoPy/issues/137) +- Add periodic\_table to examples [\#130](https://github.com/emmo-repo/EMMOntoPy/issues/130) +- Add support for simple property-based ontology annotations like dcterms:license [\#129](https://github.com/emmo-repo/EMMOntoPy/issues/129) +- Update documentation of tools re reasoner [\#123](https://github.com/emmo-repo/EMMOntoPy/issues/123) +- Make fact++ reasoner available and default in tools [\#122](https://github.com/emmo-repo/EMMOntoPy/issues/122) +- Use PyPI token in publish workflow [\#118](https://github.com/emmo-repo/EMMOntoPy/issues/118) +- Update publish workflow [\#115](https://github.com/emmo-repo/EMMOntoPy/issues/115) +- Also use the catalog file to map web URLs, not only local files. [\#109](https://github.com/emmo-repo/EMMOntoPy/issues/109) +- do something [\#108](https://github.com/emmo-repo/EMMOntoPy/issues/108) +- Update Dockerfile to install correct pandoc [\#99](https://github.com/emmo-repo/EMMOntoPy/issues/99) +- Fix loading imported ttl from web such that emmocheck works for crystallography.ttl [\#98](https://github.com/emmo-repo/EMMOntoPy/issues/98) +- Correct turtle serialisation [\#97](https://github.com/emmo-repo/EMMOntoPy/issues/97) +- Add reasoning with FaCT++ [\#95](https://github.com/emmo-repo/EMMOntoPy/issues/95) +- Correctly load ontologies like crystallography that imports both local and online sub-ontologies [\#91](https://github.com/emmo-repo/EMMOntoPy/issues/91) +- Fix flake8 errors [\#88](https://github.com/emmo-repo/EMMOntoPy/issues/88) +- Ontograph: Include multiple parents/inheritance [\#86](https://github.com/emmo-repo/EMMOntoPy/issues/86) +- Remove the .ttl namespace when loading domain-crystallography in EMMO-python [\#83](https://github.com/emmo-repo/EMMOntoPy/issues/83) +- Add option of documenting imported ontologies in ontodoc and ontograph [\#82](https://github.com/emmo-repo/EMMOntoPy/issues/82) +- Check Error with Owlready2-0.26 [\#81](https://github.com/emmo-repo/EMMOntoPy/issues/81) +- Emmocheck fails if Physicaluantities and MeaurementsUnits are not imported from emmo. Make sure that it does not fail if whole of EMMO is not imported. [\#80](https://github.com/emmo-repo/EMMOntoPy/issues/80) +- Ontograph: Make default root [\#79](https://github.com/emmo-repo/EMMOntoPy/issues/79) +- Ontodoc: PDF is not generated, produces error. [\#76](https://github.com/emmo-repo/EMMOntoPy/issues/76) +- AttributeError from ontodoc [\#70](https://github.com/emmo-repo/EMMOntoPy/issues/70) +- Import emmo .ttl from emmo-repo.github.io [\#69](https://github.com/emmo-repo/EMMOntoPy/issues/69) +- Unable to use the vertical interoperability demo .py files [\#66](https://github.com/emmo-repo/EMMOntoPy/issues/66) +- Include all annotations in .get\_annotations\(\) [\#50](https://github.com/emmo-repo/EMMOntoPy/issues/50) +- Not immediately installable with pip [\#45](https://github.com/emmo-repo/EMMOntoPy/issues/45) +- Missing https://emmc.info/emmo-inferred [\#16](https://github.com/emmo-repo/EMMOntoPy/issues/16) +- setup.py [\#15](https://github.com/emmo-repo/EMMOntoPy/issues/15) +- Enhance ontology.sync\_attributes\(\) to also update class names [\#10](https://github.com/emmo-repo/EMMOntoPy/issues/10) +- Add support for the FaCT++ reasoner [\#9](https://github.com/emmo-repo/EMMOntoPy/issues/9) +- Fix emmodoc [\#6](https://github.com/emmo-repo/EMMOntoPy/issues/6) +- Homogenise call to reasoner in emmo.Ontology.sync\_reasoner\(\) [\#5](https://github.com/emmo-repo/EMMOntoPy/issues/5) +- Update the user case ontology [\#3](https://github.com/emmo-repo/EMMOntoPy/issues/3) **Merged pull requests:** @@ -472,44 +549,7 @@ - Added function new\_entitiy to ontology [\#207](https://github.com/emmo-repo/EMMOntoPy/pull/207) ([francescalb](https://github.com/francescalb)) - ttl standard for emmo [\#204](https://github.com/emmo-repo/EMMOntoPy/pull/204) ([francescalb](https://github.com/francescalb)) - Added choice for specifying namespace in get\_by\_label [\#202](https://github.com/emmo-repo/EMMOntoPy/pull/202) ([francescalb](https://github.com/francescalb)) - -## [v1.0.1b](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.1b) (2021-07-01) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.1...v1.0.1b) - -**Closed issues:** - -- Correct updating of catalog in ontology.load [\#188](https://github.com/emmo-repo/EMMOntoPy/issues/188) - -**Merged pull requests:** - - Update version to 1.0.1 [\#189](https://github.com/emmo-repo/EMMOntoPy/pull/189) ([francescalb](https://github.com/francescalb)) - -## [v1.0.1](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.1) (2021-07-01) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0...v1.0.1) - -**Fixed bugs:** - -- Windows paths are not handled properly [\#147](https://github.com/emmo-repo/EMMOntoPy/issues/147) - -**Closed issues:** - -- Failing tests when lodaing battinfo [\#185](https://github.com/emmo-repo/EMMOntoPy/issues/185) -- Fix dependatbot to 'wider' [\#182](https://github.com/emmo-repo/EMMOntoPy/issues/182) -- Change to get\_label instead of asstring in ontograph, emmodoc, ontodoc, be careful [\#158](https://github.com/emmo-repo/EMMOntoPy/issues/158) -- licence does not work with metadata [\#157](https://github.com/emmo-repo/EMMOntoPy/issues/157) -- ontograph with several roots fails [\#153](https://github.com/emmo-repo/EMMOntoPy/issues/153) -- fix redudant getlabel, get\_preferred\_label, get\_label [\#152](https://github.com/emmo-repo/EMMOntoPy/issues/152) -- add --no-catalog and default as in emmocheck for ontograph [\#150](https://github.com/emmo-repo/EMMOntoPy/issues/150) -- make tests for checking upgrade of Owlready2 [\#137](https://github.com/emmo-repo/EMMOntoPy/issues/137) -- Add periodic\_table to examples [\#130](https://github.com/emmo-repo/EMMOntoPy/issues/130) -- Add support for simple property-based ontology annotations like dcterms:license [\#129](https://github.com/emmo-repo/EMMOntoPy/issues/129) -- Update documentation of tools re reasoner [\#123](https://github.com/emmo-repo/EMMOntoPy/issues/123) -- Ontograph: Include multiple parents/inheritance [\#86](https://github.com/emmo-repo/EMMOntoPy/issues/86) - -**Merged pull requests:** - - Fixed updating of catalog in load [\#187](https://github.com/emmo-repo/EMMOntoPy/pull/187) ([francescalb](https://github.com/francescalb)) - Temporarily commented out loading ontologies with error in redirecting link on emmo.info [\#186](https://github.com/emmo-repo/EMMOntoPy/pull/186) ([francescalb](https://github.com/francescalb)) - Changed dependabot to widen [\#181](https://github.com/emmo-repo/EMMOntoPy/pull/181) ([francescalb](https://github.com/francescalb)) @@ -527,135 +567,27 @@ - Issue150 ontograph cannotload emmo inferred directly [\#151](https://github.com/emmo-repo/EMMOntoPy/pull/151) ([francescalb](https://github.com/francescalb)) - Added Fact++ in tools documentation [\#149](https://github.com/emmo-repo/EMMOntoPy/pull/149) ([francescalb](https://github.com/francescalb)) - Improved issue reporting in emmocheck [\#146](https://github.com/emmo-repo/EMMOntoPy/pull/146) ([jesper-friis](https://github.com/jesper-friis)) - -## [v1.0.0](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0) (2021-03-25) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-30...v1.0.0) - -**Closed issues:** - -- Use rdflib in Ontology.save\(\) to support more file formats [\#143](https://github.com/emmo-repo/EMMOntoPy/issues/143) -- Tool for publishing domain ontologies [\#140](https://github.com/emmo-repo/EMMOntoPy/issues/140) - -**Merged pull requests:** - - Save to turtle and ontology annotations \(via the metadata attribute\) [\#144](https://github.com/emmo-repo/EMMOntoPy/pull/144) ([jesper-friis](https://github.com/jesper-friis)) - Corrected configuration of exceptions for test\_class\_label test. [\#142](https://github.com/emmo-repo/EMMOntoPy/pull/142) ([jesper-friis](https://github.com/jesper-friis)) - -## [v1.0.0-alpha-30](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-30) (2021-03-18) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-29...v1.0.0-alpha-30) - -**Merged pull requests:** - - Load ontology [\#141](https://github.com/emmo-repo/EMMOntoPy/pull/141) ([jesper-friis](https://github.com/jesper-friis)) - -## [v1.0.0-alpha-29](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-29) (2021-03-16) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-28...v1.0.0-alpha-29) - -**Implemented enhancements:** - -- Add Wu&Palmer measure [\#134](https://github.com/emmo-repo/EMMOntoPy/issues/134) - -**Closed issues:** - -- Convert-imported update in utils [\#138](https://github.com/emmo-repo/EMMOntoPy/issues/138) - -**Merged pull requests:** - - Fixed reading xml as 'rdfxml' [\#139](https://github.com/emmo-repo/EMMOntoPy/pull/139) ([francescalb](https://github.com/francescalb)) - Added wu\_palmer\_measure for semantic similarity [\#135](https://github.com/emmo-repo/EMMOntoPy/pull/135) ([francescalb](https://github.com/francescalb)) - -## [v1.0.0-alpha-28](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-28) (2021-03-09) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-27...v1.0.0-alpha-28) - -**Closed issues:** - -- Also use the catalog file to map web URLs, not only local files. [\#109](https://github.com/emmo-repo/EMMOntoPy/issues/109) -- Check Error with Owlready2-0.26 [\#81](https://github.com/emmo-repo/EMMOntoPy/issues/81) - -**Merged pull requests:** - - Version updated for rel of v0.28 [\#133](https://github.com/emmo-repo/EMMOntoPy/pull/133) ([francescalb](https://github.com/francescalb)) - Load ontology [\#131](https://github.com/emmo-repo/EMMOntoPy/pull/131) ([jesper-friis](https://github.com/jesper-friis)) - Optimised label lookup in ontology and dir listing. It is now much faster [\#127](https://github.com/emmo-repo/EMMOntoPy/pull/127) ([jesper-friis](https://github.com/jesper-friis)) - Use catalog by default [\#126](https://github.com/emmo-repo/EMMOntoPy/pull/126) ([jesper-friis](https://github.com/jesper-friis)) - -## [v1.0.0-alpha-27](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-27) (2021-02-27) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-26...v1.0.0-alpha-27) - -**Merged pull requests:** - - Ontodoc [\#125](https://github.com/emmo-repo/EMMOntoPy/pull/125) ([jesper-friis](https://github.com/jesper-friis)) - -## [v1.0.0-alpha-26](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-26) (2021-02-26) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-25...v1.0.0-alpha-26) - -**Closed issues:** - -- Make fact++ reasoner available and default in tools [\#122](https://github.com/emmo-repo/EMMOntoPy/issues/122) -- Use PyPI token in publish workflow [\#118](https://github.com/emmo-repo/EMMOntoPy/issues/118) -- Update publish workflow [\#115](https://github.com/emmo-repo/EMMOntoPy/issues/115) -- do something [\#108](https://github.com/emmo-repo/EMMOntoPy/issues/108) - -**Merged pull requests:** - - Added functionality to document domain ontologies [\#124](https://github.com/emmo-repo/EMMOntoPy/pull/124) ([jesper-friis](https://github.com/jesper-friis)) - Made ontoconvert and ontograph tools executable in linux [\#120](https://github.com/emmo-repo/EMMOntoPy/pull/120) ([jesper-friis](https://github.com/jesper-friis)) - Update CI [\#119](https://github.com/emmo-repo/EMMOntoPy/pull/119) ([CasperWA](https://github.com/CasperWA)) - Update publish workflow + add dependabot [\#116](https://github.com/emmo-repo/EMMOntoPy/pull/116) ([CasperWA](https://github.com/CasperWA)) - -## [v1.0.0-alpha-25](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-25) (2021-01-17) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-24...v1.0.0-alpha-25) - -**Closed issues:** - -- Update Dockerfile to install correct pandoc [\#99](https://github.com/emmo-repo/EMMOntoPy/issues/99) -- Correct turtle serialisation [\#97](https://github.com/emmo-repo/EMMOntoPy/issues/97) - -**Merged pull requests:** - - Update emmocheck exceptions [\#113](https://github.com/emmo-repo/EMMOntoPy/pull/113) ([jesper-friis](https://github.com/jesper-friis)) - Fix recursion in graph [\#112](https://github.com/emmo-repo/EMMOntoPy/pull/112) ([jesper-friis](https://github.com/jesper-friis)) - Avoid unnessesary/infinite recursion in get\_imported\_ontologies\(\) [\#111](https://github.com/emmo-repo/EMMOntoPy/pull/111) ([jesper-friis](https://github.com/jesper-friis)) - Break recursion error in get\_by\_label\(\) [\#110](https://github.com/emmo-repo/EMMOntoPy/pull/110) ([jesper-friis](https://github.com/jesper-friis)) - Updated the Ontology.sync\_attributes\(\) method. [\#107](https://github.com/emmo-repo/EMMOntoPy/pull/107) ([jesper-friis](https://github.com/jesper-friis)) - Updated pandoc req in Dockerfile [\#106](https://github.com/emmo-repo/EMMOntoPy/pull/106) ([francescalb](https://github.com/francescalb)) - -## [v1.0.0-alpha-24](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-24) (2021-01-04) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-23...v1.0.0-alpha-24) - -**Merged pull requests:** - - Bumped version number up to 1.0.0-alpha-24 [\#105](https://github.com/emmo-repo/EMMOntoPy/pull/105) ([jesper-friis](https://github.com/jesper-friis)) - -## [v1.0.0-alpha-23](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-23) (2021-01-04) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-22...v1.0.0-alpha-23) - -**Closed issues:** - -- Fix loading imported ttl from web such that emmocheck works for crystallography.ttl [\#98](https://github.com/emmo-repo/EMMOntoPy/issues/98) -- Add reasoning with FaCT++ [\#95](https://github.com/emmo-repo/EMMOntoPy/issues/95) -- Correctly load ontologies like crystallography that imports both local and online sub-ontologies [\#91](https://github.com/emmo-repo/EMMOntoPy/issues/91) -- Fix flake8 errors [\#88](https://github.com/emmo-repo/EMMOntoPy/issues/88) -- Remove the .ttl namespace when loading domain-crystallography in EMMO-python [\#83](https://github.com/emmo-repo/EMMOntoPy/issues/83) -- Add option of documenting imported ontologies in ontodoc and ontograph [\#82](https://github.com/emmo-repo/EMMOntoPy/issues/82) -- Emmocheck fails if Physicaluantities and MeaurementsUnits are not imported from emmo. Make sure that it does not fail if whole of EMMO is not imported. [\#80](https://github.com/emmo-repo/EMMOntoPy/issues/80) -- Ontograph: Make default root [\#79](https://github.com/emmo-repo/EMMOntoPy/issues/79) -- Ontodoc: PDF is not generated, produces error. [\#76](https://github.com/emmo-repo/EMMOntoPy/issues/76) -- AttributeError from ontodoc [\#70](https://github.com/emmo-repo/EMMOntoPy/issues/70) -- Import emmo .ttl from emmo-repo.github.io [\#69](https://github.com/emmo-repo/EMMOntoPy/issues/69) -- Unable to use the vertical interoperability demo .py files [\#66](https://github.com/emmo-repo/EMMOntoPy/issues/66) - -**Merged pull requests:** - - Release 1.0.0-alpha-23 [\#104](https://github.com/emmo-repo/EMMOntoPy/pull/104) ([jesper-friis](https://github.com/jesper-friis)) - Allow to load turtle ontologies without catalog file. [\#102](https://github.com/emmo-repo/EMMOntoPy/pull/102) ([jesper-friis](https://github.com/jesper-friis)) - Updated README file [\#100](https://github.com/emmo-repo/EMMOntoPy/pull/100) ([jesper-friis](https://github.com/jesper-friis)) @@ -668,148 +600,37 @@ - Automatically find roots in ontograph [\#85](https://github.com/emmo-repo/EMMOntoPy/pull/85) ([francescalb](https://github.com/francescalb)) - Automatic import of ttl from GitHub emmo-repo.io [\#84](https://github.com/emmo-repo/EMMOntoPy/pull/84) ([francescalb](https://github.com/francescalb)) - Fixes needed for access ontologies [\#77](https://github.com/emmo-repo/EMMOntoPy/pull/77) ([jesper-friis](https://github.com/jesper-friis)) - -## [v1.0.0-alpha-22](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-22) (2020-12-21) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-21b...v1.0.0-alpha-22) - -**Merged pull requests:** - - Loading ttl both locally and importing from iri [\#75](https://github.com/emmo-repo/EMMOntoPy/pull/75) ([francescalb](https://github.com/francescalb)) - Added sync\_python\_names\(\) and corrected handling of individuals in sync\_attributes\(\) [\#73](https://github.com/emmo-repo/EMMOntoPy/pull/73) ([jesper-friis](https://github.com/jesper-friis)) - Add preflabel to individuals declared in python [\#72](https://github.com/emmo-repo/EMMOntoPy/pull/72) ([jesper-friis](https://github.com/jesper-friis)) - -## [v1.0.0-alpha-21b](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-21b) (2020-12-13) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-21...v1.0.0-alpha-21b) - -**Merged pull requests:** - - Fix bug introduced in ontoconvert [\#71](https://github.com/emmo-repo/EMMOntoPy/pull/71) ([jesper-friis](https://github.com/jesper-friis)) - -## [v1.0.0-alpha-21](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-21) (2020-12-11) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-20b...v1.0.0-alpha-21) - -**Merged pull requests:** - - Use rdflib to load non-supported formats. [\#68](https://github.com/emmo-repo/EMMOntoPy/pull/68) ([jesper-friis](https://github.com/jesper-friis)) - Added a quick fix for vertical demo. [\#67](https://github.com/emmo-repo/EMMOntoPy/pull/67) ([jesper-friis](https://github.com/jesper-friis)) - Updated emmocheck to new 1.0.0-beta. Old version should still work. [\#65](https://github.com/emmo-repo/EMMOntoPy/pull/65) ([jesper-friis](https://github.com/jesper-friis)) - Added ontoconvert tool [\#64](https://github.com/emmo-repo/EMMOntoPy/pull/64) ([jesper-friis](https://github.com/jesper-friis)) - Improved error messages for classes that doesn't define prefLabel [\#63](https://github.com/emmo-repo/EMMOntoPy/pull/63) ([jesper-friis](https://github.com/jesper-friis)) - -## [v1.0.0-alpha-20b](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-20b) (2020-11-04) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-20...v1.0.0-alpha-20b) - -**Merged pull requests:** - - Version1.0.0 alpha20 [\#62](https://github.com/emmo-repo/EMMOntoPy/pull/62) ([francescalb](https://github.com/francescalb)) - -## [v1.0.0-alpha-20](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-20) (2020-11-04) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-19...v1.0.0-alpha-20) - -**Merged pull requests:** - - Improve support for imported ontologies [\#61](https://github.com/emmo-repo/EMMOntoPy/pull/61) ([jesper-friis](https://github.com/jesper-friis)) - -## [v1.0.0-alpha-19](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-19) (2020-11-02) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-18...v1.0.0-alpha-19) - -**Merged pull requests:** - - Added --ignore-namespace to emmocheck [\#60](https://github.com/emmo-repo/EMMOntoPy/pull/60) ([francescalb](https://github.com/francescalb)) - -## [v1.0.0-alpha-18](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-18) (2020-10-29) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-17...v1.0.0-alpha-18) - -**Merged pull requests:** - - Bumped up version number to 1.0.0-alpha-18 [\#59](https://github.com/emmo-repo/EMMOntoPy/pull/59) ([jesper-friis](https://github.com/jesper-friis)) - Added option url\_from\_catalog to ontology.load\(\) [\#58](https://github.com/emmo-repo/EMMOntoPy/pull/58) ([jesper-friis](https://github.com/jesper-friis)) - Added get\_preferred\_label\(\) method to classes, properties and individuals [\#57](https://github.com/emmo-repo/EMMOntoPy/pull/57) ([jesper-friis](https://github.com/jesper-friis)) - Correct default IRI to inferred ontology [\#56](https://github.com/emmo-repo/EMMOntoPy/pull/56) ([jesper-friis](https://github.com/jesper-friis)) - -## [v1.0.0-alpha-17](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-17) (2020-10-21) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-16...v1.0.0-alpha-17) - -**Merged pull requests:** - - Added materials.EngineeredMaterial to namespace exception in emmocheck [\#55](https://github.com/emmo-repo/EMMOntoPy/pull/55) ([francescalb](https://github.com/francescalb)) - -## [v1.0.0-alpha-16](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-16) (2020-10-20) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-15...v1.0.0-alpha-16) - -**Closed issues:** - -- Include all annotations in .get\_annotations\(\) [\#50](https://github.com/emmo-repo/EMMOntoPy/issues/50) - -**Merged pull requests:** - - Update to v1.0.0-alpha-16 for new release [\#54](https://github.com/emmo-repo/EMMOntoPy/pull/54) ([francescalb](https://github.com/francescalb)) - Update dimensionality checks [\#53](https://github.com/emmo-repo/EMMOntoPy/pull/53) ([jesper-friis](https://github.com/jesper-friis)) - Updated to say that pypi realese is automatic in docs [\#52](https://github.com/emmo-repo/EMMOntoPy/pull/52) ([francescalb](https://github.com/francescalb)) - -## [v1.0.0-alpha-15](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-15) (2020-09-25) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-13...v1.0.0-alpha-15) - -**Merged pull requests:** - - Added all labels in get\_class\_annotations in emmo/patch.py including [\#51](https://github.com/emmo-repo/EMMOntoPy/pull/51) ([francescalb](https://github.com/francescalb)) - Support use of skos:prefLabel instead of rdfs:label [\#49](https://github.com/emmo-repo/EMMOntoPy/pull/49) ([jesper-friis](https://github.com/jesper-friis)) - v1.0.0-alpha-14 [\#48](https://github.com/emmo-repo/EMMOntoPy/pull/48) ([jesper-friis](https://github.com/jesper-friis)) - Fix emmocheck to not fail upon use of dcterms and skos [\#47](https://github.com/emmo-repo/EMMOntoPy/pull/47) ([jesper-friis](https://github.com/jesper-friis)) - -## [v1.0.0-alpha-13](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-13) (2020-09-19) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-11...v1.0.0-alpha-13) - -**Closed issues:** - -- Not immediately installable with pip [\#45](https://github.com/emmo-repo/EMMOntoPy/issues/45) - -**Merged pull requests:** - - Fix setup [\#46](https://github.com/emmo-repo/EMMOntoPy/pull/46) ([jesper-friis](https://github.com/jesper-friis)) - Make emmo package pip installable in fresh env [\#44](https://github.com/emmo-repo/EMMOntoPy/pull/44) ([CasperWA](https://github.com/CasperWA)) - Update emmodoc to latest version of emmo-alpha2 [\#43](https://github.com/emmo-repo/EMMOntoPy/pull/43) ([jesper-friis](https://github.com/jesper-friis)) - Ensure that emmocheck exit with non-zero return value if a test is faing [\#42](https://github.com/emmo-repo/EMMOntoPy/pull/42) ([jesper-friis](https://github.com/jesper-friis)) - Installed missing dependencies in pythonpublish deployment workflow [\#41](https://github.com/emmo-repo/EMMOntoPy/pull/41) ([jesper-friis](https://github.com/jesper-friis)) - -## [v1.0.0-alpha-11](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-11) (2020-08-12) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-10...v1.0.0-alpha-11) - -**Merged pull requests:** - - Add skip option to emmocheck [\#40](https://github.com/emmo-repo/EMMOntoPy/pull/40) ([jesper-friis](https://github.com/jesper-friis)) - -## [v1.0.0-alpha-10](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-10) (2020-04-27) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-9...v1.0.0-alpha-10) - -**Merged pull requests:** - - Added exceptions to emmocheck "test\_number\_of\_labels" [\#39](https://github.com/emmo-repo/EMMOntoPy/pull/39) ([jesper-friis](https://github.com/jesper-friis)) - -## [v1.0.0-alpha-9](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-9) (2020-04-13) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-8...v1.0.0-alpha-9) - -**Closed issues:** - -- Enhance ontology.sync\_attributes\(\) to also update class names [\#10](https://github.com/emmo-repo/EMMOntoPy/issues/10) -- Add support for the FaCT++ reasoner [\#9](https://github.com/emmo-repo/EMMOntoPy/issues/9) - -**Merged pull requests:** - - Set new release version 1.0.0-alpha-9 [\#38](https://github.com/emmo-repo/EMMOntoPy/pull/38) ([francescalb](https://github.com/francescalb)) - Added get\_version\(\) and set\_version\(\) methods to emmo.Ontology. [\#37](https://github.com/emmo-repo/EMMOntoPy/pull/37) ([jesper-friis](https://github.com/jesper-friis)) - Updated example in README file to current version of EMMO. [\#36](https://github.com/emmo-repo/EMMOntoPy/pull/36) ([jesper-friis](https://github.com/jesper-friis)) @@ -818,75 +639,17 @@ - Fixed PyPI badge in README [\#33](https://github.com/emmo-repo/EMMOntoPy/pull/33) ([jesper-friis](https://github.com/jesper-friis)) - Update emmocheck [\#32](https://github.com/emmo-repo/EMMOntoPy/pull/32) ([jesper-friis](https://github.com/jesper-friis)) - Sync attributes [\#31](https://github.com/emmo-repo/EMMOntoPy/pull/31) ([jesper-friis](https://github.com/jesper-friis)) +- 1.0.0 alpha 8 [\#30](https://github.com/emmo-repo/EMMOntoPy/pull/30) ([jesper-friis](https://github.com/jesper-friis)) - Cleanup ci workflow [\#28](https://github.com/emmo-repo/EMMOntoPy/pull/28) ([jesper-friis](https://github.com/jesper-friis)) - Added ontoversion tool [\#27](https://github.com/emmo-repo/EMMOntoPy/pull/27) ([jesper-friis](https://github.com/jesper-friis)) - Update emmodoc [\#25](https://github.com/emmo-repo/EMMOntoPy/pull/25) ([jesper-friis](https://github.com/jesper-friis)) - -## [v1.0.0-alpha-8](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-8) (2020-03-22) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-5...v1.0.0-alpha-8) - -**Merged pull requests:** - -- 1.0.0 alpha 8 [\#30](https://github.com/emmo-repo/EMMOntoPy/pull/30) ([jesper-friis](https://github.com/jesper-friis)) - Updated requirements such that "pip install EMMO" works [\#24](https://github.com/emmo-repo/EMMOntoPy/pull/24) ([jesper-friis](https://github.com/jesper-friis)) - -## [v1.0.0-alpha-5](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-5) (2020-03-18) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-3...v1.0.0-alpha-5) - -**Implemented enhancements:** - -- Make EMMO-python available on pypi \(installable with pip\) [\#7](https://github.com/emmo-repo/EMMOntoPy/issues/7) - -**Merged pull requests:** - - Bumbed up version to 1.0.0-alpha-5 [\#23](https://github.com/emmo-repo/EMMOntoPy/pull/23) ([jesper-friis](https://github.com/jesper-friis)) - Emmocheck [\#22](https://github.com/emmo-repo/EMMOntoPy/pull/22) ([jesper-friis](https://github.com/jesper-friis)) - Reworked the generation of graphs - using the graphviz Python package [\#21](https://github.com/emmo-repo/EMMOntoPy/pull/21) ([jesper-friis](https://github.com/jesper-friis)) - 1.0.0 [\#19](https://github.com/emmo-repo/EMMOntoPy/pull/19) ([jesper-friis](https://github.com/jesper-friis)) - -## [v1.0.0-alpha-3](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-3) (2020-02-16) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-2...v1.0.0-alpha-3) - -## [v1.0.0-alpha-2](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-2) (2020-01-11) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha-1...v1.0.0-alpha-2) - -## [v1.0.0-alpha-1](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha-1) (2020-01-11) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v1.0.0-alpha...v1.0.0-alpha-1) - -**Closed issues:** - -- Missing https://emmc.info/emmo-inferred [\#16](https://github.com/emmo-repo/EMMOntoPy/issues/16) -- setup.py [\#15](https://github.com/emmo-repo/EMMOntoPy/issues/15) -- Fix emmodoc [\#6](https://github.com/emmo-repo/EMMOntoPy/issues/6) - -## [v1.0.0-alpha](https://github.com/emmo-repo/EMMOntoPy/tree/v1.0.0-alpha) (2020-01-08) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/v0.9.9...v1.0.0-alpha) - -**Closed issues:** - -- Update the user case ontology [\#3](https://github.com/emmo-repo/EMMOntoPy/issues/3) - -**Merged pull requests:** - - Fixed a typo in the title [\#14](https://github.com/emmo-repo/EMMOntoPy/pull/14) ([blokhin](https://github.com/blokhin)) - Fixed \#5 - homogenised call to reasoner [\#13](https://github.com/emmo-repo/EMMOntoPy/pull/13) ([francescalb](https://github.com/francescalb)) - -## [v0.9.9](https://github.com/emmo-repo/EMMOntoPy/tree/v0.9.9) (2019-07-14) - -[Full Changelog](https://github.com/emmo-repo/EMMOntoPy/compare/34866fa72fea0b178cabbe21dfee06f735bbf373...v0.9.9) - -**Closed issues:** - -- Homogenise call to reasoner in emmo.Ontology.sync\_reasoner\(\) [\#5](https://github.com/emmo-repo/EMMOntoPy/issues/5) - -**Merged pull requests:** - - \#3 update usercase ontology [\#12](https://github.com/emmo-repo/EMMOntoPy/pull/12) ([jesper-friis](https://github.com/jesper-friis)) - Fixed 3 [\#8](https://github.com/emmo-repo/EMMOntoPy/pull/8) ([jesper-friis](https://github.com/jesper-friis)) - Dockerdevel [\#2](https://github.com/emmo-repo/EMMOntoPy/pull/2) ([francescalb](https://github.com/francescalb)) diff --git a/ontopy/__init__.py b/ontopy/__init__.py index fae242c59..73ed5e5c8 100644 --- a/ontopy/__init__.py +++ b/ontopy/__init__.py @@ -3,7 +3,7 @@ # pylint: disable=wrong-import-position,wrong-import-order import sys -__version__ = "0.7.1" +__version__ = "0.7.2" # Ensure correct Python version if sys.version_info < (3, 7): diff --git a/ontopy/excelparser.py b/ontopy/excelparser.py index 2b7a8762d..0b6776285 100755 --- a/ontopy/excelparser.py +++ b/ontopy/excelparser.py @@ -34,6 +34,7 @@ class ExcelError(EMMOntoPyException): def create_ontology_from_excel( # pylint: disable=too-many-arguments, too-many-locals excelpath: str, + *, concept_sheet_name: str = "Concepts", metadata_sheet_name: str = "Metadata", imports_sheet_name: str = "ImportedOntologies", @@ -290,7 +291,7 @@ def _relative_to_absolute_paths(path): ) -def create_ontology_from_pandas( # pylint:disable=too-many-locals,too-many-branches,too-many-statements,too-many-arguments +def create_ontology_from_pandas( # pylint:disable=too-many-locals,too-many-branches,too-many-statements,too-many-arguments, too-many-positional-arguments data: pd.DataFrame, objectproperties: pd.DataFrame, annotationproperties: pd.DataFrame, @@ -312,6 +313,15 @@ def create_ontology_from_pandas( # pylint:disable=too-many-locals,too-many-bran if input_ontology: onto = input_ontology catalog = {} + # Since we will remove newly created python_name added + # by owlready2 in the triples, we keep track of those + # that come from the input ontology + pyname_triples_to_keep = list( + onto.get_unabbreviated_triples( + predicate="http://www.lesfleursdunormal.fr/static/_downloads/" + "owlready_ontology.owl#python_name" + ) + ) else: # Create new ontology onto, catalog = get_metadata_from_dataframe( metadata, base_iri, imports=imports @@ -455,6 +465,22 @@ def create_ontology_from_pandas( # pylint:disable=too-many-locals,too-many-bran entities_with_errors = { key: set(value) for key, value in entities_with_errors.items() } + + # Remove triples with predicate 'python_name' added by owlready2 + onto._del_data_triple_spod( # pylint: disable=protected-access + p=onto._abbreviate( # pylint: disable=protected-access + "http://www.lesfleursdunormal.fr/static/_downloads/" + "owlready_ontology.owl#python_name" + ) + ) + + # Add back the triples python name triples that were in the input_ontology. + if input_ontology: + for triple in pyname_triples_to_keep: + onto._add_data_triple_spod( # pylint: disable=protected-access + s=triple[0], p=triple[1], o=triple[2] + ) + return onto, catalog, entities_with_errors @@ -585,6 +611,7 @@ def _add_literal( # pylint: disable=too-many-arguments data: Union[pd.DataFrame, pd.Series], destination: owlready2.prop.IndividualValueList, # name: str, + *, metadata: bool = False, only_one: bool = False, sep: str = ";", @@ -903,7 +930,7 @@ def _add_range_domain( return onto, properties_with_errors -def _make_entity_list( # pylint: disable=too-many-arguments +def _make_entity_list( # pylint: disable=too-many-arguments, too-many-positional-arguments onto: owlready2.Ontology, row: pd.Series, rowheader: str, diff --git a/ontopy/graph.py b/ontopy/graph.py index 7b7ac7f05..672120db0 100644 --- a/ontopy/graph.py +++ b/ontopy/graph.py @@ -239,6 +239,7 @@ def __init__( # pylint: disable=too-many-arguments,too-many-locals self, ontology, root=None, + *, leaves=None, entities=None, relations="isA", @@ -296,7 +297,7 @@ def __init__( # pylint: disable=too-many-arguments,too-many-locals elif root: self.add_branch( root, - leaves, + leaves=leaves, relations=relations, edgelabels=edgelabels, addnodes=addnodes, @@ -326,6 +327,7 @@ def __init__( # pylint: disable=too-many-arguments,too-many-locals def add_entities( # pylint: disable=too-many-arguments self, entities=None, + *, relations="isA", edgelabels=None, addnodes=False, @@ -353,6 +355,7 @@ def add_entities( # pylint: disable=too-many-arguments def add_branch( # pylint: disable=too-many-arguments,too-many-locals self, root, + *, leaves=None, include_leaves=True, strict_leaves=False, @@ -427,6 +430,7 @@ def add_branch( # pylint: disable=too-many-arguments,too-many-locals def add_parents( # pylint: disable=too-many-arguments self, name, + *, levels=1, relations="isA", edgelabels=None, @@ -522,6 +526,7 @@ def add_edge(self, subject, predicate, obj, edgelabel=None, **attrs): def add_source_edges( # pylint: disable=too-many-arguments,too-many-branches self, source, + *, relations=None, edgelabels=None, addnodes=None, @@ -607,6 +612,7 @@ def add_source_edges( # pylint: disable=too-many-arguments,too-many-branches def add_edges( # pylint: disable=too-many-arguments self, + *, sources=None, relations=None, edgelabels=None, @@ -998,6 +1004,7 @@ def setmodules(onto): def plot_modules( # pylint: disable=too-many-arguments src, filename=None, + *, fmt=None, show=False, strip_base=None, diff --git a/ontopy/ontodoc.py b/ontopy/ontodoc.py index 872565c8e..387ab983b 100644 --- a/ontopy/ontodoc.py +++ b/ontopy/ontodoc.py @@ -597,6 +597,7 @@ def __init__( # pylint: disable=too-many-arguments template, ontodoc, basedir=".", + *, figdir="genfigs", figformat="png", figscale=1.0, @@ -756,7 +757,7 @@ def process_branches(self): branch, int(opts.header_level) # pylint: disable=no-member ).split("\n") - def _make_branchfig( # pylint: disable=too-many-arguments,too-many-locals + def _make_branchfig( # pylint: disable=too-many-arguments,too-many-locals, too-many-positional-arguments self, name: str, path: "Union[Path, str]", @@ -1142,6 +1143,7 @@ def process(self): def write( # pylint: disable=too-many-arguments self, outfile, + *, fmt=None, pandoc_option_files=(), pandoc_options=(), @@ -1288,6 +1290,7 @@ def run_pandoc( # pylint: disable=too-many-arguments genfile, outfile, fmt, + *, pandoc_option_files=(), pandoc_options=(), verbose=True, @@ -1444,6 +1447,7 @@ def get_maxwidth(fmt): def get_docpp( # pylint: disable=too-many-arguments ontodoc, infile, + *, figdir="genfigs", figformat="png", maxwidth=None, diff --git a/ontopy/ontology.py b/ontopy/ontology.py index d9731b8e9..e6fc1d053 100644 --- a/ontopy/ontology.py +++ b/ontopy/ontology.py @@ -156,6 +156,7 @@ def get_unabbreviated_triples( ): # pylint: disable=invalid-name """Returns all triples unabbreviated. + Imported ontologies not included. If any of the `subject`, `predicate` or `obj` arguments are given, only matching triples will be returned. @@ -311,6 +312,7 @@ def set_default_label_annotations(self): def get_by_label( self, label: str, + *, label_annotations: str = None, prefix: str = None, imported: bool = True, @@ -586,6 +588,7 @@ def set_common_prefix( def load( # pylint: disable=too-many-arguments,arguments-renamed self, + *, only_local=False, filename=None, format=None, # pylint: disable=redefined-builtin @@ -677,6 +680,7 @@ def load( # pylint: disable=too-many-arguments,arguments-renamed def _load( # pylint: disable=too-many-arguments,too-many-locals,too-many-branches,too-many-statements self, + *, only_local=False, filename=None, format=None, # pylint: disable=redefined-builtin @@ -864,6 +868,7 @@ def save( filename=None, format=None, dir=".", + *, mkdir=False, overwrite=False, recursive=False, @@ -1128,6 +1133,7 @@ def rec_imported(onto, imported): def get_entities( # pylint: disable=too-many-arguments self, + *, imported=True, classes=True, individuals=True, @@ -1537,6 +1543,7 @@ def get_branch( # pylint: disable=too-many-arguments root, leaves=(), include_leaves=True, + *, strict_leaves=False, exclude=None, sort=False, @@ -2151,6 +2158,7 @@ def _get_unabbreviated_triples( onto, subject=None, predicate=None, obj=None, blank=None ): """Help function returning all matching triples unabbreviated. + Does not include imported ontologies. If `blank` is given, it will be used to represent blank nodes. """ diff --git a/ontopy/utils.py b/ontopy/utils.py index 85905b42f..819a1a4cd 100644 --- a/ontopy/utils.py +++ b/ontopy/utils.py @@ -342,6 +342,7 @@ class ReadCatalogError(IOError): def read_catalog( # pylint: disable=too-many-locals,too-many-statements,too-many-arguments uri, + *, catalog_file="catalog-v001.xml", baseuri=None, recursive=False, @@ -602,6 +603,7 @@ def _validate_installed_version( def convert_imported( # pylint: disable=too-many-arguments,too-many-locals input_ontology: "Union[Path, str]", output_ontology: "Union[Path, str]", + *, input_format: "Optional[str]" = None, output_format: str = "xml", url_from_catalog: "Optional[bool]" = None, diff --git a/requirements.txt b/requirements.txt index 0d97d1d20..7855eaf40 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ defusedxml>=0.7.1,<1 graphviz>=0.16,<0.21 numpy>=1.19.5,<3 openpyxl>=3.0.9,<3.2 -Owlready2>=0.28,!=0.32,!=0.34,<0.44 +Owlready2>=0.28,!=0.32,!=0.34,<0.48 packaging>=21.0,<25 pandas>=1.2,<2.3 Pygments>=2.7.4,<3 diff --git a/requirements_dev.txt b/requirements_dev.txt index c278c9e39..9060659b9 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,8 +1,9 @@ pre-commit>=2.21.0,<3; python_version<"3.9" -pre-commit~=3.7; python_version>="3.9" +pre-commit~=4.0; python_version>="3.9" pylint~=2.17; python_version<"3.8" -pylint~=3.2; python_version>="3.8" +pylint==3.2.7; python_version=="3.8" +pylint~=3.3; python_version>="3.9" pytest~=7.4; python_version<"3.8" -pytest~=8.2; python_version>="3.8" +pytest~=8.3; python_version>="3.8" pytest-cov~=4.1; python_version<"3.8" pytest-cov~=5.0; python_version>="3.8" diff --git a/requirements_docs.txt b/requirements_docs.txt index 48a2c3b5a..d6cbd7340 100644 --- a/requirements_docs.txt +++ b/requirements_docs.txt @@ -4,5 +4,6 @@ mkdocs~=1.6; python_version>="3.8" mkdocs-awesome-pages-plugin~=2.9 mkdocs-material~=9.5; python_version>="3.8" mkdocs-material~=9.2; python_version<"3.8" -mkdocstrings[python-legacy]~=0.25.1; python_version>="3.8" +mkdocstrings[python-legacy]~=0.26.2; python_version>="3.9" +mkdocstrings[python-legacy]==0.26.1; python_version=="3.8" mkdocstrings[python-legacy]~=0.22.0; python_version<"3.8" diff --git a/tests/test_excelparser/test_excelparser.py b/tests/test_excelparser/test_excelparser.py index 58d6da30a..571b00d9b 100644 --- a/tests/test_excelparser/test_excelparser.py +++ b/tests/test_excelparser/test_excelparser.py @@ -95,6 +95,39 @@ def test_excelparser(repo_dir: "Path") -> None: assert updated_onto.FinitePattern.iri == onto.FinitePattern.iri assert len(list(onto.classes())) + 1 == len(list(updated_onto.classes())) + # check that the owlready2 generated python names are not in the triples + assert ( + list( + ontology.get_unabbreviated_triples( + predicate="http://www.lesfleursdunormal.fr/static/_downloads/" + "owlready_ontology.owl#python_name" + ) + ) + == [] + ) + # check that the owlready2 generated python names are not in the triples + assert ( + list( + updated_onto.get_unabbreviated_triples( + predicate="http://www.lesfleursdunormal.fr/static/_downloads/" + "owlready_ontology.owl#python_name" + ) + ) + == [] + ) + + # Just to be sure that the method of getting the correct triples is OK + assert ( + len( + list( + ontology.get_unabbreviated_triples( + predicate="http://www.w3.org/2000/01/rdf-schema#subClassOf" + ) + ) + ) + > 1 + ) + def test_excelparser_only_classes(repo_dir: "Path") -> None: """This loads the excelfile used and tests that the resulting ontology prior diff --git a/tests/test_load.py b/tests/test_load.py index 35c911fd3..02937e0cc 100755 --- a/tests/test_load.py +++ b/tests/test_load.py @@ -55,9 +55,9 @@ def test_load(repo_dir: "Path", testonto: "Ontology") -> None: def test_load_rdfs() -> None: + """Test to load non-emmo based ontologies rdf and rdfs""" from ontopy import get_ontology - # Test loading non-EMMO-based ontologies rdf and rdfs rdf_onto = get_ontology( "https://www.w3.org/1999/02/22-rdf-syntax-ns.ttl" ).load(emmo_based=False) @@ -65,4 +65,4 @@ def test_load_rdfs() -> None: emmo_based=False ) rdfs_onto.Class # Needed to initialize rdfs_onto - assert type(rdf_onto.HTML).iri == rdfs_onto.Datatype.iri + assert rdf_onto.HTML.is_a[0].iri == rdfs_onto.Datatype.iri