Skip to content

Commit

Permalink
Use xsd:string for publisher name & handle missing URI
Browse files Browse the repository at this point in the history
  • Loading branch information
dalito committed Feb 21, 2024
1 parent 00a7a73 commit 1ead999
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/voc4cat/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def check_uri_vs_config(cls, values):
return values

perm_iri_part = getattr(voc_conf, "permanent_iri_part", "")
iri, *_fragment = values["uri"].split("#", 1)
iri, *_fragment = values.get("uri", "").split("#", 1)
if not iri.startswith(perm_iri_part):
msg = "Invalid IRI %s - It must start with %s"
raise ValueError(msg % (iri, perm_iri_part))
Expand Down Expand Up @@ -133,7 +133,7 @@ def check_used_id(cls, values):
actor = values["provenance"].split(",", 1)[0].split(" ", 1)[0].strip()
else:
actor = ""
iri, *_fragment = str(values["uri"]).split("#", 1)
iri, *_fragment = str(values.get("uri", "")).split("#", 1)
id_pattern = config.ID_PATTERNS.get(values["vocab_name"], None)
if id_pattern is not None:
match = id_pattern.search(iri)
Expand Down Expand Up @@ -224,7 +224,6 @@ def to_graph(self):
# should be name but there is no field in the template 0.43
Literal(
ORGANISATIONS.get(self.publisher, self.publisher),
lang="en",
),
)
)
Expand Down

0 comments on commit 1ead999

Please sign in to comment.