Example #1
0
 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")))
Example #2
0
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
Example #3
0
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