def testUserShape(self): graph = Graph() graph.parse(os.path.join('data','t1.ttl'),format='n3') schema = ShEx.CreateFromDocument(open(os.path.join('..', 'ShEx', 'static', 'xml', 'Issue.xml')).read()) self.assertEqual(ShEx.OptValidity.PASS, evalRule(EvalContext(schema, graph), URIRef("User2", "http://base.example/"), ruleFor(schema, "UserShape")))
def evalShape(ec, vr, n): from ShEx.evaluate import evalRule, ruleFor return evalRule(ec, n, ruleFor(ec.schema,vr)) if not isinstance(n, Literal) else F
def evalShape(ec, vr, n): from ShEx.evaluate import evalRule, ruleFor return evalRule(ec, n, ruleFor(ec.schema, vr)) if not isinstance(n, Literal) else F