Skip to content
Snippets Groups Projects
Commit 0db3fef5 authored by Cornelia Michlits's avatar Cornelia Michlits
Browse files

#104 modified validate.py

parent 7eaa3d18
No related branches found
No related tags found
4 merge requests!81New stable release,!43Merge dev to master,!33Draft: merge dev to master,!32Add units-service to dev
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment