Beispiel #1
0
sys.path.append("../ringo-engine-python")
import ringo
import snap
import testutils

if __name__ == '__main__':
    if len(sys.argv) < 2:
        print "Usage: " + sys.argv[0] + " <srcfile>"
        sys.exit(1)

    ringo = ringo.Ringo()
    srcfile = sys.argv[1]

    t = testutils.Timer()
    r = testutils.Resource()

    table = ringo.Load(srcfile)
    t.show("load bin")
    r.show("__loadbin__")

    S = map(lambda x: x[0], ringo.GetSchema(table))
    assert (len(S) >= 2)

    G = ringo.ToGraph(ringo.PNGraph, table, S[0], S[1])
    t.show("create graph")
    r.show("__creategraph__")
    #table2 = ringo.GetEdgeTable(G)
    t.show("table from graph")
    r.show("__tablefromgraph__")

    G.GenerateProvenance('provenance_scripts/02.py')
Beispiel #2
0
sys.path.append("../utils")
sys.path.append("../ringo-engine-python")
import ringo
import snap
import testutils

if __name__ == '__main__':
    if len(sys.argv) < 3:
        print "Usage: " + sys.argv[0] + " <srcfile1> <srcfile2>"
        sys.exit(1)
    srcfile1 = sys.argv[1]
    srcfile2 = sys.argv[2]
  
    ringo = ringo.Ringo()

    t = testutils.Timer()
    r = testutils.Resource()

    t1 = ringo.Load(srcfile1)
    t.show("load bin")
    r.show("__loadbin__")

    S = [("Index", "int")]
    t2 = ringo.LoadTableTSV(S, srcfile2)
    t.show("load text")
    r.show("__loadtext__")

    t3 = ringo.Join(t1, t2, "Src", "Index")
    t.show("join")
    r.show("__join__")