Package org.openrdf.sesame.query

Examples of org.openrdf.sesame.query.QueryResultsTable


    }

   
    SortedSet<ContextDate> contexts = new TreeSet<ContextDate>();
   
    QueryResultsTable qrt = SesameWrapper.performTableQuery(inGraph, QueryLanguage.SERQL, RDFQuery.RDFQ_GET_SORTED_CONTEXTS.toString());
   
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
   
    for(int i = 0; i < qrt.getRowCount(); i++) {
      Value context = qrt.getValue(i, 0);
      Value date = qrt.getValue(i, 1);
     
      Date d;
      try {
        synchronized(sdf){
          d = sdf.parse(((Literal)date).getLabel());
View Full Code Here


    FreqType ftype = FreqType.valueOf(service.toUpperCase());
   
          
    String squery = RDFQuery.RDFQ_FREQ_CONCEPTS.toString(_user, ftype.getQuery());
    QueryResultsTable res = SesameWrapper.performTableQuery(Repository.MAIN_REPOSITORY.getLocalRepository(),
                                QueryLanguage.SERQL,
                                squery);
   
    SortedSet<ConceptUsage> concepts = ftype.getConcepts(res, type, limit);
   
View Full Code Here

   * @param query
   * @return
   */
  public static QueryResultsTable performTableQuery(LocalRepository repository, QueryLanguage queryLanguage, String query) {
   
    QueryResultsTable queryResultsTable = null;
   
    try {
      queryResultsTable = repository.performTableQuery(queryLanguage, query);
    } catch (IOException e) {
      Repository.logger.severe(e.toString());
View Full Code Here

   * @param queryLanguage
   * @param query
   * @return
   */
  public static Value[] performVectorQuery(LocalRepository repository, QueryLanguage queryLanguage, String query) {
    QueryResultsTable results = SesameWrapper.performTableQuery(repository, queryLanguage, query);
    Value[] asUris;
   
    if(results != null) {
      asUris  = new Value[results.getRowCount()];
      for(int i = 0; i < results.getRowCount(); i++) {
        asUris[i] = results.getValue(i, 0);
      }   
    }else
      asUris = new Value[0];
   
    return asUris;
View Full Code Here

      rep.addData (url, null, RDFFormat.RDFXML, false, _report);

      // execute query

      QueryResultsTable result = rep.performTableQuery(null, query);

      System.out.println("result.getRowCount = " + result.getRowCount());

  }
  catch (AccessDeniedException ade)
  {
      System.out.println("Access denied.");
View Full Code Here

      File dataFile = new File ("virtuoso_driver/data.nt");
      rep.addData (dataFile, null, RDFFormat.NTRIPLES, false, _report);

      // execute query

      QueryResultsTable result = rep.performTableQuery(null, query);

      System.out.println("result.getRowCount = " + result.getRowCount());

  }
  catch (AccessDeniedException ade)
  {
      System.out.println("Access denied.");
View Full Code Here

      // TEST 1
      File dataFile = new File("virtuoso_driver/data.nt");
      System.out.println("TEST 1: Loading file " + dataFile.getAbsolutePath() + " ...");
      rep.addData(dataFile, "http://localhost/", RDFFormat.NTRIPLES, false, _report);
      String query = "SELECT ?s ?p ?o from <sesame> WHERE { ?s ?p ?o }";
      QueryResultsTable result = rep.performTableQuery(null, query);
      System.out.println("TEST 1: Passed = " + (result.getRowCount() > 0));

      // TEST 2
      System.out.println("TEST 2: Clearing repository ...");
      rep.clear(_report);
      query = "SELECT ?s ?p ?o from <sesame> WHERE { ?s ?p ?o }";
      result = rep.performTableQuery(null, query);
      System.out.println("TEST 2: Passed = " + (result.getRowCount() == 0));

      // TEST 3
      URL url = new URL("http://overdogg.com/rdf/requests/1"); //("http://demo.openlinksw.com/dataspace/person/demo#this");
      System.out.println("TEST 3: Loading remote file: " + url.toString() + " ...");
      rep.addData(url, "http://localhost/", RDFFormat.RDFXML, false, _report);
      // execute query
      query = "SELECT ?s ?p ?o from <sesame> WHERE { ?s ?p ?o }";
      result = rep.performTableQuery(null, query);
      System.out.println("TEST 3: Passed = " + (result.getRowCount() > 0));

      // TEST 4
      NamespaceIterator nss = rep.getNamespaces();
      System.out.println("TEST 4: Passed = " + nss.hasNext());
  }
View Full Code Here

TOP

Related Classes of org.openrdf.sesame.query.QueryResultsTable

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.