Skip to content

Interpret rdfs:Class as classes on SimPhoNy v3, include dcmitype and dcterms namespaces#760

Merged
domgz merged 26 commits into
devfrom
enh/add-dcat-and-datamodel
Mar 30, 2022
Merged

Interpret rdfs:Class as classes on SimPhoNy v3, include dcmitype and dcterms namespaces#760
domgz merged 26 commits into
devfrom
enh/add-dcat-and-datamodel

Conversation

@domgz

@domgz domgz commented Feb 24, 2022

Copy link
Copy Markdown
Contributor

No description provided.

@domgz domgz added 🌱 new feature Solving the issue involves the incorporation of a new feature. 📜 ontology labels Feb 24, 2022
@domgz

domgz commented Feb 24, 2022

Copy link
Copy Markdown
Contributor Author

@MBueschelberger just made the PR myself from your branch. As said, I will look into merging this.

@domgz domgz self-assigned this Feb 24, 2022
@MBueschelberger

MBueschelberger commented Feb 24, 2022

Copy link
Copy Markdown
Member

Hi @kysrpex, thanks for regarding my commits!

I will have a meeting on Friday this week in order to discuss the inluded yml-specs. If there are no further suggestions on the implementation, I would consider this PR to be ready from my side.

@domgz

domgz commented Mar 17, 2022

Copy link
Copy Markdown
Contributor Author

@MBueschelberger I think with the latest changes most things are OK. I am still unsure about the requirements declared on the new yml files (they look OK at first sight though) and whether defining the relationships you chose as active makes sense or not. I might ask tomorrow for some assistance from somebody else that has used these ontologies.

@domgz

domgz commented Mar 17, 2022

Copy link
Copy Markdown
Contributor Author

@pablo-de-andres @yoavnash Please read this comment and judge whether this should be documented or not. It is essentially incomplete support for RDFS vocabularies (only classes). Also if you consider yourself experienced enough with the ontologies that @MBueschelberger has introduced, please consider reviewing these aspects.

@MBueschelberger please consider also making a PR on the docs and documenting it yourself if @pablo-de-andres or @yoavnash require documentation, because within the coming days I have not much flexibility to do this + look at the requirements and active relationships issue and your PR can be delayed even further.

@domgz domgz marked this pull request as ready for review March 17, 2022 18:10
@domgz

domgz commented Mar 17, 2022

Copy link
Copy Markdown
Contributor Author

@yoavnash @pablo-de-andres I am aware that tests are failing for Python 3.6, but there are a lot of things that can be reviewed already.

@domgz domgz linked an issue Mar 17, 2022 that may be closed by this pull request
@pablo-de-andres

Copy link
Copy Markdown
Member

Maybe a point could be added to this section with the predicates that are used to define classes?

Comment thread osp/core/ontology/docs/dcat2.yml
@domgz

domgz commented Mar 18, 2022

Copy link
Copy Markdown
Contributor Author

Maybe a point could be added to this section with the predicates that are used to define classes?

Done (see docs PR)

@domgz

domgz commented Mar 18, 2022

Copy link
Copy Markdown
Contributor Author

@yoavnash @pablo-de-andres I am aware that tests are failing for Python 3.6, but there are a lot of things that can be reviewed already.

This has been solved now, the PR is fully ready to review together with docs.

@domgz

domgz commented Mar 24, 2022

Copy link
Copy Markdown
Contributor Author

Added quick and dirty dependency resolution as @yoavnash requested here, together with a lot of technical debt. Thank god it is on SimPhoNy v3.

Examples:

$ pico install dcat2
INFO 2022-03-24 17:52:19,681 [osp.core.ontology.installation]: Additional ontology packages were queued for installation because some of the packages to be installed depend on them: dcmitype was queued because dcterms depends on it; dcterms was queued because dcat2 depends on it; foaf was queued because dcat2 depends on it; prov was queued because dcat2 depends on it.
INFO 2022-03-24 17:52:19,681 [osp.core.ontology.installation]: Will install the following namespaces: ['prov', 'foaf', 'dcmitype', 'dcterms', 'dcat2']
INFO 2022-03-24 17:52:19,682 [osp.core.ontology.namespace_registry]: Loading namespaces prov, http://www.w3.org/ns/prov#.
INFO 2022-03-24 17:52:19,682 [osp.core.ontology.parser.owl.parser]: Downloading http://www.w3.org/ns/prov-o.
INFO 2022-03-24 17:52:25,624 [osp.core.ontology.namespace_registry]: Loading namespaces foaf, http://xmlns.com/foaf/0.1/.
INFO 2022-03-24 17:52:25,624 [osp.core.ontology.parser.owl.parser]: Downloading http://xmlns.com/foaf/spec/index.rdf.
INFO 2022-03-24 17:52:26,382 [osp.core.ontology.namespace_registry]: Loading namespaces dcmitype, http://purl.org/dc/dcmitype/.
INFO 2022-03-24 17:52:26,382 [osp.core.ontology.parser.owl.parser]: Downloading https://www.dublincore.org/specifications/dublin-core/dcmi-terms/dublin_core_type.ttl.
INFO 2022-03-24 17:52:26,547 [osp.core.ontology.namespace_registry]: Loading namespaces dcterms, http://purl.org/dc/terms/.
INFO 2022-03-24 17:52:26,547 [osp.core.ontology.parser.owl.parser]: Downloading https://www.dublincore.org/specifications/dublin-core/dcmi-terms/dublin_core_terms.ttl.
WARNING 2022-03-24 17:52:26,746 [osp.core.ontology.parser.owl.parser]: The ontology package dcterms contains the following RDF properties: http://purl.org/dc/terms/accessRights, http://purl.org/dc/terms/accrualPolicy, http://purl.org/dc/terms/accrualPeriodicity, http://purl.org/dc/terms/abstract, http://purl.org/dc/terms/accrualMethod and 50 more. 
As RDF properties are not supported by OSP-core, the aforementioned properties will be ignored.
INFO 2022-03-24 17:52:26,792 [osp.core.ontology.namespace_registry]: Loading namespaces dcat2, http://www.w3.org/ns/dcat#.
INFO 2022-03-24 17:52:26,792 [osp.core.ontology.parser.owl.parser]: Downloading https://www.w3.org/ns/dcat2.rdf.
INFO 2022-03-24 17:52:28,170 [osp.core.ontology.installation]: Installation successful
$ pico uninstall dcmitype
ERROR 2022-03-24 17:53:03,996 [osp.core.pico]: An Exception occurred during installation.
Traceback (most recent call last):
  File "/home/jose/.local/lib/python3.10/site-packages/osp/core/pico.py", line 114, in terminal
    uninstall(*args.packages)
  File "/home/jose/.local/lib/python3.10/site-packages/osp/core/pico.py", line 42, in uninstall
    ontology_installer.uninstall(*package_names)
  File "/home/jose/.local/lib/python3.10/site-packages/osp/core/ontology/installation.py", line 71, in uninstall
    self._install(files_or_namespaces, self._get_remaining_packages, True)
  File "/home/jose/.local/lib/python3.10/site-packages/osp/core/ontology/installation.py", line 278, in _install
    files = self._sort_for_installation(filter_func(files),
  File "/home/jose/.local/lib/python3.10/site-packages/osp/core/ontology/installation.py", line 176, in _get_remaining_packages
    raise RuntimeError(message)
RuntimeError: Cannot remove package dcmitype, because other installed packages depend on it: package dcat2 depends on dcterms; package dcterms depends on dcmitype. Please remove the packages dcterms, dcat2 and dcmitype all together.
ERROR 2022-03-24 17:53:03,997 [osp.core.pico]: Consider running 'pico --log-level debug uninstall ...'
$ pico uninstall prov
ERROR 2022-03-24 17:53:32,505 [osp.core.pico]: An Exception occurred during installation.
Traceback (most recent call last):
  File "/home/jose/.local/lib/python3.10/site-packages/osp/core/pico.py", line 114, in terminal
    uninstall(*args.packages)
  File "/home/jose/.local/lib/python3.10/site-packages/osp/core/pico.py", line 42, in uninstall
    ontology_installer.uninstall(*package_names)
  File "/home/jose/.local/lib/python3.10/site-packages/osp/core/ontology/installation.py", line 71, in uninstall
    self._install(files_or_namespaces, self._get_remaining_packages, True)
  File "/home/jose/.local/lib/python3.10/site-packages/osp/core/ontology/installation.py", line 278, in _install
    files = self._sort_for_installation(filter_func(files),
  File "/home/jose/.local/lib/python3.10/site-packages/osp/core/ontology/installation.py", line 176, in _get_remaining_packages
    raise RuntimeError(message)
RuntimeError: Cannot remove package prov, because other installed packages depend on it: dcat2. Please remove the packages prov and dcat2 all together.
ERROR 2022-03-24 17:53:32,505 [osp.core.pico]: Consider running 'pico --log-level debug uninstall ...'
$ pico uninstall foaf
ERROR 2022-03-24 17:54:20,238 [osp.core.pico]: An Exception occurred during installation.
Traceback (most recent call last):
  File "/home/jose/.local/lib/python3.10/site-packages/osp/core/pico.py", line 114, in terminal
    uninstall(*args.packages)
  File "/home/jose/.local/lib/python3.10/site-packages/osp/core/pico.py", line 42, in uninstall
    ontology_installer.uninstall(*package_names)
  File "/home/jose/.local/lib/python3.10/site-packages/osp/core/ontology/installation.py", line 71, in uninstall
    self._install(files_or_namespaces, self._get_remaining_packages, True)
  File "/home/jose/.local/lib/python3.10/site-packages/osp/core/ontology/installation.py", line 278, in _install
    files = self._sort_for_installation(filter_func(files),
  File "/home/jose/.local/lib/python3.10/site-packages/osp/core/ontology/installation.py", line 176, in _get_remaining_packages
    raise RuntimeError(message)
RuntimeError: Cannot remove package foaf, because other installed packages depend on it: dcat2. Please remove the packages dcat2 and foaf all together.
ERROR 2022-03-24 17:54:20,238 [osp.core.pico]: Consider running 'pico --log-level debug uninstall ...'
$ pico uninstall foaf prov dcmitype foaf dcat2 dcterms
INFO 2022-03-24 17:55:09,448 [osp.core.ontology.installation]: Will install the following namespaces: []
INFO 2022-03-24 17:55:09,451 [osp.core.ontology.installation]: Uninstallation successful

@yoavnash If this is not enough, I would say to drop the idea of automatic dependency resolution for SimPhoNy v3. It would be much more worthwile to invest the time in a long-term solution for SimPhoNy v4. This is already consuming a lot of time that is not being invested in SimPhoNy v4.

@domgz

domgz commented Mar 25, 2022

Copy link
Copy Markdown
Contributor Author

For reference: the last commit implements additional changes requested on the docs PR.

domgz added a commit to simphony/docs that referenced this pull request Mar 25, 2022
…d dcterms namespaces (#201)

Documentation for [PR #760](simphony/simphony-osp#760) with the same title from the OSP-core repository.
@domgz domgz merged commit db42213 into dev Mar 30, 2022
@domgz domgz deleted the enh/add-dcat-and-datamodel branch March 30, 2022 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📜 ontology 🌱 new feature Solving the issue involves the incorporation of a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make dcat ontology and datamodel-ontology as built-in pico-installable

4 participants