[redland-dev] [Redland Language Bindings 0000555]: librdf_query_results_finished is taking *much* longer than any other call including query execution.

Mantis Bug Tracker mantis-bug-sender at librdf.org
Wed Oct 9 14:47:45 EDT 2013


The following issue has been SUBMITTED. 
====================================================================== 
http://bugs.librdf.org/mantis/view.php?id=555 
====================================================================== 
Reported By:                ericatai
Assigned To:                
====================================================================== 
Project:                    Redland Language Bindings
Issue ID:                   555
Category:                   api
Reproducibility:            always
Severity:                   major
Priority:                   high
Status:                     new
Binding Language (java, perl, php, python, ruby, tcl): php 
====================================================================== 
Date Submitted:             2013-10-09 18:47
Last Modified:              2013-10-09 18:47
====================================================================== 
Summary:                    librdf_query_results_finished is taking *much*
longer than any other call including query execution.
Description: 
Hi folks;

I'm thrilled with the soundness of my results and the progress I'm making using
the PHP bindings.

I was also pleased with the query execution time until I found out how long it
was taking me to process the results.  Should I be surprised that
librdf_query_results_finished is taking between .2 and .5 seconds to execute? 
This would be a show-stopper for us, so I listed this as a major issue.  Please
forgive me if this is due improper use of the software - but I have included the
calling code.

I should mention that our ontology files are large-ish.  librdf_model_size gave
44681.

Thanks!

-Eric

Additional Information: 
Here is the calling code:

  function redlandsQueryForSingleValue($query) {
    $valueURIString = FALSE;

    MyStopWatch::start();
    $results=librdf_model_query_execute($this->redlandRDFModel,
					$query);

    $elapsedTime = MyStopWatch::elapsed();
    //fwrite(STDERR, "Elapsed microtime:  ".$elapsedTime."\n");

    $count=0;
    $queryResultsFinished = librdf_query_results_finished($results);

    $bindingCount = librdf_query_results_get_bindings_count($results);
    
    while($results && !$queryResultsFinished) {
      fwrite(STDERR, "result $count: {\n");
      for ($i=0; $i < $bindingCount; $i++)
	{
	  $val=librdf_query_results_get_binding_value($results, $i);
    
	  if ($val) {
	    $nval=librdf_node_to_string($val);
	    //echo "elpURI1:  ".$nval."\n";  prints angle brackets around>

	    $valueURI = librdf_node_get_uri($val);

	    $valueURIString = librdf_uri_to_string($valueURI);      
	    
	    fwrite(STDERR, "elpURI2:  ".$valueURIString."\n");

	  }
	  else
	    $nval='(unbound)';

	  fwrite(STDERR, "  ".librdf_query_results_get_binding_name($results,
$i)."=".$nval."\n");

          $bindingCount = librdf_query_results_get_bindings_count($results);

	}
      fwrite(STDERR, "}\n");
      
      librdf_query_results_next($results);
      
      $count++;
    $queryResultsFinished = librdf_query_results_finished($results);
      
    }
    if (!$results) $results=null;
      //fwrite(STDERR, "Returned $count results\n");
    

    if ($count > 1) throw new Exception("ERROR:  More than one result was
returned from query ".$query."\n");

    return $valueURIString;
  }
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-10-09 18:47 ericatai       New Issue                                    
======================================================================



More information about the redland-dev mailing list