Examples of execSelect()


Examples of com.hp.hpl.jena.query.QueryExecution.execSelect()

        String sparqlQueryString = "SELECT (count(*) AS ?count) { ?s ?p ?o }" ;
        // See http://www.openjena.org/ARQ/app_api.html
       
        Query query = QueryFactory.create(sparqlQueryString) ;
        QueryExecution qexec = QueryExecutionFactory.create(query, dataset) ;
        ResultSet results = qexec.execSelect() ;
        ResultSetFormatter.out(results) ;
        qexec.close() ;

        dataset.close();
    }
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execSelect()

                        "   (6 'Saturday'@en)" +
                        "}"
                );
        Model m=ModelFactory.createDefaultModel();
        QueryExecution qe=QueryExecutionFactory.create(q,m);
        ResultSet r=qe.execSelect();
        assertEquals(1,r.getResultVars().size());
        assertEquals("dayName",r.getResultVars().get(0));
        assertTrue(r.hasNext());
        QuerySolution qs=r.nextSolution();
        assertEquals("Sunday",qs.get("dayName").asLiteral().getLexicalForm())
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execSelect()

        try {
            if(null!=bindings) {
                qe.setInitialBinding(bindings);
            }

            ResultSet results=qe.execSelect();
            if(!results.hasNext())
                return null;

            List<String> vars=results.getResultVars();
            if(vars.size()!=1) {
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execSelect()

    }

    public static Map<RDFNode,RDFNode> fetchMap(Dataset m,Query query,QuerySolution bindings) throws Exception {
        QueryExecution qe=QueryExecutionFactory.create(query,m);   
        try {
            ResultSet results=qe.execSelect();
            Map<RDFNode,RDFNode> map=Maps.newHashMap();
            List<String> vars=results.getResultVars();

            while(results.hasNext()) {
                QuerySolution row=results.nextSolution();
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execSelect()

    //

    public static Map<RDFNode,RDFNode> fetchMapSingle(Dataset m,Query query,QuerySolution bindings) throws Exception {
        QueryExecution qe=QueryExecutionFactory.create(query,m);   
        try {
            ResultSet results=qe.execSelect();
            Set<RDFNode> seen=Sets.newHashSet();
            Map<RDFNode,RDFNode> map=Maps.newHashMap();
            List<String> vars=results.getResultVars();

            while(results.hasNext()) {
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execSelect()

    }
   
    Query query = QueryFactory.create(INDIVIDUALS_QUERY);
    QueryExecution qe = QueryExecutionFactory.create(query, ontModel);
   
    ResultSet results = qe.execSelect();
   
    while ( results.hasNext() ) {
     
      String entityUri = null;
      String classUri = null;
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execSelect()

    }
   
    Query query = QueryFactory.create(propertiesQuery);
    QueryExecution qe = QueryExecutionFactory.create(query, ontModel);
   
    ResultSet results = qe.execSelect();
   
    while ( results.hasNext() ) {
     
      String entityUri = null;
      String domainUri = null;
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execSelect()

    }
   
    Query query = QueryFactory.create(CLASSES_QUERY);
    QueryExecution qe = QueryExecutionFactory.create(query, ontModel);
   
    ResultSet results = qe.execSelect();
   
    while ( results.hasNext() ) {
      QuerySolution sol = results.nextSolution();
      Iterator<?> varNames = sol.varNames();
      while ( varNames.hasNext() ) {
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execSelect()

      throw ex;
    }
   
    QueryExecution qe = QueryExecutionFactory.create(query, ontModel);
   
    ResultSet results = qe.execSelect();
   
    while ( results.hasNext() ) {
      QuerySolution sol = results.nextSolution();
      Iterator<?> varNames = sol.varNames();
     
View Full Code Here

Examples of com.hp.hpl.jena.query.QueryExecution.execSelect()

    }
   
    Query query = QueryFactory.create(SKOS_QUERY);
    QueryExecution qe = QueryExecutionFactory.create(query, ontModel);
   
    ResultSet results = qe.execSelect();
   
    while ( results.hasNext() ) {
     
      QuerySolution sol = results.nextSolution();
     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.