diff --git a/.github/workflows/ci-dgraph-ldbc-tests.yml b/.github/workflows/ci-dgraph-ldbc-tests.yml new file mode 100644 index 00000000000..5437758b367 --- /dev/null +++ b/.github/workflows/ci-dgraph-ldbc-tests.yml @@ -0,0 +1,67 @@ +name: ci-dgraph-ldbc-tests +on: + push: + branches: + - main + pull_request: + types: + - opened + - reopened + - synchronize + - ready_for_review + branches: + - main + schedule: + - cron: "30 * * * *" +jobs: + dgraph-ldbc-tests: + runs-on: ubuntu-latest + steps: + - name: Checkout Dgraph + uses: actions/checkout@v3 + - name: Get Go Version + run: | + #!/bin/bash + GOVERSION=$({ [ -f .go-version ] && cat .go-version; }) + echo "GOVERSION=$GOVERSION" >> $GITHUB_ENV + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: ${{ env.GOVERSION }} + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version: 16 + - name: Install protobuf-compiler + run: sudo apt-get install -y protobuf-compiler + - name: Check protobuf + run: | + cd ./protos + go mod tidy + make regenerate + git diff --exit-code -- . + - name: Make Linux Build and Docker Image + run: make docker-image + - name: Build Test Binary + run : | + #!/bin/bash + # build the test binary + cd t; go build . + - name: Clean Up Environment + run: | + #!/bin/bash + # clean cache + go clean -testcache + # clean up docker containers before test execution + cd t; ./t -r + - name: Run LDBC Tests + run: | + #!/bin/bash + # go env settings + export GOPATH=~/go + # move the binary + cp dgraph/dgraph ~/go/bin/dgraph + # run the ldbc tests + cd t; ./t --suite=ldbc + # clean up docker containers after test execution + ./t -r diff --git a/systest/ldbc/alpha.yml b/systest/ldbc/alpha.yml new file mode 100644 index 00000000000..75cab43c27b --- /dev/null +++ b/systest/ldbc/alpha.yml @@ -0,0 +1,22 @@ +version: "3.5" +services: + alpha1: + image: dgraph/dgraph:local + working_dir: /data/alpha1 + labels: + cluster: test + ports: + - "8080" + - "9080" + volumes: + - type: bind + source: $GOPATH/bin + target: /gobin + read_only: true + - type: bind + source: ./out/0/p + target: /posting + read_only: false + command: /gobin/dgraph alpha --my=alpha1:7080 --zero=zero1:5080 -p=/posting --logtostderr + -v=2 + --security "whitelist=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16;" diff --git a/systest/ldbc/docker-compose.yml b/systest/ldbc/docker-compose.yml new file mode 100644 index 00000000000..77423174ef7 --- /dev/null +++ b/systest/ldbc/docker-compose.yml @@ -0,0 +1,23 @@ +version: "3.5" +services: + zero1: + image: dgraph/dgraph:local + working_dir: /data/zero1 + labels: + cluster: test + ports: + - "5080" + - "6080" + volumes: + - type: bind + source: $GOPATH/bin + target: /gobin + read_only: true + - type: volume + source: data + target: /data + read_only: false + command: /gobin/dgraph zero --raft="idx=1" --my=zero1:5080 --logtostderr + -v=2 --bindall +volumes: + data: {} diff --git a/systest/ldbc/ldbc_test.go b/systest/ldbc/ldbc_test.go new file mode 100644 index 00000000000..20e5c676ae4 --- /dev/null +++ b/systest/ldbc/ldbc_test.go @@ -0,0 +1,96 @@ +package main + +import ( + "context" + "fmt" + "io/ioutil" + "os" + "path/filepath" + "testing" + "time" + + "github.com/dgraph-io/dgraph/testutil" + "github.com/stretchr/testify/require" + "gopkg.in/yaml.v2" +) + +type TestCases struct { + Tag string `yaml:"tag"` + Query string `yaml:"query"` + Resp string `yaml:"resp"` +} + +func TestQueries(t *testing.T) { + dg, err := testutil.DgraphClient(testutil.ContainerAddr("alpha1", 9080)) + if err != nil { + t.Fatalf("Error while getting a dgraph client: %v", err) + } + + yfile, _ := ioutil.ReadFile("test_cases.yaml") + + tc := make(map[string]TestCases) + + err = yaml.Unmarshal(yfile, &tc) + + if err != nil { + t.Fatalf("Error while greading test cases yaml: %v", err) + } + + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute) + for _, tt := range tc { + desc := tt.Tag + // TODO(anurag): IC06 and IC10 have non-deterministic results because of dataset. + // Find a way to modify the queries to include them in the tests + if desc == "IC06" || desc == "IC10" { + continue + } + t.Run(desc, func(t *testing.T) { + resp, err := dg.NewTxn().Query(ctx, tt.Query) + require.NoError(t, err) + testutil.CompareJSON(t, tt.Resp, string(resp.Json)) + }) + if ctx.Err() == context.DeadlineExceeded { + t.Fatal("aborting test due to query timeout") + } + } + cancel() +} + +func TestMain(m *testing.M) { + noschemaFile := filepath.Join(testutil.TestDataDirectory, "ldbcTypes.schema") + rdfFile := testutil.TestDataDirectory + if err := testutil.MakeDirEmpty([]string{"out/0"}); err != nil { + os.Exit(1) + } + + start := time.Now() + fmt.Println("Bulkupload started") + if err := testutil.BulkLoad(testutil.BulkOpts{ + Zero: testutil.SockAddrZero, + Shards: 1, + RdfFile: rdfFile, + SchemaFile: noschemaFile, + }); err != nil { + fmt.Println(err) + cleanupAndExit(1) + } + + fmt.Printf("Took %s to bulkupload LDBC dataset\n", time.Since(start)) + + if err := testutil.StartAlphas("./alpha.yml"); err != nil { + fmt.Printf("Error while bringin up alphas. Error: %v\n", err) + cleanupAndExit(1) + } + + exitCode := m.Run() + cleanupAndExit(exitCode) +} + +func cleanupAndExit(exitCode int) { + if testutil.StopAlphasAndDetectRace("./alpha.yml") { + // if there is race fail the test + exitCode = 1 + } + _ = os.RemoveAll("out") + os.Exit(exitCode) +} diff --git a/systest/ldbc/test_cases.yaml b/systest/ldbc/test_cases.yaml new file mode 100644 index 00000000000..6fffb2519fe --- /dev/null +++ b/systest/ldbc/test_cases.yaml @@ -0,0 +1,3092 @@ +q1: + query: + '{q(func: eq(fqid, "person_4398046514948")) { + firstName + lastName + birthday + locationIP + browserUsed + gender + creationDate + isLocatedIn{ + id + name + } + }}' + tag: "IS01" + resp: '{ + "q":[ + { + "firstName":"Abhishek", + "lastName":"Roy", + "birthday":"1985-09-06T00:00:00Z", + "locationIP":"27.54.166.12", + "browserUsed":"Internet Explorer", + "gender":"male", + "creationDate":"2010-06-06T23:43:29.643Z", + "isLocatedIn":[ + { + "id":231, + "name":"Thanjavur" + } + ] + } + ] + }' +q2: + query: '{ + q(func: eq(fqid, "person_933")) { + ~hasCreator( orderdesc: creationDate, orderdesc: id, first:10){ + id + content + creationDate + dgraph.type + replyOf{ + id + hasCreator{ + id + firstName + lastName + } + } + } + } + }' + tag: 'IS02' + resp: '{ + "q": [ + { + "~hasCreator": [ + { + "id": 1099511778677, + "content": "I see", + "creationDate": "2012-09-12T18:07:52.711Z", + "dgraph.type": [ + "comment" + ], + "replyOf": { + "id": 1099511778673, + "hasCreator": [ + { + "id": 19791209303315, + "firstName": "Chutima", + "lastName": "Wattansin" + } + ] + } + }, + { + "id": 1099511797152, + "content": "About East Germany, state''s commitment to communism was a holloAbout Almohad Caliphat", + "creationDate": "2012-09-10T12:39:32.701Z", + "dgraph.type": [ + "comment" + ], + "replyOf": { + "id": 1099511797149, + "hasCreator": [ + { + "id": 26388279068783, + "firstName": "Farhad", + "lastName": "Qaderi" + } + ] + } + }, + { + "id": 1099511627888, + "content": "", + "creationDate": "2012-09-09T20:23:20.268Z", + "dgraph.type": [ + "post" + ] + }, + { + "id": 1099511627887, + "content": "", + "creationDate": "2012-09-09T20:23:19.268Z", + "dgraph.type": [ + "post" + ] + }, + { + "id": 1099511627886, + "content": "", + "creationDate": "2012-09-09T20:23:18.268Z", + "dgraph.type": [ + "post" + ] + }, + { + "id": 1099511627885, + "content": "", + "creationDate": "2012-09-09T20:23:17.268Z", + "dgraph.type": [ + "post" + ] + }, + { + "id": 1099511627884, + "content": "", + "creationDate": "2012-09-09T20:23:16.268Z", + "dgraph.type": [ + "post" + ] + }, + { + "id": 1099511627883, + "content": "", + "creationDate": "2012-09-09T20:23:15.268Z", + "dgraph.type": [ + "post" + ] + }, + { + "id": 1099511627882, + "content": "", + "creationDate": "2012-09-09T20:23:14.268Z", + "dgraph.type": [ + "post" + ] + }, + { + "id": 1099511627881, + "content": "", + "creationDate": "2012-09-09T20:23:13.268Z", + "dgraph.type": [ + "post" + ] + } + ] + } + ] + }' +q3: + tag: "IS03" + query: '{ + q(func: eq(fqid, "person_933")) { + knows @facets( orderdesc: creationDate, orderdesc: id){ + id + firstName + lastName + } + } + }' + resp: ' + { + "q": [ + { + "knows": [ + { + "id": 24189255814068, + "firstName": "Karl", + "lastName": "Wagner", + "knows|creationDate": "2011-11-16T09:47:46.750+00:00" + }, + { + "id": 15393162790400, + "firstName": "Jose", + "lastName": "Costa", + "knows|creationDate": "2011-04-02T21:17:40.919+00:00" + }, + { + "id": 2199023256437, + "firstName": "Rudolf", + "lastName": "Engel", + "knows|creationDate": "2010-04-08T04:18:41.298+00:00" + } + ] + } + ] + }' +q4: + tag: 'IS04' + query: '{ + q(func: eq(fqid, "post_3")) { + creationDate + content + imageFile + } + }' + resp: '{ + "q": [ + { + "creationDate": "2010-02-14T20:30:21.451Z", + "content": "About Rupert Murdoch, alised US citizen iAbout Napoleon, tinuation of the waAbout Ferdinand II of Aragon, (1", + "imageFile": "" + } + ] + }' +q5: + tag: 'IS05' + query: '{ + q(func: eq(fqid, "post_3")) { + hasCreator{ + id + firstName + lastName + } + } + }' + resp: ' + { + "q": [ + { + "hasCreator": [ + { + "id": 933, + "firstName": "Mahinda", + "lastName": "Perera" + } + ] + } + ] + }' +q6: + tag: 'IS06' + query: '{ + q(func: eq(fqid, "post_3")) { + ~containerOf{ + id + title + hasModerator{ + id + firstName + lastName + } + } + } + }' + resp: ' + { + "q": [ + { + "~containerOf": [ + { + "id": 0, + "title": "Wall of Mahinda Perera", + "hasModerator": [ + { + "id": 933, + "firstName": "Mahinda", + "lastName": "Perera" + } + ] + } + ] + } + ] + }' +q7: + tag: 'IS07' + query: '{ + mid as var(func: eq(fqid, "post_549755864897")){ + c as hasCreator + } + q(func: uid(mid)) { + ~replyOf (orderdesc: creationDate){ + id + content + creationDate + hasCreator{ + id + firstName + lastName + knows @filter(uid(c)){ + id + firstName + lastName + } + } + } + } + }' + resp: ' + { + "q": [ + { + "~replyOf": [ + { + "id": 549755864902, + "content": "About Jan Hus, ech priest, philoAbout Islands in the Stream, Bend, Indiana raAbout ", + "creationDate": "2011-06-23T06:36:48.528Z", + "hasCreator": [ + { + "id": 10995116279491, + "firstName": "Ouwo Moussa", + "lastName": "Maazou", + "knows": [ + { + "id": 13194139535450, + "firstName": "Christopher", + "lastName": "Jones" + } + ] + } + ] + }, + { + "id": 549755864909, + "content": "maybe", + "creationDate": "2011-06-22T15:56:44.755Z", + "hasCreator": [ + { + "id": 6597069767708, + "firstName": "Abdou", + "lastName": "Dia", + "knows": [ + { + "id": 13194139535450, + "firstName": "Christopher", + "lastName": "Jones" + } + ] + } + ] + }, + { + "id": 549755864900, + "content": "yes", + "creationDate": "2011-06-22T13:34:41.791Z", + "hasCreator": [ + { + "id": 2199023256077, + "firstName": "Ibrahim Bare", + "lastName": "Ousmane", + "knows": [ + { + "id": 13194139535450, + "firstName": "Christopher", + "lastName": "Jones" + } + ] + } + ] + }, + { + "id": 549755864904, + "content": "About Jan Hus, . Their defenAbout Bob Dylan, er Bob Dylan,About Michael Jordan, majority ", + "creationDate": "2011-06-22T10:03:28.337Z", + "hasCreator": [ + { + "id": 10995116279491, + "firstName": "Ouwo Moussa", + "lastName": "Maazou", + "knows": [ + { + "id": 13194139535450, + "firstName": "Christopher", + "lastName": "Jones" + } + ] + } + ] + }, + { + "id": 549755864899, + "content": "ok", + "creationDate": "2011-06-22T09:50:14.117Z", + "hasCreator": [ + { + "id": 10995116279491, + "firstName": "Ouwo Moussa", + "lastName": "Maazou", + "knows": [ + { + "id": 13194139535450, + "firstName": "Christopher", + "lastName": "Jones" + } + ] + } + ] + }, + { + "id": 549755864898, + "content": "yes", + "creationDate": "2011-06-22T09:34:53.014Z", + "hasCreator": [ + { + "id": 6597069767708, + "firstName": "Abdou", + "lastName": "Dia", + "knows": [ + { + "id": 13194139535450, + "firstName": "Christopher", + "lastName": "Jones" + } + ] + } + ] + }, + { + "id": 549755864901, + "content": "maybe", + "creationDate": "2011-06-22T07:06:07.735Z", + "hasCreator": [ + { + "id": 15393162789569, + "firstName": "Bechir", + "lastName": "Cardinale" + } + ] + } + ] + } + ] + }' +q8: + tag: "IC01" + query: '{ + pid as var(func: type(person)) @filter(eq(id, "4398046514948" )) + nid as var(func: eq(firstName, "Deepak")) + + var(func: uid(pid)) { + f11 as knows{ + dist11 as math(1) + f21 as knows @filter(NOT uid(pid)){ + dist21 as math(2) + f31 as knows @filter(NOT uid(pid)){ + dist31 as math(3) + } + f32 as ~knows @filter(NOT uid(pid)){ + dist32 as math(3) + } + } + f22 as ~knows @filter(NOT uid(pid)){ + dist22 as math(2) + f33 as knows @filter(NOT uid(pid)){ + dist33 as math(3) + } + f34 as ~knows @filter(NOT uid(pid)){ + dist34 as math(3) + } + } + } + f12 as ~knows{ + dist12 as math(1) + f23 as knows @filter(NOT uid(pid)){ + dist23 as math(2) + f35 as knows @filter(NOT uid(pid)){ + dist35 as math(3) + } + f36 as ~knows @filter(NOT uid(pid)){ + dist36 as math(3) + } + } + f24 as ~knows @filter(NOT uid(pid)){ + dist24 as math(2) + f37 as knows @filter(NOT uid(pid)){ + dist37 as math(3) + } + f38 as ~knows @filter(NOT uid(pid)){ + dist38 as math(3) + } + } + } + } + + ppl as var(func: uid(f11, f12, f21, f22, f23, f24, f31, f32, f33, f34, f35, f36, f37, f38)) @filter(uid(nid)) + + q(func: uid(ppl), orderasc: lastName, orderasc: id, first: 20) { + distance11: val(dist11) + distance12: val(dist12) + distance21: val(dist21) + distance22: val(dist22) + distance23: val(dist23) + distance24: val(dist24) + distance31: val(dist31) + distance32: val(dist32) + distance33: val(dist33) + distance34: val(dist34) + distance35: val(dist35) + distance36: val(dist36) + distance37: val(dist37) + distance38: val(dist38) + id + lastName + birthday + gender + browserUsed + locationIP + email + language + creationDate + isLocatedIn{ + name + } + studyAt{ + name + isLocatedIn{ + name + } + } + } + }' + resp: ' + { + "q": [ + { + "distance31": 3, + "distance32": 3, + "distance33": 3, + "distance35": 3, + "id": 30786325580679, + "lastName": "Adhia", + "birthday": "1980-11-04T00:00:00Z", + "gender": "male", + "browserUsed": "Internet Explorer", + "locationIP": "41.222.181.85", + "email": [ + "Deepak30786325580679@gmx.com", + "Deepak30786325580679@yahoo.com", + "Deepak30786325580679@gmail.com" + ], + "language": [ + "en", + "ar" + ], + "creationDate": "2012-06-09T16:36:11.499Z", + "isLocatedIn": [ + { + "name": "Dodoma" + } + ], + "studyAt": [ + { + "name": "Aga_Khan_University", + "isLocatedIn": [ + { + "name": "Karachi" + } + ] + } + ] + }, + { + "distance22": 2, + "distance23": 2, + "distance32": 3, + "distance33": 3, + "distance34": 3, + "distance36": 3, + "distance37": 3, + "distance38": 3, + "id": 2874, + "lastName": "Bose", + "birthday": "1986-02-01T00:00:00Z", + "gender": "male", + "browserUsed": "Firefox", + "locationIP": "61.11.14.149", + "email": [ + "Deepak2874@yahoo.com", + "Deepak2874@gmail.com" + ], + "language": [ + "en", + "hi", + "gu" + ], + "creationDate": "2010-02-24T21:54:09.1Z", + "isLocatedIn": [ + { + "name": "Ghaziabad" + } + ], + "studyAt": [ + { + "name": "Christ_University", + "isLocatedIn": [ + { + "name": "Bangalore" + } + ] + } + ] + }, + { + "distance11": 1, + "distance21": 2, + "distance22": 2, + "distance31": 3, + "distance32": 3, + "distance33": 3, + "distance34": 3, + "distance35": 3, + "distance36": 3, + "distance37": 3, + "id": 24189255812226, + "lastName": "Bose", + "birthday": "1985-08-11T00:00:00Z", + "gender": "male", + "browserUsed": "Internet Explorer", + "locationIP": "27.116.34.188", + "email": [ + "Deepak24189255812226@gmail.com", + "Deepak24189255812226@speedymail.net", + "Deepak24189255812226@gmx.com" + ], + "language": [ + "en", + "mr", + "bn" + ], + "creationDate": "2011-12-07T08:11:20.015Z", + "isLocatedIn": [ + { + "name": "Patna" + } + ] + }, + { + "distance22": 2, + "distance32": 3, + "distance33": 3, + "distance34": 3, + "distance36": 3, + "distance37": 3, + "id": 2199023257545, + "lastName": "Khan", + "birthday": "1980-10-21T00:00:00Z", + "gender": "male", + "browserUsed": "Chrome", + "locationIP": "49.238.39.235", + "email": [ + "Deepak2199023257545@gmail.com", + "Deepak2199023257545@gmx.com" + ], + "language": [ + "en", + "te", + "ur" + ], + "creationDate": "2010-03-14T17:22:39.914Z", + "isLocatedIn": [ + { + "name": "Guwahati" + } + ], + "studyAt": [ + { + "name": "CMR_Law_School", + "isLocatedIn": [ + { + "name": "Bangalore" + } + ] + } + ] + }, + { + "distance21": 2, + "distance22": 2, + "distance23": 2, + "distance31": 3, + "distance32": 3, + "distance33": 3, + "distance34": 3, + "distance35": 3, + "distance36": 3, + "distance37": 3, + "id": 21990232555586, + "lastName": "Khan", + "birthday": "1980-11-10T00:00:00Z", + "gender": "male", + "browserUsed": "Chrome", + "locationIP": "49.12.225.25", + "email": [ + "Deepak21990232555586@yahoo.com", + "Deepak21990232555586@gmail.com", + "Deepak21990232555586@gmx.com" + ], + "language": [ + "en", + "mr", + "bn" + ], + "creationDate": "2011-09-12T21:30:38.614Z", + "isLocatedIn": [ + { + "name": "Kota" + } + ], + "studyAt": [ + { + "name": "CMR_Law_School", + "isLocatedIn": [ + { + "name": "Bangalore" + } + ] + } + ] + }, + { + "distance21": 2, + "distance22": 2, + "distance31": 3, + "distance32": 3, + "distance33": 3, + "distance34": 3, + "distance35": 3, + "distance36": 3, + "distance37": 3, + "id": 21990232556621, + "lastName": "Khan", + "birthday": "1984-06-12T00:00:00Z", + "gender": "male", + "browserUsed": "Chrome", + "locationIP": "14.140.246.54", + "email": [ + "Deepak21990232556621@gmail.com", + "Deepak21990232556621@hotmail.com" + ], + "language": [ + "en", + "as", + "ta" + ], + "creationDate": "2011-10-16T18:54:45.142Z", + "isLocatedIn": [ + { + "name": "Bandra" + } + ], + "studyAt": [ + { + "name": "CMR_Law_School", + "isLocatedIn": [ + { + "name": "Bangalore" + } + ] + } + ] + }, + { + "distance22": 2, + "distance23": 2, + "distance32": 3, + "distance33": 3, + "distance34": 3, + "distance35": 3, + "distance36": 3, + "distance37": 3, + "id": 4398046513018, + "lastName": "Kumar", + "birthday": "1981-03-02T00:00:00Z", + "gender": "male", + "browserUsed": "Safari", + "locationIP": "101.209.68.58", + "email": [ + "Deepak4398046513018@gmx.com", + "Deepak4398046513018@gmail.com", + "Deepak4398046513018@yahoo.com" + ], + "language": [ + "en", + "hi", + "ur" + ], + "creationDate": "2010-05-19T07:45:57.238Z", + "isLocatedIn": [ + { + "name": "Kollam" + } + ], + "studyAt": [ + { + "name": "Indian_Institute_of_Science", + "isLocatedIn": [ + { + "name": "Bangalore" + } + ] + } + ] + }, + { + "distance22": 2, + "distance23": 2, + "distance32": 3, + "distance33": 3, + "distance34": 3, + "distance35": 3, + "distance36": 3, + "distance37": 3, + "id": 6597069768426, + "lastName": "Kumar", + "birthday": "1980-02-21T00:00:00Z", + "gender": "male", + "browserUsed": "Chrome", + "locationIP": "59.182.74.137", + "email": [ + "Deepak6597069768426@gmail.com", + "Deepak6597069768426@zoho.com", + "Deepak6597069768426@gmx.com" + ], + "language": [ + "en", + "te", + "mr" + ], + "creationDate": "2010-08-20T11:31:57.167Z", + "isLocatedIn": [ + { + "name": "Malappuram" + } + ], + "studyAt": [ + { + "name": "CMR_Law_School", + "isLocatedIn": [ + { + "name": "Bangalore" + } + ] + } + ] + }, + { + "distance21": 2, + "distance22": 2, + "distance31": 3, + "distance32": 3, + "distance33": 3, + "distance34": 3, + "distance35": 3, + "distance36": 3, + "distance37": 3, + "id": 10995116278799, + "lastName": "Kumar", + "birthday": "1982-05-26T00:00:00Z", + "gender": "male", + "browserUsed": "Internet Explorer", + "locationIP": "61.17.75.169", + "email": [ + "Deepak10995116278799@gmail.com", + "Deepak10995116278799@zoho.com", + "Deepak10995116278799@gmx.com", + "Deepak10995116278799@yahoo.com" + ], + "language": [ + "en", + "hi", + "ta" + ], + "creationDate": "2010-12-19T06:01:33.806Z", + "isLocatedIn": [ + { + "name": "Nellore" + } + ], + "studyAt": [ + { + "name": "Rajiv_Gandhi_University_of_Health_Sciences", + "isLocatedIn": [ + { + "name": "Bangalore" + } + ] + } + ] + }, + { + "distance23": 2, + "distance31": 3, + "distance32": 3, + "distance33": 3, + "distance34": 3, + "distance35": 3, + "distance36": 3, + "distance37": 3, + "id": 10995116281487, + "lastName": "Kumar", + "birthday": "1988-06-12T00:00:00Z", + "gender": "male", + "browserUsed": "Firefox", + "locationIP": "14.142.245.184", + "email": [ + "Deepak10995116281487@yahoo.com" + ], + "language": [ + "en", + "ml", + "te" + ], + "creationDate": "2010-11-14T04:37:57.908Z", + "isLocatedIn": [ + { + "name": "English_Bazar" + } + ], + "studyAt": [ + { + "name": "Christ_University", + "isLocatedIn": [ + { + "name": "Bangalore" + } + ] + } + ] + }, + { + "distance21": 2, + "distance22": 2, + "distance23": 2, + "distance31": 3, + "distance32": 3, + "distance33": 3, + "distance34": 3, + "distance35": 3, + "distance36": 3, + "distance37": 3, + "id": 21990232557419, + "lastName": "Kumar", + "birthday": "1983-12-08T00:00:00Z", + "gender": "male", + "browserUsed": "Internet Explorer", + "locationIP": "14.102.188.68", + "email": [ + "Deepak21990232557419@gmail.com", + "Deepak21990232557419@gmx.com" + ], + "language": [ + "en", + "ur", + "or" + ], + "creationDate": "2011-09-12T01:46:02.005Z", + "isLocatedIn": [ + { + "name": "Tezpur" + } + ], + "studyAt": [ + { + "name": "Indian_Institute_of_Science", + "isLocatedIn": [ + { + "name": "Bangalore" + } + ] + } + ] + }, + { + "distance31": 3, + "distance33": 3, + "distance35": 3, + "id": 35184372090643, + "lastName": "Kumar", + "birthday": "1984-01-21T00:00:00Z", + "gender": "male", + "browserUsed": "Firefox", + "locationIP": "42.107.228.203", + "email": [ + "Deepak35184372090643@gmail.com", + "Deepak35184372090643@yahoo.com" + ], + "language": [ + "en", + "hi", + "kn" + ], + "creationDate": "2012-09-11T13:35:19.789Z", + "isLocatedIn": [ + { + "name": "Nashik" + } + ], + "studyAt": [ + { + "name": "Ramakrishna_Mission_Residential_College,_Narendrapur", + "isLocatedIn": [ + { + "name": "Kolkata" + } + ] + } + ] + }, + { + "distance23": 2, + "distance32": 3, + "distance33": 3, + "distance35": 3, + "distance37": 3, + "id": 24189255813921, + "lastName": "Nair", + "birthday": "1983-10-25T00:00:00Z", + "gender": "male", + "browserUsed": "Firefox", + "locationIP": "61.95.236.10", + "email": [ + "Deepak24189255813921@gmx.com", + "Deepak24189255813921@yahoo.com", + "Deepak24189255813921@zoho.com", + "Deepak24189255813921@gmail.com" + ], + "language": [ + "en", + "as" + ], + "creationDate": "2011-12-19T21:55:52.83Z", + "isLocatedIn": [ + { + "name": "Gwalior" + } + ], + "studyAt": [ + { + "name": "National_Institute_of_Business_Management", + "isLocatedIn": [ + { + "name": "Bangalore" + } + ] + } + ] + }, + { + "distance21": 2, + "distance31": 3, + "distance33": 3, + "distance35": 3, + "id": 28587302325292, + "lastName": "Rao", + "birthday": "1981-08-06T00:00:00Z", + "gender": "male", + "browserUsed": "Opera", + "locationIP": "1.7.203.237", + "email": [ + "Deepak28587302325292@maghreb.cc", + "Deepak28587302325292@yahoo.com", + "Deepak28587302325292@hotmail.com", + "Deepak28587302325292@gmail.com" + ], + "language": [ + "en", + "or", + "mr" + ], + "creationDate": "2012-05-06T19:16:53.342Z", + "isLocatedIn": [ + { + "name": "Asansol" + } + ], + "studyAt": [ + { + "name": "G.H.Raisoni_Institute_of_Information_Technology", + "isLocatedIn": [ + { + "name": "Nagpur" + } + ] + } + ] + }, + { + "distance21": 2, + "distance31": 3, + "distance32": 3, + "distance33": 3, + "distance34": 3, + "distance35": 3, + "distance36": 3, + "distance37": 3, + "id": 30786325580290, + "lastName": "Rao", + "birthday": "1981-10-14T00:00:00Z", + "gender": "male", + "browserUsed": "Chrome", + "locationIP": "27.4.211.176", + "email": [ + "Deepak30786325580290@hotmail.com", + "Deepak30786325580290@gmail.com", + "Deepak30786325580290@gmx.com" + ], + "language": [ + "en", + "mr", + "ta" + ], + "creationDate": "2012-05-26T14:49:06.671Z", + "isLocatedIn": [ + { + "name": "Munsirhat" + } + ], + "studyAt": [ + { + "name": "Christ_University", + "isLocatedIn": [ + { + "name": "Bangalore" + } + ] + } + ] + }, + { + "distance22": 2, + "distance23": 2, + "distance24": 2, + "distance32": 3, + "distance33": 3, + "distance34": 3, + "distance35": 3, + "distance36": 3, + "distance37": 3, + "distance38": 3, + "id": 2199023258552, + "lastName": "Reddy", + "birthday": "1983-03-15T00:00:00Z", + "gender": "male", + "browserUsed": "Firefox", + "locationIP": "58.146.102.178", + "email": [ + "Deepak2199023258552@gmail.com" + ], + "language": [ + "en", + "hi", + "mr" + ], + "creationDate": "2010-03-21T05:15:01.12Z", + "isLocatedIn": [ + { + "name": "Cuttack" + } + ], + "studyAt": [ + { + "name": "CMR_Law_School", + "isLocatedIn": [ + { + "name": "Bangalore" + } + ] + } + ] + }, + { + "distance21": 2, + "distance22": 2, + "distance31": 3, + "distance32": 3, + "distance33": 3, + "distance34": 3, + "distance35": 3, + "distance36": 3, + "distance37": 3, + "id": 21990232555934, + "lastName": "Reddy", + "birthday": "1986-07-21T00:00:00Z", + "gender": "male", + "browserUsed": "Chrome", + "locationIP": "27.116.22.98", + "email": [ + "Deepak21990232555934@gmail.com", + "Deepak21990232555934@gmx.com", + "Deepak21990232555934@zoho.com" + ], + "language": [ + "en", + "te", + "bn" + ], + "creationDate": "2011-10-17T00:58:35.708Z", + "isLocatedIn": [ + { + "name": "Barrackpore" + } + ], + "studyAt": [ + { + "name": "Rajiv_Gandhi_University_of_Health_Sciences", + "isLocatedIn": [ + { + "name": "Bangalore" + } + ] + } + ] + }, + { + "distance21": 2, + "distance22": 2, + "distance23": 2, + "distance31": 3, + "distance32": 3, + "distance33": 3, + "distance34": 3, + "distance35": 3, + "distance36": 3, + "distance37": 3, + "id": 28587302325768, + "lastName": "Roy", + "birthday": "1980-03-03T00:00:00Z", + "gender": "male", + "browserUsed": "Internet Explorer", + "locationIP": "27.34.252.85", + "email": [ + "Deepak28587302325768@hotmail.com", + "Deepak28587302325768@gmail.com", + "Deepak28587302325768@gmx.com" + ], + "language": [ + "en", + "ml", + "ur" + ], + "creationDate": "2012-03-26T15:22:34.731Z", + "isLocatedIn": [ + { + "name": "Kashipur" + } + ], + "studyAt": [ + { + "name": "The_Oxford_Educational_Institutions", + "isLocatedIn": [ + { + "name": "Bangalore" + } + ] + } + ] + }, + { + "distance22": 2, + "distance32": 3, + "distance33": 3, + "distance34": 3, + "distance36": 3, + "distance37": 3, + "id": 8796093022970, + "lastName": "Sharma", + "birthday": "1986-04-27T00:00:00Z", + "gender": "male", + "browserUsed": "Firefox", + "locationIP": "103.1.198.132", + "email": [ + "Deepak8796093022970@gmx.com", + "Deepak8796093022970@gmail.com" + ], + "language": [ + "en", + "ml", + "bn" + ], + "creationDate": "2010-10-16T11:32:10.76Z", + "isLocatedIn": [ + { + "name": "Brahmavar" + } + ], + "studyAt": [ + { + "name": "International_Management_Institute", + "isLocatedIn": [ + { + "name": "New_Delhi" + } + ] + } + ] + }, + { + "distance31": 3, + "distance32": 3, + "distance33": 3, + "distance34": 3, + "distance35": 3, + "distance36": 3, + "id": 15393162791080, + "lastName": "Sharma", + "birthday": "1987-10-08T00:00:00Z", + "gender": "male", + "browserUsed": "Internet Explorer", + "locationIP": "27.50.4.151", + "email": [ + "Deepak15393162791080@yahoo.com", + "Deepak15393162791080@hotmail.com", + "Deepak15393162791080@gmail.com" + ], + "language": [ + "en", + "te", + "ta" + ], + "creationDate": "2011-04-23T03:00:28.216Z", + "isLocatedIn": [ + { + "name": "Srinagar" + } + ], + "studyAt": [ + { + "name": "Ecumenical_Christian_Centre", + "isLocatedIn": [ + { + "name": "Bangalore" + } + ] + } + ] + } + ] + }' +q9: + tag: "IC02" + query: '{ + var(func: type(person))@filter(eq(id, "4398046514948")){ + knows{ + msgs1 as ~hasCreator @filter(le(creationDate, "2011-06-10T14:02:42.274+00:00")) + } + ~knows{ + msgs2 as ~hasCreator @filter(le(creationDate, "2011-06-10T14:02:42.274+00:00")) + } + } + q(func: uid(msgs1,msgs2), orderdesc: creationDate, orderasc: fqid, first:20){ + id + content + creationDate + hasCreator{ + id + firstName + lastName + } + } + }' + resp: ' + { + "q": [ + { + "id": 549756454080, + "content": "duh", + "creationDate": "2011-06-10T11:27:35.591Z", + "hasCreator": [ + { + "id": 13194139533535, + "firstName": "Shweta", + "lastName": "Singh" + } + ] + }, + { + "id": 549755858245, + "content": "About Ethiopian Empire, hiopian Empire also known as Abyssinia, covered a geo", + "creationDate": "2011-06-10T11:23:15.209Z", + "hasCreator": [ + { + "id": 15393162790400, + "firstName": "Jose", + "lastName": "Costa" + } + ] + }, + { + "id": 549756436318, + "content": "About Sigmund Freud, use of free association (in which patients report theirAbout 20 Y.O., d States. The album", + "creationDate": "2011-06-10T09:10:15.474Z", + "hasCreator": [ + { + "id": 2194, + "firstName": "Alexander", + "lastName": "Dobrunov" + } + ] + }, + { + "id": 549756765765, + "content": "maybe", + "creationDate": "2011-06-10T08:46:12.266Z", + "hasCreator": [ + { + "id": 2199023256816, + "firstName": "K.", + "lastName": "Bose" + } + ] + }, + { + "id": 549756523284, + "content": "About T-Pain, he founder of the record label Nappy Boy Entertainment, establ", + "creationDate": "2011-06-10T04:54:12.086Z", + "hasCreator": [ + { + "id": 4398046511667, + "firstName": "John", + "lastName": "Chopra" + } + ] + }, + { + "id": 549756523283, + "content": "About Clint Eastwood, Line of Fire (1993), The Bridges of Madison County (1995),", + "creationDate": "2011-06-10T04:42:04.366Z", + "hasCreator": [ + { + "id": 10995116279521, + "firstName": "Rahul", + "lastName": "Nair" + } + ] + }, + { + "id": 549755858244, + "content": "no", + "creationDate": "2011-06-10T03:32:04.194Z", + "hasCreator": [ + { + "id": 2194, + "firstName": "Alexander", + "lastName": "Dobrunov" + } + ] + }, + { + "id": 549756454075, + "content": "right", + "creationDate": "2011-06-10T02:57:50.697Z", + "hasCreator": [ + { + "id": 8796093024661, + "firstName": "Rahul", + "lastName": "Sharma" + } + ] + }, + { + "id": 549756013206, + "content": "thanks", + "creationDate": "2011-06-09T21:48:49.051Z", + "hasCreator": [ + { + "id": 10995116279390, + "firstName": "Arjun", + "lastName": "Rao" + } + ] + }, + { + "id": 549756346967, + "content": "good", + "creationDate": "2011-06-09T20:35:39.693Z", + "hasCreator": [ + { + "id": 15393162790400, + "firstName": "Jose", + "lastName": "Costa" + } + ] + }, + { + "id": 549756523280, + "content": "About Hamid Karzai, hanistan. After the 2004 presidential electAbout Indonesia, ian h", + "creationDate": "2011-06-09T19:08:21.924Z", + "hasCreator": [ + { + "id": 10995116279521, + "firstName": "Rahul", + "lastName": "Nair" + } + ] + }, + { + "id": 549756454087, + "content": "right", + "creationDate": "2011-06-09T18:36:50.237Z", + "hasCreator": [ + { + "id": 8796093024661, + "firstName": "Rahul", + "lastName": "Sharma" + } + ] + }, + { + "id": 549756454083, + "content": "LOL", + "creationDate": "2011-06-09T18:23:06.521Z", + "hasCreator": [ + { + "id": 4398046514661, + "firstName": "Rajiv", + "lastName": "Singh" + } + ] + }, + { + "id": 549756299858, + "content": "About Hamid Karzai, term as Interim President during the 2About Carl Jung, ", + "creationDate": "2011-06-09T16:36:12.012Z", + "hasCreator": [ + { + "id": 8796093025552, + "firstName": "Arjun", + "lastName": "Nair" + } + ] + }, + { + "id": 549756434913, + "content": "About Sigmund Freud, al psychotherapy by creatingAbout Kelly Clarkson, f the 2000s, as well as alsoAbout D. W. ", + "creationDate": "2011-06-09T14:16:18.699Z", + "hasCreator": [ + { + "id": 2194, + "firstName": "Alexander", + "lastName": "Dobrunov" + } + ] + }, + { + "id": 549756828490, + "content": "About Lebanon, ast. At the end of the war, tAbout She Hates Me, tes Me made it become", + "creationDate": "2011-06-09T14:11:35.666Z", + "hasCreator": [ + { + "id": 13194139537010, + "firstName": "Rahul", + "lastName": "Rao" + } + ] + }, + { + "id": 549755820093, + "content": "yes", + "creationDate": "2011-06-09T10:21:36.487Z", + "hasCreator": [ + { + "id": 10995116279390, + "firstName": "Arjun", + "lastName": "Rao" + } + ] + }, + { + "id": 549755820095, + "content": "About Pope Benedict XVI, ''s closest confidants. Like his predecessAbout Stephen King, lette nominee, and in 2003, the National About Sean Combs, g names). In Au", + "creationDate": "2011-06-09T05:53:54.12Z", + "hasCreator": [ + { + "id": 10995116279390, + "firstName": "Arjun", + "lastName": "Rao" + } + ] + }, + { + "id": 549755936694, + "content": "About Norodom Sihanouk, as The King-Father of Cambodia (PreahmâhaviAbout Boris Yeltsi", + "creationDate": "2011-06-09T04:34:32.795Z", + "hasCreator": [ + { + "id": 13194139533535, + "firstName": "Shweta", + "lastName": "Singh" + } + ] + }, + { + "id": 549756013199, + "content": "thanks", + "creationDate": "2011-06-08T23:24:38.62Z", + "hasCreator": [ + { + "id": 10995116279521, + "firstName": "Rahul", + "lastName": "Nair" + } + ] + } + ] + }' +q10: + tag: "IC04" + query: '{ + var(func: type(person))@filter(eq(id, "933")) { + knows { + p1 as ~hasCreator @filter(lt(creationDate, "2011-10-10T14:02:42.274+00:00") AND type(post)) + } + ~knows { + p2 as ~hasCreator @filter(lt(creationDate, "2011-10-10T14:02:42.274+00:00")AND type(post)) + } + } + + var(func: uid(p1,p2)) @filter(le(creationDate, "2011-06-10T14:02:42.274+00:00")) { + oldTags as hasTag + } + + pbw as var(func: uid(p1,p2)) @filter(gt(creationDate, "2011-06-10T14:02:42.274+00:00")) + + var(func: uid(pbw)) { + newTags as hasTag @filter(NOT uid(oldTags)) + } + + var(func: uid(newTags)) { + pc as count(~hasTag) @filter(uid(pbw)) + } + + q(func: uid(newTags), orderdesc: val(pc), first: 10) { + name + val(pc) + } + }' + resp: '{ + "q": [ + { + "name": "Maurice_Ravel", + "val(pc)": 3 + }, + { + "name": "Mohammad_Reza_Pahlavi", + "val(pc)": 2 + }, + { + "name": "99_Problems", + "val(pc)": 1 + } + ] + }' +q10: + tag: "IC05" + query: '{ + pid as var(func: type(person))@filter(eq(id, "102")) + + var(func: uid(pid)){ + f11 as knows{ + f21 as knows @filter(NOT uid(pid)) + f22 as ~knows @filter(NOT uid(pid)) + } + f12 as ~knows{ + f23 as knows @filter(NOT uid(pid)) + f24 as ~knows @filter(NOT uid(pid)) + } + } + + f as var(func: uid(f11, f12, f21, f22, f23, f24)) + + vr as var(func: uid(f)) @cascade { + id + forums as ~hasMember @facets(ge(joinDate, "2011-07-18T18:52:55.426+00:00")){ + id + } + } + + var(func: uid(vr)) { + pr as ~hasCreator @filter(ge(creationDate, "2011-07-18T18:52:55.426+00:00") AND uid_in(~containerOf, uid(forums)) AND type(post)) + } + + var(func: uid(pr)) @cascade{ + id + creationDate + hasCreator{ + id + } + c as math(1) + ~containerOf @filter(eq(title, "Group for Buddy_Holly in Aligarh")){ + fposts as math(c) + } + } + + q(func: uid(fposts), orderdesc: val(fposts)) { + fqid + title + val(fposts) + } + }' + resp: '{ + "q": [ + { + "fqid": "forum_618475321331", + "title": "Group for Buddy_Holly in Aligarh", + "val(fposts)": 33 + } + ] + }' +q11: + tag: "IC06" + query: '{ + pid as var(func: type(person))@filter(eq(id, "102")) + var(func: uid(pid)){ + f11 as knows{ + f12 as knows @filter(NOT uid(pid)) + f13 as ~knows @filter(NOT uid(pid)) + } + f21 as ~knows{ + f22 as knows @filter(NOT uid(pid)) + f23 as ~knows @filter(NOT uid(pid)) + } + } + tag as var(func: eq(name, "Rumi")) { + posts as ~hasTag @filter(type(post)) + } + var(func: uid(f11 ,f12, f13, f21, f22, f23)){ + tc as math(1) + ~hasCreator @filter(uid(posts)) { + otherTag as hasTag { + tagCount as math(tc) + } + } + } + tags as var(func: uid(otherTag)) @filter(NOT uid(tag)) + q(func: uid(tags), orderdesc: val(tagCount), first:10){ + name + postCount: val(tagCount) + } + }' + resp: ' + { + "q": [ + { + "name": "Henry_IV_of_France", + "postCount": 6 + }, + { + "name": "Peggy_Lee", + "postCount": 5 + }, + { + "name": "Mary_J._Blige", + "postCount": 5 + }, + { + "name": "Thomas_Edison", + "postCount": 4 + }, + { + "name": "P._G._Wodehouse", + "postCount": 4 + }, + { + "name": "Jacques_Offenbach", + "postCount": 4 + }, + { + "name": "Meryl_Streep", + "postCount": 4 + }, + { + "name": "Roger_Federer", + "postCount": 4 + }, + { + "name": "Sarah_McLachlan", + "postCount": 3 + }, + { + "name": "Jay-Z", + "postCount": 3 + } + ] + }' +q12: + tag: "IC07" + query: '{ + pid as var(func: type(person))@filter(eq(id, "102")) + var(func: uid(pid))@cascade { + messages as ~hasCreator { + personLikes as ~likes + } + friends1 as knows{ + friend1 as math(1) + } + friends2 as ~knows{ + friend2 as math(1) + } + } + + q(func: uid(friends1, friends2, personLikes), orderdesc: id, first:20) @filter(uid_in(likes, uid(messages) )){ + isFriend2: val(friend2) + isFriend1: val(friend1) + id + firstName + lastName + likes @facets(orderdesc: creationDate) @filter(uid(messages)) (first:1){ + id + creationDate + } + } + }' + resp: ' + { + "q": [ + { + "isFriend1": 1, + "id": 32985348835356, + "firstName": "Sirak", + "lastName": "Dego", + "likes": [ + { + "id": 137439165539, + "creationDate": "2010-05-28T03:42:06.013Z", + "likes|creationDate": "2012-09-02T13:22:05.986+00:00" + } + ] + }, + { + "isFriend1": 1, + "id": 32985348833796, + "firstName": "Eugene", + "lastName": "Roindefo", + "likes": [ + { + "id": 687194982445, + "creationDate": "2011-10-25T03:52:33.775Z", + "likes|creationDate": "2012-08-29T11:59:24.376+00:00" + } + ] + }, + { + "id": 30786325580709, + "firstName": "Maria", + "lastName": "Adhia", + "likes": [ + { + "id": 1030792495067, + "creationDate": "2012-07-15T09:13:03.666Z", + "likes|creationDate": "2012-07-17T12:32:40.126+00:00" + } + ] + }, + { + "isFriend1": 1, + "id": 30786325580521, + "firstName": "A. K.", + "lastName": "Kapoor", + "likes": [ + { + "id": 206158645460, + "creationDate": "2010-07-25T20:55:24.529Z", + "likes|creationDate": "2012-09-04T00:30:34.431+00:00" + } + ] + }, + { + "isFriend1": 1, + "id": 30786325579731, + "firstName": "Angel", + "lastName": "Dego", + "likes": [ + { + "id": 755914459308, + "creationDate": "2011-12-21T19:23:33.148Z", + "likes|creationDate": "2012-07-17T06:54:31.413+00:00" + } + ] + }, + { + "id": 30786325579579, + "firstName": "John", + "lastName": "Murray", + "likes": [ + { + "id": 1030792495067, + "creationDate": "2012-07-15T09:13:03.666Z", + "likes|creationDate": "2012-08-03T11:44:46.719+00:00" + } + ] + }, + { + "isFriend1": 1, + "id": 30786325579016, + "firstName": "Anucha", + "lastName": "Paphunga", + "likes": [ + { + "id": 274878122242, + "creationDate": "2010-09-12T00:25:25.967Z", + "likes|creationDate": "2012-09-05T13:29:08.889+00:00" + } + ] + }, + { + "isFriend1": 1, + "id": 30786325578258, + "firstName": "Angel", + "lastName": "Melaku", + "likes": [ + { + "id": 549756028924, + "creationDate": "2011-06-09T04:49:24.699Z", + "likes|creationDate": "2012-08-26T12:42:22.138+00:00" + } + ] + }, + { + "id": 30786325577877, + "firstName": "Gary", + "lastName": "Hill", + "likes": [ + { + "id": 274878974105, + "creationDate": "2010-10-16T02:41:59.6Z", + "likes|creationDate": "2012-06-08T15:19:17.784+00:00" + } + ] + }, + { + "id": 28587302325553, + "firstName": "Jan", + "lastName": "Andrle", + "likes": [ + { + "id": 137439467278, + "creationDate": "2010-05-10T05:04:31.487Z", + "likes|creationDate": "2012-05-13T23:59:36.997+00:00" + } + ] + }, + { + "id": 28587302325465, + "firstName": "Francis", + "lastName": "Sotto", + "likes": [ + { + "id": 137439467278, + "creationDate": "2010-05-10T05:04:31.487Z", + "likes|creationDate": "2012-05-28T21:38:55.530+00:00" + } + ] + }, + { + "id": 28587302325298, + "firstName": "Yacine", + "lastName": "Abdeslam", + "likes": [ + { + "id": 137439467278, + "creationDate": "2010-05-10T05:04:31.487Z", + "likes|creationDate": "2012-03-29T09:18:21.406+00:00" + } + ] + }, + { + "id": 28587302325169, + "firstName": "Stefano", + "lastName": "Bianchi", + "likes": [ + { + "id": 274878974105, + "creationDate": "2010-10-16T02:41:59.6Z", + "likes|creationDate": "2012-03-26T19:33:06.543+00:00" + } + ] + }, + { + "id": 28587302325046, + "firstName": "Abraham", + "lastName": "Raghu", + "likes": [ + { + "id": 137439467278, + "creationDate": "2010-05-10T05:04:31.487Z", + "likes|creationDate": "2012-03-30T07:06:27.795+00:00" + } + ] + }, + { + "id": 28587302325012, + "firstName": "Josef", + "lastName": "Lederer", + "likes": [ + { + "id": 274878974105, + "creationDate": "2010-10-16T02:41:59.6Z", + "likes|creationDate": "2012-04-28T05:28:48.748+00:00" + } + ] + }, + { + "id": 28587302324990, + "firstName": "Abdoulatifou", + "lastName": "Tsiranana", + "likes": [ + { + "id": 274878974105, + "creationDate": "2010-10-16T02:41:59.6Z", + "likes|creationDate": "2012-05-04T21:25:23.472+00:00" + } + ] + }, + { + "id": 28587302324670, + "firstName": "Faisal", + "lastName": "Abdel Fattah", + "likes": [ + { + "id": 274878974105, + "creationDate": "2010-10-16T02:41:59.6Z", + "likes|creationDate": "2012-04-30T14:28:59.031+00:00" + } + ] + }, + { + "isFriend1": 1, + "id": 28587302323895, + "firstName": "พงศธร สุภิญโญ", + "lastName": "Bua", + "likes": [ + { + "id": 206158645460, + "creationDate": "2010-07-25T20:55:24.529Z", + "likes|creationDate": "2012-08-17T22:26:16.180+00:00" + } + ] + }, + { + "isFriend1": 1, + "id": 28587302323175, + "firstName": "Aisso", + "lastName": "Gerima", + "likes": [ + { + "id": 274878122242, + "creationDate": "2010-09-12T00:25:25.967Z", + "likes|creationDate": "2012-06-01T07:12:15.282+00:00" + } + ] + }, + { + "isFriend1": 1, + "id": 28587302322530, + "firstName": "David", + "lastName": "Taylor", + "likes": [ + { + "id": 755914459308, + "creationDate": "2011-12-21T19:23:33.148Z", + "likes|creationDate": "2012-08-14T00:46:37.967+00:00" + } + ] + } + ] + }' +q13: + tag: "IC08" + query: '{ + var(func: type(person))@filter(eq(id, "4398046514948"))@cascade{ + ~hasCreator{ + replies as ~replyOf + } + } + q(func: uid(replies), orderdesc: creationDate, orderasc: id, first:20 ){ + id + content + creationDate + hasCreator{ + id + firstName + lastName + } + } + }' + resp: ' + { + "q":[ + { + "id":1030792574454, + "content":"good", + "creationDate":"2012-09-02T13:06:03.784Z", + "hasCreator":[ + { + "id":4398046511667, + "firstName":"John", + "lastName":"Chopra" + } + ] + }, + { + "id":1030792574449, + "content":"roflol", + "creationDate":"2012-09-02T04:35:03.877Z", + "hasCreator":[ + { + "id":19791209301054, + "firstName":"Ana", + "lastName":"Alves" + } + ] + }, + { + "id":1030792574453, + "content":"good", + "creationDate":"2012-09-02T04:26:48.008Z", + "hasCreator":[ + { + "id":4398046513018, + "firstName":"Deepak", + "lastName":"Kumar" + } + ] + }, + { + "id":1030792278590, + "content":"About Bing Crosby, s. The company also developed equipmentAbout Fiji, ation i", + "creationDate":"2012-08-31T04:27:46.054Z", + "hasCreator":[ + { + "id":26388279067551, + "firstName":"Anand", + "lastName":"Rao" + } + ] + }, + { + "id":1030792571689, + "content":"ok", + "creationDate":"2012-08-13T14:20:23.266Z", + "hasCreator":[ + { + "id":8796093025528, + "firstName":"Wei", + "lastName":"Li" + } + ] + }, + { + "id":1030792635989, + "content":"yes", + "creationDate":"2012-08-06T09:47:16.093Z", + "hasCreator":[ + { + "id":2199023259059, + "firstName":"Joseph", + "lastName":"Chopra" + } + ] + }, + { + "id":1030792635986, + "content":"About William Pitt the Younger, ithout anAbout Tony Bennett, o — that About Ukraine, GDP g", + "creationDate":"2012-08-06T09:42:08.981Z", + "hasCreator":[ + { + "id":2199023258456, + "firstName":"Alfonso", + "lastName":"Campos" + } + ] + }, + { + "id":1030792521966, + "content":"About John McEnroe, mmy Connors and About Ehud Olmert, nt against formeAbout Amy Winehouse, ted at number", + "creationDate":"2012-08-06T04:05:25.263Z", + "hasCreator":[ + { + "id":6597069767432, + "firstName":"Abhishek", + "lastName":"Rao" + } + ] + }, + { + "id":1030792521953, + "content":"good", + "creationDate":"2012-08-06T00:22:06.917Z", + "hasCreator":[ + { + "id":21990232555934, + "firstName":"Deepak", + "lastName":"Reddy" + } + ] + }, + { + "id":1030792521952, + "content":"maybe", + "creationDate":"2012-08-05T21:26:40.818Z", + "hasCreator":[ + { + "id":609, + "firstName":"Shweta", + "lastName":"Sharma" + } + ] + }, + { + "id":1030792521962, + "content":"thx", + "creationDate":"2012-08-05T19:18:39.998Z", + "hasCreator":[ + { + "id":8796093022765, + "firstName":"Rahul", + "lastName":"Singh" + } + ] + }, + { + "id":1030792521957, + "content":"right", + "creationDate":"2012-08-05T17:08:47.684Z", + "hasCreator":[ + { + "id":2874, + "firstName":"Deepak", + "lastName":"Bose" + } + ] + }, + { + "id":1030792521954, + "content":"About Ehud Olmert, nterim Prime MiAbout Gordon Brown, erformed poorlyAbout Quentin Tarant", + "creationDate":"2012-08-05T16:02:27.975Z", + "hasCreator":[ + { + "id":26388279067183, + "firstName":"Shweta", + "lastName":"Sharma" + } + ] + }, + { + "id":1030792359095, + "content":"yes", + "creationDate":"2012-07-21T08:05:13.263Z", + "hasCreator":[ + { + "id":21990232556992, + "firstName":"Shweta", + "lastName":"Kumar" + } + ] + }, + { + "id":1030792359091, + "content":"About Mahmud of Ghazni, zni in modern-day Afghanistan into the wealthy capital of an extensive empire which coveredAbout São Tomé and Príncipe, ão Tomé and Príncipe held presidentia", + "creationDate":"2012-07-20T20:21:48.762Z", + "hasCreator":[ + { + "id":10995116280723, + "firstName":"Abhishek", + "lastName":"Sharma" + } + ] + }, + { + "id":1030792359092, + "content":"no", + "creationDate":"2012-07-20T17:47:11.493Z", + "hasCreator":[ + { + "id":17592186048023, + "firstName":"Abhishek", + "lastName":"Reddy" + } + ] + }, + { + "id":1030792359090, + "content":"roflol", + "creationDate":"2012-07-20T16:48:47.505Z", + "hasCreator":[ + { + "id":8796093025410, + "firstName":"Priyanka", + "lastName":"Singh" + } + ] + }, + { + "id":1030792359098, + "content":"roflol", + "creationDate":"2012-07-20T08:32:07.044Z", + "hasCreator":[ + { + "id":19791209300814, + "firstName":"A.", + "lastName":"Kapoor" + } + ] + }, + { + "id":1030792359130, + "content":"fine", + "creationDate":"2012-07-12T12:42:46.077Z", + "hasCreator":[ + { + "id":2199023258155, + "firstName":"Rahul", + "lastName":"Rao" + } + ] + }, + { + "id":1030792359122, + "content":"I see", + "creationDate":"2012-07-12T05:24:53.898Z", + "hasCreator":[ + { + "id":17592186048023, + "firstName":"Abhishek", + "lastName":"Reddy" + } + ] + } + ] + }' +q14: + tag: "IC09" + query: '{ + pid as var(func: type(person))@filter(eq(id, "4398046514948")) + var(func: uid(pid)){ + f11 as knows{ + f21 as knows @filter(NOT uid(pid)) + f22 as ~knows @filter(NOT uid(pid)) + } + f12 as ~knows{ + f23 as knows @filter(NOT uid(pid)) + f24 as ~knows @filter(NOT uid(pid)) + } + } + var(func: uid(f11, f12, f21, f22, f23, f24) ){ + msgs as ~hasCreator @filter(le(creationDate, "2011-06-10T14:02:42.274+00:00" )) + } + + q1(func: uid(msgs), orderdesc: creationDate, orderasc: id, first:20){ + id + content + creationDate + hasCreator{ + id + firstName + lastName + } + } + }' + resp: ' + { + "q1":[ + { + "id":549756657940, + "content":"fine", + "creationDate":"2011-06-10T13:56:00.791Z", + "hasCreator":[ + { + "id":13194139536019, + "firstName":"Said Suwailim", + "lastName":"Al-Shoon" + } + ] + }, + { + "id":549756765767, + "content":"About Misty Mountain Hop, ide of the Black Dog single, but still received considerable F", + "creationDate":"2011-06-10T13:42:22.948Z", + "hasCreator":[ + { + "id":4398046511145, + "firstName":"John", + "lastName":"Kumar" + } + ] + }, + { + "id":549756527217, + "content":"About Francis of Assisi, r scene. In 1224, he received the stigmata, making him the first recorded person to bear the wounds of Christ''s Passion.", + "creationDate":"2011-06-10T13:09:23.012Z", + "hasCreator":[ + { + "id":2783, + "firstName":"Rafael", + "lastName":"Alonso" + } + ] + }, + { + "id":549755988758, + "content":"no", + "creationDate":"2011-06-10T12:59:25.702Z", + "hasCreator":[ + { + "id":13194139536501, + "firstName":"Yang", + "lastName":"Zhang" + } + ] + }, + { + "id":549756828497, + "content":"yes", + "creationDate":"2011-06-10T12:33:37.68Z", + "hasCreator":[ + { + "id":8796093025361, + "firstName":"Arjun", + "lastName":"Khan" + } + ] + }, + { + "id":549756812779, + "content":"About Constantine the Great, 22 May 337), also known as Constantine I or Sain", + "creationDate":"2011-06-10T12:30:21.154Z", + "hasCreator":[ + { + "id":10995116278259, + "firstName":"Rahul", + "lastName":"Singh" + } + ] + }, + { + "id":549756812775, + "content":"cool", + "creationDate":"2011-06-10T12:24:17.811Z", + "hasCreator":[ + { + "id":10995116281248, + "firstName":"Arjun", + "lastName":"Sharma" + } + ] + }, + { + "id":549756333087, + "content":"thx", + "creationDate":"2011-06-10T12:08:46.175Z", + "hasCreator":[ + { + "id":6597069767117, + "firstName":"Eli", + "lastName":"Peretz" + } + ] + }, + { + "id":549756635642, + "content":"no", + "creationDate":"2011-06-10T12:01:47.407Z", + "hasCreator":[ + { + "id":6597069767242, + "firstName":"Salim Ahmed", + "lastName":"Binalshibh" + } + ] + }, + { + "id":549755858247, + "content":"maybe", + "creationDate":"2011-06-10T11:49:17.782Z", + "hasCreator":[ + { + "id":6597069767747, + "firstName":"Fali Sam", + "lastName":"Nariman" + } + ] + }, + { + "id":549756657938, + "content":"roflol", + "creationDate":"2011-06-10T11:46:39.373Z", + "hasCreator":[ + { + "id":3748, + "firstName":"Chen", + "lastName":"Yang" + } + ] + }, + { + "id":549755970443, + "content":"LOL", + "creationDate":"2011-06-10T11:44:56.482Z", + "hasCreator":[ + { + "id":13194139534652, + "firstName":"Rodrigo", + "lastName":"Alves" + } + ] + }, + { + "id":549756098361, + "content":"yes", + "creationDate":"2011-06-10T11:37:08.4Z", + "hasCreator":[ + { + "id":15393162790796, + "firstName":"Bingbing", + "lastName":"Xu" + } + ] + }, + { + "id":549756657937, + "content":"About Augustine of Hippo, oman Empire was starting to disintegrate, Augustine developed the concept of the About Francis Bacon, served both as Attorney General a", + "creationDate":"2011-06-10T11:30:38.153Z", + "hasCreator":[ + { + "id":3412, + "firstName":"Lei", + "lastName":"Wang" + } + ] + }, + { + "id":549756454086, + "content":"thanks", + "creationDate":"2011-06-10T11:28:54.455Z", + "hasCreator":[ + { + "id":2199023256181, + "firstName":"John", + "lastName":"Rao" + } + ] + }, + { + "id":549756454080, + "content":"duh", + "creationDate":"2011-06-10T11:27:35.591Z", + "hasCreator":[ + { + "id":13194139533535, + "firstName":"Shweta", + "lastName":"Singh" + } + ] + }, + { + "id":549756812772, + "content":"right", + "creationDate":"2011-06-10T11:26:56.247Z", + "hasCreator":[ + { + "id":8796093023060, + "firstName":"Karim", + "lastName":"Akhmadiyeva" + } + ] + }, + { + "id":549755858245, + "content":"About Ethiopian Empire, hiopian Empire also known as Abyssinia, covered a geo", + "creationDate":"2011-06-10T11:23:15.209Z", + "hasCreator":[ + { + "id":15393162790400, + "firstName":"Jose", + "lastName":"Costa" + } + ] + }, + { + "id":549756812778, + "content":"good", + "creationDate":"2011-06-10T11:05:22.351Z", + "hasCreator":[ + { + "id":15393162789787, + "firstName":"Bakhytzan", + "lastName":"Aab" + } + ] + }, + { + "id":549756330472, + "content":"", + "creationDate":"2011-06-10T11:00:54.828Z", + "hasCreator":[ + { + "id":2199023256097, + "firstName":"Walter", + "lastName":"Schmidt" + } + ] + } + ] + }' +q15: + tag: "IC10" + query: '{ + pid as var(func: type(person))@filter(eq(id, "933")) + var(func: uid(pid)){ + exf1 as knows{ + f1 as knows + f2 as ~knows + } + exf2 as ~knows{ + f3 as knows + f4 as ~knows + } + } + friendsOfInterest as var(func:uid(f1,f2,f3,f4)) @filter(NOT uid(exf1, exf2, pid)) + var(func: uid(pid)){ + tagsOfInterest as hasInterest (orderasc: fqid) + } + var(func: uid(friendsOfInterest)){ + common as count(~hasCreator) @filter(uid_in(hasTag, uid(tagsOfInterest)) AND type(post)) + } + var(func: uid(friendsOfInterest)){ + uncommon as count(~hasCreator) @filter(NOT uid_in(hasTag, uid(tagsOfInterest)) AND type(post)) + } + var(func: uid(friendsOfInterest) ){ + interest as math(common - uncommon ) + } + q(func: uid(friendsOfInterest), orderdesc: val(interest), first:10){ + fqid + firstName + lastName + gender + isLocatedIn{ + name + } + co: val(common) + un: val(uncommon) + interest: val(interest) + } + }' + resp: ' + { + "q":[ + { + "fqid":"person_30786325578932", + "firstName":"Alexander", + "lastName":"Hleb", + "gender":"female", + "isLocatedIn":[ + { + "name":"Barysaw" + } + ], + "co":10, + "un":0, + "interest":10 + }, + { + "fqid":"person_2788", + "firstName":"Peter", + "lastName":"Schmidt", + "gender":"female", + "isLocatedIn":[ + { + "name":"Wernigerode" + } + ], + "co":7, + "un":0, + "interest":7 + }, + { + "fqid":"person_30786325580189", + "firstName":"Carlos", + "lastName":"Alonso", + "gender":"female", + "isLocatedIn":[ + { + "name":"Madrid" + } + ], + "co":1, + "un":0, + "interest":1 + }, + { + "fqid":"person_30786325578711", + "firstName":"Aad De", + "lastName":"Bos", + "gender":"female", + "isLocatedIn":[ + { + "name":"Maastricht" + } + ], + "co":0, + "un":0, + "interest":0 + }, + { + "fqid":"person_30786325580642", + "firstName":"Heikki", + "lastName":"Blomqvist", + "gender":"male", + "isLocatedIn":[ + { + "name":"Helsinki" + } + ], + "co":0, + "un":0, + "interest":0 + }, + { + "fqid":"person_28587302325169", + "firstName":"Stefano", + "lastName":"Bianchi", + "gender":"male", + "isLocatedIn":[ + { + "name":"Florence" + } + ], + "co":1, + "un":1, + "interest":0 + }, + { + "fqid":"person_32985348836951", + "firstName":"Ismael", + "lastName":"Lo", + "gender":"female", + "isLocatedIn":[ + { + "name":"Dosso" + } + ], + "co":0, + "un":0, + "interest":0 + }, + { + "fqid":"person_32985348833670", + "firstName":"Alfred", + "lastName":"Berg", + "gender":"male", + "isLocatedIn":[ + { + "name":"Amsterdam" + } + ], + "co":0, + "un":0, + "interest":0 + }, + { + "fqid":"person_32985348834284", + "firstName":"Bobby", + "lastName":"Garcia", + "gender":"female", + "isLocatedIn":[ + { + "name":"Legazpi" + } + ], + "co":0, + "un":0, + "interest":0 + }, + { + "fqid":"person_30786325580376", + "firstName":"Bibit", + "lastName":"Budjana", + "gender":"female", + "isLocatedIn":[ + { + "name":"Medan" + } + ], + "co":0, + "un":0, + "interest":0 + } + ] + }' +q16: + tag: "IC11" + query: '{ + pid as var(func: type(person))@filter(eq(id, "4398046514948")) + var(func: uid(pid)){ + f1 as knows @filter(NOT uid(pid)){ + f11 as knows @filter(NOT uid(pid)) + f12 as ~knows @filter(NOT uid(pid)) + } + f2 as ~knows @filter(NOT uid(pid)){ + f21 as knows @filter(NOT uid(pid)) + f22 as ~knows @filter(NOT uid(pid)) + } + } + friendsAndFoF as var(func:uid(f1, f2, f11, f12, f21, f22)) + country as var(func: eq(name, "Sri_Lanka")) + organisation as var(func: type(organisation)) @filter(uid_in(isLocatedIn, uid(country))) + relevantFriends as var(func: uid(friendsAndFoF))@filter(uid_in(workAt, uid(organisation))) + q(func: uid(relevantFriends), orderasc: id) @cascade{ + id + firstName + lastName + workAt @filter( uid(organisation)) @facets(workFrom) @facets(le(workFrom, "2007-12-31T18:52:55.426+00:00")){ + id + name + } + } + }' + resp: ' + { + "q": [ + { + "id": 8796093025833, + "firstName": "Rahul", + "lastName": "Khan", + "workAt": [ + { + "id": 1226, + "name": "SriLankan_Airlines", + "workAt|workFrom": "2006" + } + ] + }, + { + "id": 15393162791199, + "firstName": "Alawwe", + "lastName": "Fernando", + "workAt": [ + { + "id": 1226, + "name": "SriLankan_Airlines", + "workAt|workFrom": "2004" + } + ] + }, + { + "id": 19791209300504, + "firstName": "M", + "lastName": "Perera", + "workAt": [ + { + "id": 1226, + "name": "SriLankan_Airlines", + "workAt|workFrom": "2007" + }, + { + "id": 1228, + "name": "Expo_Aviation", + "workAt|workFrom": "2006" + } + ] + }, + { + "id": 21990232557705, + "firstName": "Ernest B", + "lastName": "Goenka", + "workAt": [ + { + "id": 1226, + "name": "SriLankan_Airlines", + "workAt|workFrom": "2001" + } + ] + }, + { + "id": 24189255811381, + "firstName": "Mahinda", + "lastName": "De Silva", + "workAt": [ + { + "id": 1228, + "name": "Expo_Aviation", + "workAt|workFrom": "2004" + } + ] + }, + { + "id": 30786325580960, + "firstName": "Duleep", + "lastName": "Banda", + "workAt": [ + { + "id": 1230, + "name": "Deccan_Lanka", + "workAt|workFrom": "2004" + }, + { + "id": 1228, + "name": "Expo_Aviation", + "workAt|workFrom": "2004" + } + ] + }, + { + "id": 32985348836556, + "firstName": "Maithripala", + "lastName": "Gunasekera", + "workAt": [ + { + "id": 1229, + "name": "Mihin_Lanka", + "workAt|workFrom": "2005" + } + ] + } + ] + }' +q17: + tag: "IC12" + query: '{ + mainTagClass as var(func: eq(name, "Artist")) @recurse{ + subClasses as ~isSubclassOf + } + var(func: uid(mainTagClass, subClasses) ){ + tags as ~hasType + } + var(func: type(person))@filter(eq(id, "102")){ + friends1 as knows + friends2 as ~knows + } + friends as var(func: uid(friends1, friends2), first:5000) + relevantPosts as var(func: type(post)) @filter(uid_in(hasTag, uid(tags))) + var(func: uid(relevantPosts)){ + ~replyOf @filter(uid_in(hasCreator, uid(friends))){ + relevantFriends as hasCreator + } + } + var(func: uid(relevantFriends)){ + replyCount as count(~hasCreator) @filter(uid_in(replyOf, uid(relevantPosts) )) + } + q(func: uid(relevantFriends), orderdesc: val(replyCount), first:20){ + id + firstName + lastName + replyCount : val(replyCount) + } + }' + resp: ' + { + "q":[ + { + "id":6597069767242, + "firstName":"Salim Ahmed", + "lastName":"Binalshibh", + "replyCount":882 + }, + { + "id":2783, + "firstName":"Rafael", + "lastName":"Alonso", + "replyCount":832 + }, + { + "id":6597069770047, + "firstName":"Edward", + "lastName":"Popov", + "replyCount":272 + }, + { + "id":4398046514225, + "firstName":"Ricardo", + "lastName":"Calvert", + "replyCount":246 + }, + { + "id":6597069768780, + "firstName":"Carlos", + "lastName":"Martins", + "replyCount":220 + }, + { + "id":3587, + "firstName":"Ahmad", + "lastName":"Chedid", + "replyCount":205 + }, + { + "id":2199023259354, + "firstName":"Aisso", + "lastName":"Mamo", + "replyCount":185 + }, + { + "id":2845, + "firstName":"Frederick", + "lastName":"Kawawa", + "replyCount":181 + }, + { + "id":318, + "firstName":"Claude", + "lastName":"Radafison", + "replyCount":181 + }, + { + "id":10995116281261, + "firstName":"Aleksandr", + "lastName":"Basov", + "replyCount":164 + }, + { + "id":24189255811566, + "firstName":"The", + "lastName":"Kunda", + "replyCount":154 + }, + { + "id":1355, + "firstName":"Peter", + "lastName":"Taylor", + "replyCount":145 + }, + { + "id":2199023257239, + "firstName":"Mikhail", + "lastName":"Basov", + "replyCount":115 + }, + { + "id":6597069766850, + "firstName":"Claude", + "lastName":"Aly", + "replyCount":109 + }, + { + "id":3688, + "firstName":"Ismail Omar", + "lastName":"Mamo", + "replyCount":103 + }, + { + "id":6597069767470, + "firstName":"George", + "lastName":"Antoniou", + "replyCount":100 + }, + { + "id":26388279067534, + "firstName":"Emperor of Brazil", + "lastName":"Dom Pedro II", + "replyCount":97 + }, + { + "id":24189255813579, + "firstName":"Alfred", + "lastName":"Jong", + "replyCount":69 + }, + { + "id":19791209303109, + "firstName":"Bing", + "lastName":"Yang", + "replyCount":44 + }, + { + "id":19791209300020, + "firstName":"Akira", + "lastName":"Yamamoto", + "replyCount":39 + } + ] + }' +q18: + tag: "IC13" + query: '{ + A as var(func: eq(fqid, "398046514948")) + M as var(func: eq(fqid, "28587302326035")) + path as shortest(from: uid(A), to: uid(M)) { + knows + ~knows + } + path(func: uid(path)) { + id + } + }' + resp: '{ + "path": [] + }' \ No newline at end of file diff --git a/t/t.go b/t/t.go index 998ec491d0d..f8463045b38 100644 --- a/t/t.go +++ b/t/t.go @@ -632,8 +632,10 @@ func isValidPackageForSuite(pkg string) bool { return true case "load": return isLoadPackage(pkg) + case "ldbc": + return isLDBCPackage(pkg) case "unit": - return !isLoadPackage(pkg) + return !isLoadPackage(pkg) && !isLDBCPackage(pkg) default: fmt.Printf("wrong suite is provide %s. valid values are all/load/unit \n", *suite) return false @@ -649,6 +651,10 @@ func isLoadPackage(pkg string) bool { return false } +func isLDBCPackage(pkg string) bool { + return strings.HasSuffix(pkg, "/systest/ldbc") +} + var datafiles = map[string]string{ "1million-noindex.schema": "https://github.com/dgraph-io/benchmarks/blob/master/data/1million-noindex.schema?raw=true", "1million.schema": "https://github.com/dgraph-io/benchmarks/blob/master/data/1million.schema?raw=true", @@ -657,6 +663,39 @@ var datafiles = map[string]string{ "21million.rdf.gz": "https://github.com/dgraph-io/benchmarks/blob/master/data/21million.rdf.gz?raw=true", } +var baseUrl = "https://github.com/dgraph-io/benchmarks/blob/master/ldbc/sf0.3/ldbc_rdf_0.3/" +var suffix = "?raw=true" + +var rdfFileNames = [...]string{ + "Deltas.rdf", + "comment_0.rdf", + "containerOf_0.rdf", + "forum_0.rdf", + "hasCreator_0.rdf", + "hasInterest_0.rdf", + "hasMember_0.rdf", + "hasModerator_0.rdf", + "hasTag_0.rdf", + "hasType_0.rdf", + "isLocatedIn_0.rdf", + "isPartOf_0.rdf", + "isSubclassOf_0.rdf", + "knows_0.rdf", + "likes_0.rdf", + "organisation_0.rdf", + "person_0.rdf", + "place_0.rdf", + "post_0.rdf", + "replyOf_0.rdf", + "studyAt_0.rdf", + "tag_0.rdf", + "tagclass_0.rdf", + "workAt_0.rdf"} + +var ldbcDataFiles = map[string]string{ + "ldbcTypes.schema": "https://github.com/dgraph-io/benchmarks/blob/master/ldbc/sf0.3/ldbcTypes.schema?raw=true", +} + func downloadDataFiles() { if !*downloadResources { fmt.Print("Skipping downloading of resources\n") @@ -677,6 +716,38 @@ func downloadDataFiles() { } } +func downloadLDBCFiles() { + if !*downloadResources { + fmt.Print("Skipping downloading of resources\n") + return + } + if *tmp == "" { + *tmp = os.TempDir() + "/ldbcData" + } + + x.Check(testutil.MakeDirEmpty([]string{*tmp})) + + for _, name := range rdfFileNames { + filepath := baseUrl + name + suffix + ldbcDataFiles[name] = filepath + } + + i := 0 + for fname, link := range ldbcDataFiles { + start := time.Now() + cmd := exec.Command("wget", "-O", fname, link) + cmd.Dir = *tmp + i++ + fmt.Printf("Downloading %d of %d files\n", i, len(ldbcDataFiles)) + if out, err := cmd.CombinedOutput(); err != nil { + fmt.Printf("Error %v", err) + fmt.Printf("Output %v", out) + } + fmt.Printf("Downloaded %s to %s in %s\n", fname, *tmp, time.Since(start)) + } + +} + func createTestCoverageFile(path string) error { outFile, err := os.Create(path) if err != nil { @@ -832,6 +903,9 @@ func run() error { if *suite == "load" || *suite == "all" { downloadDataFiles() } + if *suite == "ldbc" || *suite == "all" { + downloadLDBCFiles() + } for i, task := range valid { select { case testCh <- task: