Beispiel #1
0
  @BeforeClass
  public static void init() throws EngineException {
    // Graph.setCompareIndex(true);
    QuerySolver.definePrefix("c", "http://www.inria.fr/acacia/comma#");

    graph = createGraph(true);
    Load load = Load.create(graph);

    load.load(data + "engine/ontology/test.rdfs");
    load.load(data + "engine/data/test.rdf");

    try {
      load.loadWE(data + "engine/rule/test2.brul");
      load.load(new FileInputStream(data + "engine/rule/meta.brul"), "meta.brul");
    } catch (LoadException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (FileNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    fengine = load.getRuleEngine();
    fengine.setSpeedUp(true);

    QueryProcess exec = QueryProcess.create(graph);
    rengine = Engine.create(exec);

    rengine.load(data + "engine/rule/test2.brul");
    rengine.load(data + "engine/rule/meta.brul");
  }
Beispiel #2
0
  public Graph testRuleOpt() throws LoadException, EngineException {
    RuleEngine re = testRules();
    Graph g = re.getRDFGraph();

    re.setSpeedUp(true);
    System.out.println("Graph: " + g.size());
    Date d1 = new Date();
    re.process();
    Date d2 = new Date();
    System.out.println("** Time opt: " + (d2.getTime() - d1.getTime()) / (1000.0));
    validate(g, 37735);

    assertEquals(54028, g.size());
    return g;
  }