Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check out how to get version of ontology #299

Closed
francescalb opened this issue Nov 23, 2021 · 6 comments · Fixed by #301
Closed

Check out how to get version of ontology #299

francescalb opened this issue Nov 23, 2021 · 6 comments · Fixed by #301
Assignees

Comments

@francescalb
Copy link
Collaborator

Currently get_ontology of emmo-inferred (latest-stable) fails as versionIRI is missing.
Look into how to make better error message and perhaps infer from other tags if versionIRI is missing.

Also ontoversion fails and must be checked.

@francescalb francescalb self-assigned this Nov 24, 2021
@francescalb
Copy link
Collaborator Author

There is already a sufficient error message in ontology.get_version(), which is:
TypeError: No versionIRI in Ontology

Inferring from other tags I think is a bad idea as this will open up for mistakes that are difficult to track later.

The default version in ontoversion should be ttl, and it would be nice to have a better error message here, that suggests including format.

@CasperWA
Copy link
Contributor

Determine whether versionInfo or versionIRI should be the higher source of truth. And at least use both to try and determine the version.

@francescalb francescalb linked a pull request Nov 25, 2021 that will close this issue
11 tasks
@francescalb
Copy link
Collaborator Author

@jesper-friis

I want to add the possibility of getting the version from the versionInfo as well as from the versionIRI. Which one do you think should have precedence?

@jesper-friis
Copy link
Collaborator

Since the semantics of owl:versionInfo is not well defined on https://www.w3.org/TR/owl-ref/#versionInfo-def, I think versionIRI should have precedence.

However, on https://www.w3.org/TR/2004/REC-owl-guide-20040210/#OntologyVersioning they indicate that owl:versionInfo can be used by versioning systems. So good practice is probably to set owl:versionInfo to the version number (without any prepended "v").

@francescalb
Copy link
Collaborator Author

francescalb commented Nov 26, 2021

OK, from the above discussion I propose to do as follows:

if as_iri:
     return VersionIRI of versionIRI else Exception versionIRImissing
else:
    if version_iri:
        return version inferred from version_iri and base_iri
    elif versionInfo:
         return versionINFO
    else:
        raise NoVersionInfoFound....

I guess, then the only reason make this change is to find version from versionInfo if the ontology is malformed and does not have versionIRI (which it should have). Comments?

@francescalb
Copy link
Collaborator Author

@jesper-friis , you were quick on approving the draft, can you please comment on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants