Package com.complexible.stardog.api

Examples of com.complexible.stardog.api.SelectQuery


   */
  public <T> List<T> query(String sparql, Map<String, Object> args, RowMapper<T> mapper) {
    Connection connection = dataSource.getConnection();
    TupleQueryResult result = null;
    try {
      SelectQuery query = connection.select(sparql);
     
      if (args != null) {
        for (Entry<String, Object> arg : args.entrySet()) {          
          query.parameter(arg.getKey(), arg.getValue());
        }
      }
     
      ArrayList<T> list = new ArrayList<T>();
     
      result = query.execute();
     
      // return empty lists for empty queries
      if (result == null) {
        return list;
      }
View Full Code Here


   */
  public <T> T queryForObject(String sparql, Map<String, Object> args, RowMapper<T> mapper) {
    Connection connection = dataSource.getConnection();
    TupleQueryResult result = null;
    try {
      SelectQuery query = connection.select(sparql);
     
      if (args != null) {
        for (Entry<String, Object> arg : args.entrySet()) {    
          query.parameter(arg.getKey(), arg.getValue());
        }
      }
     
      result = query.execute();
      T returnObject = null;
      // return null; for empty queries
      if (result == null) {
        return returnObject;
      }
View Full Code Here

TOP

Related Classes of com.complexible.stardog.api.SelectQuery

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.