#!/usr/bin/python """Eep RDF API: Template Thingy EARL Test""" __author__ = 'Sean B. Palmer' __license__ = 'Copyright (C) 2001 Sean B. Palmer. GNU GPL 2' import eep, query, infer, template def test(): store = eep.parse(""" _:j15842 . _:j15842 "Bob B. Bobbington" . _:j15845 . _:j15845 "2001-05-07" . _:j15845 . _:j15844 _:j15845 . _:j15844 . _:j15848 "WCAG Single A Compliance Test" . _:j15848 . _:j15848 . _:j15848 "All Priority 1 checkpoints => WCAG Single-A compliance" . _:j15848 . _:j15844 _:j15848 . _:j15844 . _:j15842 _:j15844 . _:j15842 . """) q = """ _:Person ?email . _:Person ?name . _:Person _:Assertion . _:Assertion _:TS . _:Assertion ?validity . _:Assertion _:TC . _:TS ?repr . _:TS ?date . _:TC ?label . _:TC ?comment . """.strip() t = """

Assertor: (?name); asserts...

""".strip() r = template.rule(q, t) print template.format(""" EARL Output

EARL Stuff

""".lstrip(), template.filter(r, store), """ """.rstrip()) if __name__=="__main__": test()