Package org.apache.jena.larq

Examples of org.apache.jena.larq.IndexBuilderSubject


    }
   
    static IndexLARQ buildSubjectTitleIndex(Model model, String datafile)
    {
        // ---- Read and index just the title strings.
        IndexBuilderSubject larqBuilder = new IndexBuilderSubject(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_larq_2()
    { runTestScript("larq-q-2.rq", "data-1.ttl", "results-2.srj", new IndexBuilderString(DC.title)) ; }

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

    @Override
    protected void exec()
    {
        // ---- Read and index all literal strings.
        IndexBuilderModel larqBuilder =
            indexSubjects ? new IndexBuilderSubject(modIndex.getIndexWriter()) :
                            new IndexBuilderString(modIndex.getIndexWriter()) ;
        if ( allow_duplicates ) larqBuilder.setAvoidDuplicates(false) ;
        Dataset ds = modDataset.getDataset() ;
        index(larqBuilder, ds.getDefaultModel()) ;
        for ( Iterator<String> iter = ds.listNames() ; iter.hasNext() ; )
View Full Code Here

    }
   
    static IndexLARQ buildSubjectTitleIndex(Model model, String datafile)
    {
        // ---- Read and index just the title strings.
        IndexBuilderSubject larqBuilder = new IndexBuilderSubject(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

    }
   
    static IndexLARQ buildSubjectTitleIndex(Model model, String datafile)
    {
        // ---- Read and index just the title strings.
        IndexBuilderSubject larqBuilder = new IndexBuilderSubject(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

TOP

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

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.