Skip to content

Commit

Permalink
Added missing case and corrected test.
Browse files Browse the repository at this point in the history
  • Loading branch information
crisely09 committed Jul 17, 2023
1 parent 5c1a5a0 commit 17cf028
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion kgforge/specializations/stores/bluebrain_nexus.py
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,10 @@ def rewrite_uri(self, uri: str, context: Context, **kwargs) -> str:
else:
resolved_id = id
return url.replace(id, quote_plus(resolved_id))
uri = "/".join((url_base, quote_plus(url, encoding=encoding)))
if not is_file and "/_/" not in url: # adding _ for empty schema
uri = "/".join((url_base, "_", quote_plus(url, encoding=encoding)))
else:
uri = "/".join((url_base, quote_plus(url, encoding=encoding)))
return uri


Expand Down
2 changes: 1 addition & 1 deletion tests/specializations/stores/test_bluebrain_nexus.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def test_to_resource(nexus_store, registered_building, building_jsonld):
pytest.param(
("http://data.net/myverycoolid123456789"),
(False),
("https://nexus-instance.org/resources/test/kgforge/http%3A%2F%2Fdata.net%2Fmyverycoolid123456789"),
("https://nexus-instance.org/resources/test/kgforge/_/http%3A%2F%2Fdata.net%2Fmyverycoolid123456789"),
id="simple-resource-id",
),
pytest.param(
Expand Down

0 comments on commit 17cf028

Please sign in to comment.