import test_query import sys if __name__ == "__main__": query = sys.argv[1] print query name = sys.argv[2] print name fname = test_query.testEmit(query, name, test_query.GrappaAlgebra)
import test_query import sys if __name__ == "__main__": queryfile = sys.argv[1] tr = 'sp2bench_1m' with open(queryfile, 'r') as f: query = f.read() % locals() fname = test_query.testEmit(query, queryfile, test_query.CCAlgebra)
A(predicate) :- %(tr)s(person, 'rdf:type', 'foaf:Person'), %(tr)s(person, predicate, object)""" #TODO be sure DISTINT queries['Q10'] = """A(subj, pred) :- %(tr)s(subj, pred, 'person:Paul_Erdoes')""" # Is this right? is there such a string? queries['Q11'] = """A(ee) :- %(tr)s(publication, 'rdfs:seeAlso', ee)""" #TODO order by, limit, offset algebra = CCAlgebra prefix="" import sys if len(sys.argv) > 1: if sys.argv[1] == "grappa" or sys.argv[1] == "g": print "using grappa" algebra = GrappaAlgebra prefix="grappa_" for name in queries: querystr = queries[name] % locals() test_query.testEmit(querystr, prefix+name, algebra) #for name in queriesI: # querystr = queriesI[name] % locals() # test_query.testEmit(querystr, prefix+name, algebra)
import test_query import sys if __name__ == "__main__": query = sys.argv[1] print query name = sys.argv[2] print name fname = test_query.testEmit(query, name, test_query.CCAlgebra)