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

Added sconverting Posix to str in get_ontology #327

Merged
merged 5 commits into from
Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ontopy/ontology.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import uuid
import tempfile
import types
import pathlib
from typing import Union
from collections import defaultdict
from collections.abc import Iterable
Expand Down Expand Up @@ -82,6 +83,12 @@ def get_ontology(self, base_iri="emmo-inferred"):
- "emmo-development": load latest inferred development version
of EMMO
"""
base_iri = (
base_iri.as_uri()
if isinstance(base_iri, pathlib.Path)
else base_iri
)

if base_iri == "emmo":
base_iri = (
"https://raw.githubusercontent.com/emmo-repo/"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_load(repo_dir: "Path") -> None:

# Load a local ontology with catalog
testonto = repo_dir / "tests" / "testonto" / "testonto.ttl"
onto = get_ontology(str(testonto)).load()
onto = get_ontology(testonto).load()
assert onto.TestClass.prefLabel.first() == "TestClass"

# Use catalog file when downloading from web
Expand Down