Package com.hp.hpl.jena.query.larq

Examples of com.hp.hpl.jena.query.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

        } else {
            throw new SearchException(String.format("MGraph having URI %s could obtained through TcManager",
                userOntologyURI));
        }
        this.userOntology = userGraph;
        this.userGraphIndexBuilder = new IndexBuilderString(IndexingHelper.HAS_LOCAL_NAME);
        this.userGraphIndexBuilder.indexStatements(userGraph.listStatements());
        // Do not forget to set the default index just before the query execution according to its context
        // LARQ.setDefaultIndex(index);
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.query.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.