Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def mkminim(grid, baseuri=None):
"""
Generate minim graph from supplied grid
Returns (status,mgr) where mgr is RDF graph containing minim description,
or None.
"""
# Decode the grid
try:
(d,(r,c)) = checklist_template.checklist.match(grid, 0, 0)
except Exception, e:
print "Failed to parse minim table %s"%(e)
return (2,None)
# Create RDF graph and initialize Minim graph creation
mgr = Minim_graph(base=baseuri)
# Add prefixes to graph
for pre in d["prefixes"]:
mgr.prefix(pre, d["prefixes"][pre])
# Add checklists to graph
for cl in d["checklists"]:
mgr.checklist(purpose=cl["purpose"], model=cl["model"], target=cl["target_urit"])
# Add models to graph
for cm in d["models"]:
mgr.model(cm["modelid"],
[ mgr.item(seq=mi["seq"], level=mi["level"], ruleid=mi["reqid"])
for mi in cm["items"]
])
# Add requirement rules to graph
for rq in d["requirements"]:
if "foreach" in rq:
# ForEach ...