File tree Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Original file line number Diff line number Diff line change 11ruamel.yaml >= 0.12.4 , <= 0.16.5
2- rdflib == 4.2.2
3- rdflib-jsonld == 0.4.0
2+ rdflib >= 4.2.2 , <= 5.0.0
3+ rdflib-jsonld >= 0.4.0 , < 0.6 .0
44mistune >= 0.8.1 ,< 0.9
55CacheControl == 0.11.7
66lockfile == 0.12.2
Original file line number Diff line number Diff line change @@ -148,7 +148,30 @@ def process_type(
148148 v = v ["_@id" ] if v .get ("_@id" , "@" )[0 ] != "@" else None
149149
150150 if bool (v ):
151- (ns , ln ) = rdflib .namespace .split_uri (str (v ))
151+ try :
152+ (ns , ln ) = rdflib .namespace .split_uri (str (v ))
153+ except ValueError :
154+ # rdflib 5.0.0 compatibility
155+ uri = str (v )
156+ colon_index = str (v ).rfind (":" )
157+
158+ if colon_index < 0 :
159+ raise
160+ split_start = rdflib .namespace .SPLIT_START_CATEGORIES
161+ for j in range (- 1 - colon_index , len (uri )):
162+ if (
163+ rdflib .namespace .category (uri [j ]) in split_start
164+ or uri [j ] == "_"
165+ ):
166+ # _ prevents early split, roundtrip not generate
167+ ns = uri [:j ]
168+ if not ns :
169+ break
170+ ln = uri [j :]
171+ break
172+ if not ns or not ln :
173+ raise
174+
152175 if ns [0 :- 1 ] in namespaces :
153176 propnode = namespaces [ns [0 :- 1 ]][ln ]
154177 else :
Original file line number Diff line number Diff line change 8484 "ruamel.yaml >= 0.12.4, <= 0.16.5" ,
8585 # once the minimum version for ruamel.yaml >= 0.15.99
8686 # then please update the mypy targets in the Makefile
87- "rdflib >= 4.2.2, < 4.3 .0" ,
87+ "rdflib >= 4.2.2, <= 5.0 .0" ,
8888 "rdflib-jsonld >= 0.3.0, < 0.6.0" ,
8989 "mistune >= 0.8.1, < 0.9" ,
9090 "CacheControl >= 0.11.7, < 0.12" ,
You can’t perform that action at this time.
0 commit comments