I get ValueError: https://ceur-ws.org/Vol-2931/ICBO_2019_paper_20.pdf : is not a valid URI when trying to set an URI typed value using the generated python code from the linkml yaml file at https://github.com/WolfgangFahl/pyMetaModel/tree/main/examples/ceur-ws. There seems to be only a global strict setting to make this more lenientl.
Why would this URI be considered invalid?
The link https://ceur-ws.org/Vol-2931/ICBO_2019_paper_20.pdf seems to work just fine.
May be my runtime is outdated and i have to require a new version in my projects - the error showed up in 1.4.5 ...?
I upgraded (see below) and regenerated the code and the error persists.
see https://pypi.org/project/linkml-runtime/
pip show linkml-runtime
Name: linkml-runtime
Version: 1.4.10
Summary: Runtime environment for LinkML, the Linked open data modeling language
Home-page: https://github.com/linkml/linkml-runtime
Author: Chris Mungall
Author-email: cjmungall@lbl.gov
License:
Location: /Users/wf/Library/Python/3.10/lib/python/site-packages
Requires: click, curies, deprecated, hbreader, json-flattener, jsonasobj2, jsonschema, prefixcommons, prefixmaps, pyyaml, rdflib, requests
Required-by: linkml, linkml-dataops, pyCEURspt, pyMetaModel
debugging leads to
class URI(URIorCURIE):
""" A relative absolute URI
"""
def __init__(self, v: str) -> None:
if is_strict() and not URI.is_valid(v):
raise ValueError(f"{v}: is not a valid URI")
super().__init__(v)
# this is more inclusive than the W3C specification
#uri_re = re.compile("^[A-Za-z]\\S*$")
uri_re = re.compile("^\\S+$")
@classmethod
def is_valid(cls, v: str) -> bool:
return v is not None and not URIorCURIE.is_curie(v) and cls.uri_re.match(v)