Skip to content

Commit 515b61c

Browse files
committed
fixes
1 parent a62e9b5 commit 515b61c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/sparqlunicorn_ontdoc/doc/docutils.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,15 @@ def resolveUnitValue(graph,obj,tuppredstr,tupobjstr,foundval,foundunit):
189189
for valtup in graph.predicate_objects(obj):
190190
if str(valtup[0]) in DocConfig.unitproperties:
191191
foundunit = str(valtup[1])
192-
elif str(valtup[0]) in DocConfig.valueproperties and isinstance(valtup[1], Literal):
193-
foundval = str(valtup[1])
192+
elif str(valtup[0]) in DocConfig.valueproperties:
193+
if isinstance(valtup[1], Literal):
194+
foundval = str(valtup[1])
195+
elif isinstance(valtup[1], URIRef):
196+
for tup2 in graph.predicate_objects(valtup[1]):
197+
if str(tup2[0]) in DocConfig.unitproperties:
198+
foundunit = str(tup2[1])
199+
elif str(tup2[0]) in DocConfig.valueproperties:
200+
foundval=str(tup2[1])
194201
return [foundval,foundunit]
195202

196203

0 commit comments

Comments
 (0)