def evalGroupRule(ec, i, r): res = evalRule(ec, i, r.orderedContent()[0].value) if res == D and r.optional: res = Z elif res == P: res = dispatch(r.action, Graph(), ec) return res
def evalRevArcRule(ec, o, rar): og = evalPredicateFilter(rar.p, triplesForObject(o, ec.graph)) res = evalCardinality(og, rar.min, rar.max) if res == P: res = evalSubjectSpecification(ec, rar.s, og) if res == P: res = dispatch(rar.action, og, ec) return res
def evalArcRule(ec, i, ar): sg = evalPredicateFilter(ar.p, triplesForSubject(i, ec.graph)) res = evalCardinality(sg, ar.min, ar.max) if res == P: res = evalObjectSpecification(ec, ar.o, sg) if res == P: res = dispatch(ar.action, sg, ec) return res