コード例 #1
0
ファイル: grappalog.py プロジェクト: TheYorkWei/raco
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)
コード例 #2
0
ファイル: sp2bench.py プロジェクト: EvgenyKarataev/raco
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)
  
  
コード例 #3
0
ファイル: sp2bench_rdf.py プロジェクト: strategist922/raco
        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)


コード例 #4
0
ファイル: sp2bench.py プロジェクト: strategist922/raco
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)
コード例 #5
0
ファイル: clog.py プロジェクト: TheYorkWei/raco
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)