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 01e189e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 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
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<http://example.org/exhaustive_children_example_3> skos:broader <http://example.org/exhaustive_concept_iri> .

<https://linked.data.gov.au/org/cgi-gtwg> a sdo:Organization ;
sdo:name "https://linked.data.gov.au/org/cgi-gtwg"@en ;
sdo:name "https://linked.data.gov.au/org/cgi-gtwg" ;
sdo:url "https://linked.data.gov.au/org/cgi-gtwg"^^xsd:anyURI .

cs: a skos:ConceptScheme ;
Expand Down

0 comments on commit 01e189e

Please sign in to comment.