This repository has been archived by the owner on Apr 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
220 additions
and
971 deletions.
There are no files selected for viewing
908 changes: 15 additions & 893 deletions
908
compiler/src/test/scala/ingraph/sandbox/BiCompilerTest.scala
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 111 additions & 16 deletions
127
ire-adapter/src/test/scala/ingraph/ire/BiEngineTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,120 @@ | ||
package ingraph.ire | ||
|
||
import org.scalatest.FunSuite | ||
class BiEngineTest extends EngineTest { | ||
|
||
class BiEngineTest extends FunSuite { | ||
override val queryDir: String = "ldbc-snb-bi" | ||
|
||
ignore("test 1") { | ||
val indexer = new Indexer() | ||
test("bi-101: Count persons") { | ||
run("""MATCH (p:Person)-[:IS_LOCATED_IN]->(c:country) | ||
|RETURN p, count(c) AS cc | ||
""".stripMargin) | ||
} | ||
|
||
// compiles | ||
ignore("bi-01 from file: Posting summary") { | ||
runFromFile("bi-01") | ||
} | ||
|
||
ignore("bi-02 from file: Top tags for country, age, gender, time") { | ||
runFromFile("bi-02") | ||
} | ||
|
||
ignore("bi-03 from file: Tag evolution") { | ||
runFromFile("bi-03") | ||
} | ||
|
||
test("bi-04 from file: Popular topics in a country") { | ||
runFromFile("bi-04") | ||
} | ||
|
||
ignore("bi-05 from file: Top posters in a country") { | ||
runFromFile("bi-05") | ||
} | ||
|
||
test("bi-06 from file: Most active Posters of a given Topic") { | ||
runFromFile("bi-06") | ||
} | ||
|
||
test("bi-07 from file: Most authoritative users on a given topic") { | ||
runFromFile("bi-07") | ||
} | ||
|
||
test("bi-08 from file: Related Topics") { | ||
runFromFile("bi-08") | ||
} | ||
|
||
// compiles | ||
ignore("bi-09 from file: Forum with related Tags") { | ||
runFromFile("bi-09") | ||
} | ||
|
||
ignore("bi-10 from file: Central Person for a Tag") { | ||
runFromFile("bi-10") | ||
} | ||
|
||
val readQuery = | ||
"""MATCH (country:Country {name: 'Austria'}) | ||
|MATCH (a:Person)-[:isLocatedIn]->(:City)-[:isPartOf]->(country) | ||
|MATCH (b:Person)-[:isLocatedIn]->(:City)-[:isPartOf]->(country) | ||
|MATCH (c:Person)-[:isLocatedIn]->(:City)-[:isPartOf]->(country) | ||
|MATCH (a)-[:knows]-(b), (b)-[:knows]-(c), (c)-[:knows]-(a) | ||
|WHERE a.id < b.id | ||
| AND b.id < c.id | ||
|RETURN count(*) | ||
""".stripMargin | ||
ignore("bi-11 from file: Unrelated replies") { | ||
runFromFile("bi-11") | ||
} | ||
|
||
test("bi-12 from file: Trending Posts") { | ||
runFromFile("bi-12") | ||
} | ||
|
||
val readAdapter = new IngraphIncrementalAdapter(readQuery, "read", indexer) | ||
val result = readAdapter.result() | ||
ignore("bi-13 from file: Popular Tags per month in a country") { | ||
runFromFile("bi-13") | ||
} | ||
|
||
// compiles | ||
ignore("bi-14 from file: Top thread initiators") { | ||
runFromFile("bi-14") | ||
} | ||
|
||
// compiles | ||
ignore("bi-15 from file: Social normals") { | ||
runFromFile("bi-15") | ||
} | ||
|
||
ignore("bi-16 from file: Experts in social circle") { | ||
runFromFile("bi-16") | ||
} | ||
|
||
test("bi-17 from file: Friend triangles") { | ||
runFromFile("bi-17") | ||
} | ||
|
||
// compiles | ||
ignore("bi-18 from file: How many persons have a given number of posts") { | ||
runFromFile("bi-18") | ||
} | ||
|
||
// compiles | ||
ignore("bi-19 from file: Stranger's interaction") { | ||
runFromFile("bi-19") | ||
} | ||
|
||
// compiles | ||
ignore("bi-20 from file: High-level topics") { | ||
runFromFile("bi-20") | ||
} | ||
|
||
ignore("bi-21 from file: Zombies in a country") { | ||
runFromFile("bi-21") | ||
} | ||
|
||
ignore("bi-22 from file: International dialog") { | ||
runFromFile("bi-22") | ||
} | ||
|
||
test("bi-23 from file: Holiday destinations") { | ||
runFromFile("bi-23") | ||
} | ||
|
||
// compiles | ||
ignore ("bi-24 from file: Messages by Topic and Continent") { | ||
runFromFile("bi-24") | ||
} | ||
|
||
ignore("bi-25 from file: Weighted paths") { | ||
runFromFile("bi-25") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package ingraph.ire | ||
|
||
import org.scalatest.FunSuite | ||
|
||
abstract class EngineTest extends FunSuite { | ||
|
||
val queryDir: String | ||
|
||
def run(readQuery: String): Unit = { | ||
val indexer = new Indexer() | ||
val readAdapter = new IngraphIncrementalAdapter(readQuery, "read", indexer) | ||
val result = readAdapter.result() | ||
} | ||
|
||
def runFromFile(fileBaseName: String): Unit = { | ||
val source = scala.io.Source.fromFile(s"../queries/${queryDir}/${fileBaseName}.cypher") | ||
val queryString = try source.getLines.mkString("\n") finally source.close() | ||
run(queryString) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.