Package lupos.engine.evaluators

Examples of lupos.engine.evaluators.MemoryIndexQueryEvaluator


   * @param args
   */
  public static void main(String[] args) {
    try {
      LiteralFactory.setType(LiteralFactory.MapType.HASHMAP);
      MemoryIndexQueryEvaluator evaluator = new MemoryIndexQueryEvaluator();
      evaluator.prepareInputData(new LinkedList<URILiteral>(), new LinkedList<URILiteral>());
      TestRDF3XEngine.test(evaluator);
    } catch (Exception e) {
      System.err.println(e);
      e.printStackTrace();
    }
View Full Code Here


    this.query = query;
  }

  public QueryResult query() {
    try {
      MemoryIndexQueryEvaluator evaluator = new MemoryIndexQueryEvaluator();
      evaluator.prepareInputData(new LinkedList<URILiteral>(),
          new LinkedList<URILiteral>());
      /**
       * Query database
       */
      QueryResult qr = evaluator.getResult(this.query);
      return qr;
    } catch (Exception e) {
      System.out
          .println("Connection to database could not be established.");
      e.printStackTrace();
View Full Code Here

  public static void main(final String[] args) {
    try {
     
      // set up parameters of evaluators and initialize the evaluators...
      final MemoryIndexQueryEvaluator evaluator = new MemoryIndexQueryEvaluator();
      evaluator.setupArguments();
      evaluator.getArgs().set("result", QueryResult.TYPE.MEMORY);
      evaluator.getArgs().set("codemap", LiteralFactory.MapType.TRIEMAP);
      evaluator.getArgs().set("distinct",CommonCoreQueryEvaluator.DISTINCT.HASHSET);
      evaluator.getArgs().set("join",CommonCoreQueryEvaluator.JOIN.HASHMAPINDEX);
      evaluator.getArgs().set("optional",CommonCoreQueryEvaluator.JOIN.HASHMAPINDEX);
      evaluator.getArgs().set("datastructure",Indices.DATA_STRUCT.HASHMAP);
      evaluator.init();
      final BasicIndexRuleEvaluator rifEvaluator = new BasicIndexRuleEvaluator(evaluator);
     
      LinkedList<URILiteral> dataIRIs=new LinkedList<URILiteral>();
      dataIRIs.add(LiteralFactory.createStringURILiteral("<inlinedata:"+data+">"));
      rifEvaluator.prepareInputData(dataIRIs, new LinkedList<URILiteral>());
View Full Code Here

  private CommonCoreQueryEvaluator evaluator;

  @Before
  public void setUp() throws Exception {
    super.setUp();
    MemoryIndexQueryEvaluator memoryIndexQueryEvaluator = new MemoryIndexQueryEvaluator();
    memoryIndexQueryEvaluator.setupArguments();
    memoryIndexQueryEvaluator.getArgs().set("result", QueryResult.TYPE.MEMORY);
    memoryIndexQueryEvaluator.getArgs().set("codemap", LiteralFactory.MapType.TRIEMAP);
    memoryIndexQueryEvaluator.getArgs().set("distinct", CommonCoreQueryEvaluator.DISTINCT.HASHSET);
    memoryIndexQueryEvaluator.getArgs().set("join",CommonCoreQueryEvaluator.JOIN.HASHMAPINDEX);
    memoryIndexQueryEvaluator.getArgs().set("optional",CommonCoreQueryEvaluator.JOIN.HASHMAPINDEX);
    memoryIndexQueryEvaluator.getArgs().set("type", "Turtle");
    memoryIndexQueryEvaluator.getArgs().set("datastructure", Indices.DATA_STRUCT.HASHMAP);

    BasicIndexRuleEvaluator basicIndexRuleEvaluator = new BasicIndexRuleEvaluator(memoryIndexQueryEvaluator);
    basicIndexRuleEvaluator.prepareInputData("../gui/src/main/resources/data/sp2b_demo.n3");
    evaluator = basicIndexRuleEvaluator.getEvaluator();
View Full Code Here

   * @return
   */
  private BasicIndexRuleEvaluator initAndGetEvaluator(String ontology) {
    try {
      // set up parameters of evaluators and initialize the evaluators...
      final MemoryIndexQueryEvaluator evaluator = new MemoryIndexQueryEvaluator();
      evaluator.setupArguments();
      evaluator.getArgs().set("type", "Turtle");
      evaluator.getArgs().set("result", QueryResult.TYPE.MEMORY);
      evaluator.getArgs().set("codemap", LiteralFactory.MapType.TRIEMAP);
      evaluator.getArgs().set("distinct",
          CommonCoreQueryEvaluator.DISTINCT.HASHSET);
      evaluator.getArgs().set("join",
          CommonCoreQueryEvaluator.JOIN.HASHMAPINDEX);
      evaluator.getArgs().set("optional",
          CommonCoreQueryEvaluator.JOIN.HASHMAPINDEX);
      evaluator.getArgs().set("datastructure",
          Indices.DATA_STRUCT.HASHMAP);
      evaluator.init();

      LinkedList<URILiteral> dataIRIs = new LinkedList<URILiteral>();

      dataIRIs.add(LiteralFactory.createStringURILiteral("<inlinedata:"
          + ontology + ">"));
View Full Code Here

   * @param stream if stream is true the rule evaluator for streams is used, otherwise the main memory evaluator
   * @throws Exception
   */
  public BasicIndexRuleEvaluator(final boolean stream) throws Exception{
    super();
    this.evaluator = (stream)? new StreamQueryEvaluator(): new MemoryIndexQueryEvaluator();
    this.evaluator.setupArguments();
    this.evaluator.getArgs().set("debug", DEBUG.ALL);
    this.evaluator.getArgs().set("result", QueryResult.TYPE.MEMORY);
    this.evaluator.getArgs().set("codemap", LiteralFactory.MapType.HASHMAP);
    this.evaluator.getArgs().set("distinct", CommonCoreQueryEvaluator.DISTINCT.HASHSET);
View Full Code Here

TOP

Related Classes of lupos.engine.evaluators.MemoryIndexQueryEvaluator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.