Skip to content

Commit

Permalink
exclude mail addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
Volodymyr Savchenko authored and Volodymyr Savchenko committed May 23, 2024
1 parent 6bd56cd commit 747f0cc
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions workflowhub_graph/absolutize.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@ def is_all_absolute(G: rdflib.Graph) -> bool:
for item in triple:
if isinstance(item, rdflib.URIRef):
# TODO: is this enough?
netloc = urlparse(item).netloc
parsed = urlparse(item)

# we accept file:// with a netloc, even if netloc is not a FQDN,
# see https://github.com/workflowhub-eu/workflowhub-graph/issues/1#issuecomment-2127351752
if netloc == "":
if parsed.netloc == "" and parsed.scheme != "mailto":
print(
f"found non-absolute path <{item}> {netloc}, {urlparse(item)}"
f"found non-absolute path <{item}> {parsed.netloc}, {urlparse(item)}"
)
return False
else:
print("this path is absolute", item, urlparse(item))
return True


Expand Down

0 comments on commit 747f0cc

Please sign in to comment.