Package org.apache.jena.larq

Examples of org.apache.jena.larq.IndexBuilderString


    }

    static IndexLARQ buildIndex(Model model, String datafile)
    {
        // ---- Read and index all literal strings.
        IndexBuilderString larqBuilder = new IndexBuilderString() ;
       
        // Index statements as they are added to the model.
        model.register(larqBuilder) ;
       
        // To just build the index, create a model that does not store statements
        // Model model2 = ModelFactory.createModelForGraph(new GraphSink()) ;
       
        FileManager.get().readModel(model, datafile) ;
       
        // ---- Alternatively build the index after the model has been created.
        // larqBuilder.indexStatements(model.listStatements()) ;
       
        // ---- Finish indexing
        larqBuilder.closeWriter() ;
        model.unregister(larqBuilder) ;
       
        // ---- Create the access index 
        IndexLARQ index = larqBuilder.getIndex() ;
        return index ;
    }
View Full Code Here


    }
   
    static IndexLARQ buildTitleIndex(Model model, String datafile)
    {
        // ---- Read and index just the title strings.
        IndexBuilderString larqBuilder = new IndexBuilderString(DC.title) ;
       
        // Index statements as they are added to the model.
        model.register(larqBuilder) ;
       
        // To just build the index, create a model that does not store statements
        // Model model2 = ModelFactory.createModelForGraph(new GraphSink()) ;
       
        FileManager.get().readModel(model, datafile) ;
       
        // ---- Alternatively build the index after the model has been created.
        // larqBuilder.indexStatements(model.listStatements()) ;
       
        // ---- Finish indexing
        larqBuilder.closeWriter() ;
        model.unregister(larqBuilder) ;
       
        // ---- Create the access index 
        IndexLARQ index = larqBuilder.getIndex() ;
        return index ;
    }
View Full Code Here

    @Test
    public void test_concurrent_larq_query() throws ParseException, InterruptedException, ExecutionException {
        endTime = startTime + duration * 1000;
        model = ModelFactory.createDefaultModel();
       
          IndexBuilderString larqBuilder = new IndexBuilderString() ;
          IndexLARQ index = larqBuilder.getIndex() ;
          LARQ.setDefaultIndex(index) ;

        ExecutorService executorService = Executors.newCachedThreadPool()
       
        Future<?>[] future = new Future<?>[numThreads];
View Full Code Here

        Location location = new Location(args[0]);
        Dataset dataset = TDBFactory.createDataset(location);
       
        FSDirectory dir = FSDirectory.open(new File(args[1]));
        IndexWriter indexWriter = IndexWriterFactory.create(dir) ;
        IndexBuilderModel larqBuilder = new IndexBuilderString(indexWriter) ;
       
        Model defaultModel = dataset.getDefaultModel();
        index (larqBuilder, defaultModel);
        for ( Iterator<String> iter = dataset.listNames() ; iter.hasNext() ; ) {
            String g = iter.next() ;
View Full Code Here

        ResultSetFormatter.out(res);
        qe.close();
    }

    public static void index(Model m) {
        IndexBuilderModel larqBuilder = new IndexBuilderString();
        //IndexBuilderModel larqBuilder = new IndexBuilderSubject();
        StmtIterator iter = m.listStatements();
        larqBuilder.indexStatements(iter);
        larqBuilder.closeWriter();

        LARQ.setDefaultIndex(larqBuilder.getIndex());
    }
View Full Code Here

        qe.close() ;
        LARQ.removeDefaultIndex() ;
    }
   
    @Test public void test_larq_1()
    { runTestScript("larq-q-1.rq", "data-1.ttl", "results-1.srj", new IndexBuilderString()) ; }
View Full Code Here

   
    @Test public void test_larq_1()
    { runTestScript("larq-q-1.rq", "data-1.ttl", "results-1.srj", new IndexBuilderString()) ; }

    @Test public void test_larq_2()
    { runTestScript("larq-q-2.rq", "data-1.ttl", "results-2.srj", new IndexBuilderString(DC.title)) ; }
View Full Code Here

    @Test public void test_larq_3()
    { runTestScript("larq-q-3.rq", "data-1.ttl", "results-3.srj", new IndexBuilderSubject(DC.title)) ; }
   
    @Test public void test_larq_4()
    { runTestScript("larq-q-4.rq", "data-1.ttl", "results-4.srj", new IndexBuilderString()) ; }
View Full Code Here

   
    @Test public void test_larq_4()
    { runTestScript("larq-q-4.rq", "data-1.ttl", "results-4.srj", new IndexBuilderString()) ; }
   
    @Test public void test_larq_5()
    { runTestScript("larq-q-5.rq", "data-1.ttl", "results-5.srj", new IndexBuilderString()) ; }
View Full Code Here

   
    @Test public void test_larq_5()
    { runTestScript("larq-q-5.rq", "data-1.ttl", "results-5.srj", new IndexBuilderString()) ; }

    @Test public void test_larq_6()
    { runTestScript("larq-q-6.rq", "data-1.ttl", "results-6.srj", new IndexBuilderString()) ; }
View Full Code Here

TOP

Related Classes of org.apache.jena.larq.IndexBuilderString

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.