Пример #1
0
    def executeWithBackend(self, runner: query_runner, query_type, startQ, endQ):
        logging.basicConfig(stream=sys.stdout, level='INFO', format="%(message)s")

        for qno in range(startQ, endQ + 1):
            print( runner.backendName() + ":Interactive Complex " + str(qno))
            seeds = seed_generator.get_seeds(PATH_TO_SEEDS, NO_OF_SEEDS, query_type, qno, DATE_FORMAT)
            query_ok = True
            for seed_no in range(0, len(seeds)):
                seed = seeds[seed_no]
                results = driver.run_query(seed, query_type, qno, runner)
                if results == None or len(results) == 0:
                    query_ok = False
            self.assertTrue(query_ok) 
Пример #2
0
    def crossExecute(self, runner: query_runner, another_runner: query_runner, query_type, startQ, endQ):
        for qno in range(startQ, endQ + 1):
            print("Interactive Complex " + str(qno))
            seeds = seed_generator.get_seeds(PATH_TO_SEEDS, NO_OF_SEEDS, query_type, qno, DATE_FORMAT)
            query_ok = False
            for seed_no in range(0, len(seeds)):
                seed = seeds[seed_no]
                results = driver.run_query(seed, query_type, qno, runner)
                anotherResults = driver.run_query(seed, query_type, qno, another_runner)

                if results != None and anotherResults != None:
                    print("v: " + str(len(results)) + " s: " + str(len(anotherResults)))
                    self.assertEqual(len(results), len(anotherResults))
                    query_ok = True
            self.assertTrue(query_ok)
    def testInteractiveShortVirtuoso(self):
        query_type = "is"
        no_of_seeds = 1
        virtuosoRunner = virtuoso_query_runner.VirtuosoQueryRunner("http://www.ldbc.eu/" + SFACTOR, TIMEOUT, QUERY_DIR)

        logging.basicConfig(stream=sys.stdout, level='INFO', format="%(message)s")

        for qno in range(1, 7):
            print("Interactive Short " + str(qno))
            seeds = seed_generator.get_seeds(PATH_TO_SEEDS, no_of_seeds, query_type, qno, DATE_FORMAT)
            query_ok = True
            for seed_no in range(0, len(seeds)):
                seed = seeds[seed_no]
                virtuosoResults = driver.run_query(seed, query_type, qno, virtuosoRunner)
                if virtuosoResults == None or len(virtuosoResults) == 0:
                    query_ok = False
            self.assertTrue(query_ok)
    def testInteractiveShortStardog(self):
        query_type = "is"
        no_of_seeds = 1
        stardogRunner = stardog_query_runner.StardogQueryRunner(SFACTOR, TIMEOUT, QUERY_DIR)

        logging.basicConfig(stream=sys.stdout, level='INFO', format="%(message)s")

        for qno in range(1, 7):
            print("Interactive Short " + str(qno))
            seeds = seed_generator.get_seeds(PATH_TO_SEEDS, no_of_seeds, query_type, qno, DATE_FORMAT)
            query_ok = True
            for seed_no in range(0, len(seeds)):
                seed = seeds[seed_no]
                stardogResults = driver.run_query(seed, query_type, qno, stardogRunner)
                if stardogResults == None or len(stardogResults) == 0:
                    query_ok = False
            self.assertTrue(query_ok)
    def testInteractiveCrossImplementation(self):
        query_type = "ic"
        no_of_seeds = 5
        virtuosoRunner = virtuoso_query_runner.VirtuosoQueryRunner("http://www.ldbc.eu/" + SFACTOR, TIMEOUT, QUERY_DIR)
        stardogRunner = stardog_query_runner.StardogQueryRunner(SFACTOR, TIMEOUT, QUERY_DIR)

        for qno in range(1, 13):
            print("Interactive Complex " + str(qno))
            seeds = seed_generator.get_seeds(PATH_TO_SEEDS, no_of_seeds, query_type, qno, DATE_FORMAT)
            query_ok = False
            for seed_no in range(0, len(seeds)):
                seed = seeds[seed_no]
                virtuosoResults = driver.run_query(seed, query_type, qno, virtuosoRunner)
                stardogResults = driver.run_query(seed, query_type, qno, stardogRunner)

                if virtuosoResults != None and stardogResults != None:
                    print("v: " + str(len(virtuosoResults)) + " s: " + str(len(stardogResults)))
                    self.assertEqual(len(virtuosoResults), len(stardogResults))
                    query_ok = True
            self.assertTrue(query_ok)
Пример #6
0
    ap.add_argument("-p", "--path", help="Full path to the seed directory.")
    ap.add_argument("-n",
                    "--num",
                    type=int,
                    default=DEFAULT_MAX_NUM_SEEDS,
                    help="Number of seeds to run queries.")
    ap.add_argument("-qt", "--qtype", default=DEFAULT_QUERY_TYPE)
    ap.add_argument("-qn", "--qno", type=int, default=DEFAULT_QUERY_NUMBER)
    ap.add_argument("-to",
                    "--timeout",
                    default=DEFAULT_TIMEOUT,
                    help="Query timeout in mins")
    ap.add_argument("-db", "--database", default=DEFAULT_TIMEOUT)
    args = ap.parse_args()

    args = ap.parse_args()
    backend = args.backend
    timeout = int(args.timeout)
    if backend == "stardog":
        queryRunner = stardog_query_runner.StardogQueryRunner(
            args.database, timeout, QUERY_DIR)
    elif backend == "virtuoso":
        queryRunner = virtuoso_query_runner.VirtuosoQueryRunner(
            "http://www.ldbc.eu/" + args.database, timeout, QUERY_DIR)

    logging.basicConfig(stream=sys.stdout, level='INFO', format="%(message)s")

    seeds = seed_generator.get_seeds(args.path, args.num, args.qtype, args.qno,
                                     DATE_FORMAT)
    driver.run_queries(seeds, args.qtype, args.qno, queryRunner)