| 
6 | 6 | from typing import Union, Optional, Tuple  | 
7 | 7 | from urllib.parse import urlparse  | 
8 | 8 | 
 
  | 
9 |  | -from ShExJSG.ShExJ import IRIREF, PN_PREFIX  | 
10 | 9 | from rdflib import Literal, BNode, URIRef  | 
11 | 10 | from rdflib.namespace import is_ncname  | 
12 | 11 | from rdflib.term import Identifier as rdflib_Identifier  | 
@@ -137,9 +136,13 @@ def __init__(self, v: str) -> None:  | 
137 | 136 |             raise ValueError(f"{v}: is not a valid URI")  | 
138 | 137 |         super().__init__(v)  | 
139 | 138 | 
 
  | 
 | 139 | +    # this is more inclusive than the W3C specification  | 
 | 140 | +    #uri_re = re.compile("^[A-Za-z]\\S*$")  | 
 | 141 | +    uri_re = re.compile("^\\S+$")  | 
 | 142 | + | 
140 | 143 |     @classmethod  | 
141 | 144 |     def is_valid(cls, v: str) -> bool:  | 
142 |  | -        return v is not None and not URIorCURIE.is_curie(v) and isinstance(v, IRIREF)  | 
 | 145 | +        return v is not None and not URIorCURIE.is_curie(v) and cls.uri_re.match(v)  | 
143 | 146 | 
 
  | 
144 | 147 | 
 
  | 
145 | 148 | class Curie(URIorCURIE):  | 
@@ -172,7 +175,8 @@ def ns_ln(cls, v: str) -> Optional[Tuple[str, str]]:  | 
172 | 175 |     @classmethod  | 
173 | 176 |     def is_valid(cls, v: str) -> bool:  | 
174 | 177 |         pnln = cls.ns_ln(v)  | 
175 |  | -        return pnln is not None and (not pnln[0] or isinstance(pnln[0], PN_PREFIX))  | 
 | 178 | +        #return pnln is not None and (not pnln[0] or isinstance(pnln[0], PN_PREFIX))  | 
 | 179 | +        return pnln is not None  | 
176 | 180 | 
 
  | 
177 | 181 |     # This code was extracted from the termorcurie package of the rdfa  | 
178 | 182 |     def as_uri(self, nsm: Namespaces) -> Optional[URIRef]:  | 
 | 
0 commit comments