Skip to content

Commit

Permalink
fix(rdf): handle path->uri conversion for data_path
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdoret committed Jan 11, 2024
1 parent 1346174 commit 35b2249
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions modo/rdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,16 @@ def attrs_to_graph(meta: dict, uri_prefix: str) -> rdflib.Graph:
# Check if slot value should be a URI
# we need to ensure it is one
slot_range = get_slot_range(key)
if (
slot_range
and "uri" in slot_range
or slot_range in load_schema().all_classes()
):
if not slot_range:
continue
uri_value = any(
[
"uri" in slot_range,
slot_range in load_schema().all_classes(),
key == "data_path",
]
)
if uri_value:
# multivalued slots have a list of values
if isinstance(value, list):
fixed = []
Expand Down

0 comments on commit 35b2249

Please sign in to comment.