njh / redstore

RedStore is a lightweight RDF triplestore written in C using the Redland library.
https://www.aelius.com/njh/redstore/
GNU General Public License v3.0
62 stars 6 forks source link

sparql endpoint providing incorrect results #39

Closed ctenolophon closed 13 years ago

ctenolophon commented 13 years ago

Hi,

Finding major differences between redstore's sparql endpoint and roqet (using the same libraries) with:
RedStore/0.5.2 librdf/1.0.14 raptor/2.0.4 rasqal/0.9.27. Here's an example:

I loaded a dataset into the triplestore. If then download it:

$ curl 'http://localhost:8005/data/http://dl.dropbox.com/u/639486/tdwg-rdf/uniprot.rdf?format=rdfxml' > uniprot.rdf

and query with roqet:

$ cat test.sparql            
PREFIX uni: <http://purl.uniprot.org/core/> SELECT * WHERE { ?s uni:scientificName "Bufo" . ?s uni:rank  uni:Genus . }

$ /home/xmal/local/bin/roqet -D uniprot.rdf test.sparql
roqet: Querying from file test.sparql
roqet: Query has a variable bindings result
result: [s=uri<http://purl.uniprot.org/taxonomy/8383>]
roqet: Query returned 1 results

a result is found. However, if I query the triplestore directly:

$ curl -d query='PREFIX uni: <http://purl.uniprot.org/core/> SELECT * WHERE { ?s uni:scientificName "Bufo" . ?s uni:rank uni:Genus . }' http://localhost:8005/sparql
<?xml version="1.0" encoding="utf-8"?>
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
  <head>
    <variable name="s"/>
  </head>
  <results>
  </results>
</sparql>

the result set is empty.

It seems queries with a single triple work fine in the redland triplestore, but not with multiple patterns. In combination with the other issue I reported (http://localhost:8005/data added to graph URI name), I'm afraid I can't use redstore in a public project. But I like redstore a lot! Thanks.

njh commented 13 years ago

I have downloaded your test data, loaded it into a local RedStore instance, but have been unable to reproduce your problem.

I loaded your data set into RedStore:

$ wget http://dl.dropbox.com/u/639486/tdwg-rdf/uniprot.rdf
--2011-10-22 00:30:50--  http://dl.dropbox.com/u/639486/tdwg-rdf/uniprot.rdf
Resolving dl.dropbox.com... 50.19.252.241
Connecting to dl.dropbox.com|50.19.252.241|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3563555 (3.4M) [application/rdf+xml]
Saving to: `uniprot.rdf'

100%[==============================================================>] 3,563,555   1000K/s   in 3.5s    

2011-10-22 00:30:54 (1000 KB/s) - `uniprot.rdf' saved [3563555/3563555]

$ curl -T uniprot.rdf http://localhost:8080/data/uniprot.rdf
Successfully added triples to: http://localhost:8080/data/uniprot.rdf

The result I get is:

$ curl -d query='PREFIX uni: <http://purl.uniprot.org/core/> SELECT * WHERE { ?s uni:scientificName "Bufo" . ?s uni:rank uni:Genus . }' http://localhost:8080/sparql
<?xml version="1.0" encoding="utf-8"?>
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
  <head>
    <variable name="s"/>
  </head>
  <results>
    <result>
      <binding name="s"><uri>http://purl.uniprot.org/taxonomy/8383</uri></binding>
    </result>
  </results>
</sparql>
njh commented 13 years ago

I'm afraid I can't use redstore in a public project.

Not sure what you mean by 'public' but I certainly wouldn't recommend RedStore as the backend to a public website - It has an unthreaded single process for handing requests - won't cope with any kind of load.

ctenolophon commented 13 years ago

Thanks - I was just discovering that redstore was single process. Redstore is great though, and I'll continue to use for small internal projects.

Sorry the result I got is not reproducible. I imagine it may disappear for me with a rebuild of a later libs.

njh commented 12 years ago

Glad you like it - my primary goal was to make a triplestore that you can get up and running quickly and easily.

Does the test suite pass for you ('make check')? If it does pass but SPARQL querying is failing, then I need to add a new test.

New release coming very soon...