#!/usr/bin/python """Eep RDF API: Built-Ins Test Suite""" __author__ = 'Sean B. Palmer' __license__ = 'Copyright (C) 2001 Sean B. Palmer. GNU GPL 2' import eep, query, infer, infertest, bi def test(): testFiles = [ """{ ?x ?y ?z . ?x ?z . } => { ?x <#notEqualTo> ?z . } . <#p> <#q> <#p> .""", """{ ?x ?y ?z . ?x ?p . } => { ?x <#uri> ?p . } . <#p> <#q> <#r> . <#x> <#y> <#z> .""", """{ ?x ?y ?z . ?x ?z . } => { ?x <#notEqualTo> ?z . } . "p" <#q> "r" . <#p> <#q> <#p> . "p" <#q> "p" . "x" _:y "z" .""", """{ ?x <#type> <#Target> . ?x ?z . } => { ?x <#sha512> ?z . } . "blargh" <#type> <#Target> .""", # """{ ?x <#type> <#Target> . # ?x ?z . } => # { ?x <#resolvesTo> ?z . } . # <#type> <#Target> .""", """{ ?x <#y> ?z . ?x ?z . } => { ?x <#startsWith> ?z . } . "blargh" <#y> "bla" . "blargh" <#y> "xyz" .""", """{ ?x <#y> ?z . ?x ?p . ?p ?z . } => { ?x <#uriStartsWith> ?z . } . <#y> "bla" . <#y> "xyz" .""" ] for testFile in testFiles: print testFile tfp = infer.inferParse(testFile) print str(bi.bfilter(tfp[0], tfp[1]))+'\n' if __name__=="__main__": test()