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

Examples of com.hp.hpl.jena.query.larq.IndexLARQ


        System.out.println("ARQ Example: "+Utils.classShortName(ExLucene1.class)) ;
        System.out.println("ARQ: "+ARQ.VERSION) ;
        System.out.println() ;
       
        Model model = ModelFactory.createDefaultModel() ;
        IndexLARQ index = buildIndex(model,  "testing/LARQ/data-1.ttl") ;
       
        // Search for
        String searchString = "+document" ;
       
        String queryString = StrUtils.strjoin("\n",
            "PREFIX xsd:    <http://www.w3.org/2001/XMLSchema#>" ,
            "PREFIX :       <http://example/>" ,
            "PREFIX pf:     <http://jena.hpl.hp.com/ARQ/property#>",
            "SELECT * {" ,
            "    ?lit pf:textMatch '"+searchString+"'.",
            "}") ;
       
        // Two of three docuemnts should match.
        performQuery(model, index, queryString) ;
        index.close() ;
    }
View Full Code Here


        // ---- Finish indexing
        larqBuilder.closeWriter() ;
        model.unregister(larqBuilder) ;
       
        // ---- Create the access index 
        IndexLARQ index = larqBuilder.getIndex() ;
        return index ;
    }
View Full Code Here

        System.out.println("ARQ Example: "+Utils.classShortName(ExLucene3.class)) ;
        System.out.println("ARQ: "+ARQ.VERSION) ;
        System.out.println() ;
       
        Model model = ModelFactory.createDefaultModel() ;
        IndexLARQ index = buildTitleIndex(model,  "testing/LARQ/data-1.ttl") ;
       
        // Search for string
        String searchString = "+document" ;
       
        // This time, find documents with a matching DC title.
        String queryString = StrUtils.strjoin("\n",
            "PREFIX xsd:    <http://www.w3.org/2001/XMLSchema#>" ,
            "PREFIX :       <http://example/>" ,
            "PREFIX pf:     <http://jena.hpl.hp.com/ARQ/property#>",
            "PREFIX  dc:    <http://purl.org/dc/elements/1.1/>",
            "SELECT ?title {" ,
            "    ?title pf:textMatch '"+searchString+"'.",
            "}") ;
       
        // Two of three docuemnts should match.
        ExLucene1.performQuery(model, index, queryString) ;
        index.close() ;
    }
View Full Code Here

        // ---- Finish indexing
        larqBuilder.closeWriter() ;
        model.unregister(larqBuilder) ;
       
        // ---- Create the access index 
        IndexLARQ index = larqBuilder.getIndex() ;
        return index ;
    }
View Full Code Here

        System.out.println("ARQ Example: "+Utils.classShortName(ExLucene2.class)) ;
        System.out.println("ARQ: "+ARQ.VERSION) ;
        System.out.println() ;
       
        Model model = ModelFactory.createDefaultModel() ;
        IndexLARQ index = ExLucene1.buildIndex(model,  "testing/LARQ/data-1.ttl") ;
       
        // Search for string
        String searchString = "+document" ;
       
        // This time, find documents with a matching DC title.
        String queryString = StrUtils.strjoin("\n",
            "PREFIX xsd:    <http://www.w3.org/2001/XMLSchema#>" ,
            "PREFIX :       <http://example/>" ,
            "PREFIX pf:     <http://jena.hpl.hp.com/ARQ/property#>",
            "PREFIX  dc:    <http://purl.org/dc/elements/1.1/>",
            "SELECT ?doc ?title {" ,
            "    ?title pf:textMatch '"+searchString+"'.",
            "    ?doc   dc:title ?title",
            "}") ;
       
        // Two of three documents should match.
        ExLucene1.performQuery(model, index, queryString) ;
        index.close() ;
    }
View Full Code Here

        System.out.println("ARQ Example: "+Utils.classShortName(ExLucene4.class)) ;
        System.out.println("ARQ: "+ARQ.VERSION) ;
        System.out.println() ;
       
        Model model = ModelFactory.createDefaultModel() ;
        IndexLARQ index = buildSubjectTitleIndex(model,  "testing/LARQ/data-1.ttl") ;
       
        // Search for string
        String searchString = "+document" ;
       
        // This time, find documents with a matching DC title.
        String queryString = StrUtils.strjoin("\n",
            "PREFIX xsd:    <http://www.w3.org/2001/XMLSchema#>" ,
            "PREFIX :       <http://example/>" ,
            "PREFIX pf:     <http://jena.hpl.hp.com/ARQ/property#>",
            "PREFIX  dc:    <http://purl.org/dc/elements/1.1/>",
            "SELECT ?doc {" ,
            "    ?doc pf:textMatch '"+searchString+"'.",
            "}") ;
       
        // Two of three docuemnts should match.
        ExLucene1.performQuery(model, index, queryString) ;
        index.close() ;
    }
View Full Code Here

        // ---- Finish indexing
        larqBuilder.closeWriter() ;
        model.unregister(larqBuilder) ;
       
        // ---- Create the access index 
        IndexLARQ index = larqBuilder.getIndex() ;
        return index ;
    }
View Full Code Here

        System.out.println("ARQ: "+ARQ.VERSION) ;
        System.out.println() ;
       
        Model model = ModelFactory.createDefaultModel() ;

        IndexLARQ index = buildIndexExternalContent(model) ;
       
        // Search for string
        String searchString = "+document" ;
       
        // This time, find documents with a matching DC title.
        String queryString = StrUtils.strjoin("\n",
            "PREFIX pf:     <http://jena.hpl.hp.com/ARQ/property#>",
            "SELECT ?doc {" ,
            "    ?doc pf:textMatch '"+searchString+"'.",
            "}") ;
       
        // Two of three docuemnts should match.
        ExLucene1.performQuery(model, index, queryString) ;
        index.close() ;
    }
View Full Code Here

        // Note that the model is untouched - the index exists outside of any model statements.
        // The application is responsible for keeping
        // ----
       
        larqBuilder.closeWriter() ;
        IndexLARQ index = larqBuilder.getIndex() ;
       
//        NodeIterator iter = index.searchModelByIndex(model, "document") ;
//        for ( ; iter.hasNext() ; )
//            System.out.println("Found: "+FmtUtils.stringForRDFNode((RDFNode)iter.next())) ;
       
View Full Code Here

        Map<String,List<RelatedKeyword>> relatedKeywordsMap = new HashMap<String,List<RelatedKeyword>>();
        if (ontologyURI != null && !ontologyURI.trim().isEmpty()) {
            List<RelatedKeyword> relatedKeywords = new ArrayList<RelatedKeyword>();
            // index of the search model is obtained and checked
            indexOntology(ontologyURI);
            IndexLARQ index = userGraphIndexBuilder.getIndex();

            // classes
            logger.debug("Processing classes for related keywords");
            Query query = QueryFactory.getClassQuery(keyword);
            QueryExecution classQExec = QueryExecutionFactory.create(query, userOntology);
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.query.larq.IndexLARQ

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.