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

Correctly load base_iri and iri #267

Closed
jesper-friis opened this issue Feb 16, 2024 · 1 comment
Closed

Correctly load base_iri and iri #267

jesper-friis opened this issue Feb 16, 2024 · 1 comment

Comments

@jesper-friis
Copy link
Contributor

Owlready2 doesn't distinguish between iri (the IRI of the ontology) and base_iri (the prefix of all entities in the ontology). When Owlready2 loads an ontology, it assigns base_iri to the ontology IRI, which creates a lot of confusion. That said, Owlready2 does this for good reasons, since it is only iri that is explicitly defined in the triples (as long as the source only contain one ontology), while base_iri has to be inferred from the IRIs of the entities in the ontology.

However, we can do better. When loading a turtle file, the base_iri can be obtained from the @prefix : <...> . line. When loading other formats, we can try to infer the base_iri from the class IRIs. If the IRIs of all classes starts with the same base, that is the base_iri.

@jesper-friis jesper-friis changed the title Correct base_iri and iri in Ontology.load() Correctly load base_iri and iri Feb 16, 2024
@jesper-friis
Copy link
Contributor Author

Moved to EMMOntoPy issue 723

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

No branches or pull requests

1 participant