From 0db3fef56308284b1cf82edf18b0313b96cd027a Mon Sep 17 00:00:00 2001
From: Cornelia Michlits <cornelia.michlits@tuwien.ac.at>
Date: Fri, 3 Dec 2021 13:19:01 +0100
Subject: [PATCH] #104 modified validate.py

---
 fda-units-service/validate.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fda-units-service/validate.py b/fda-units-service/validate.py
index 8ed6cabe85..e74641dc08 100644
--- a/fda-units-service/validate.py
+++ b/fda-units-service/validate.py
@@ -16,7 +16,7 @@ def validator(value):
     #input str
     tmp = str(om)+value
     t_uri = rdflib.term.URIRef(tmp)
-    if next(g.triples((t_uri,None,None)), _exhausted) is _exhausted:
-        return 'invalid unit'
+    if next(g.triples((t_uri,None,om.Unit)), _exhausted) is _exhausted and next(g.triples((t_uri,None,om.PrefixedUnit)),_exhausted) is _exhausted and next(g.triples((t_uri,None,om.UnitDivision)),_exhausted) is _exhausted:
+        return 'invalid'
     else:
-        return 'valid unit'
\ No newline at end of file
+        return 'valid'
\ No newline at end of file
-- 
GitLab