Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLEAR GRAPH not necessarily cleared for all SPARQL queries #316

Closed
fgiasson opened this issue Jan 28, 2015 · 6 comments
Closed

CLEAR GRAPH not necessarily cleared for all SPARQL queries #316

fgiasson opened this issue Jan 28, 2015 · 6 comments

Comments

@fgiasson
Copy link

@HughWilliams, @iv-an-ru,

I am having a really weird issue with my Virtuoso 7 instance. It is using the latest Dev branch code, but I am wondering if the index is not somehow broken.

I did import a dataset using DB.DBA.TTLP_MT.

Then I cleared it using the following SPARQL Update query:

sparql clear graph <http://localhost/datasets/test/>;

Then I ran that query:

sparql
select count(?s) as ?nb
from <http://localhost/datasets/test/>
where
{
  ?s a ?type.
};

I was expecting to get 0, but I got 16 (the number doesn't matter, what matters is that it is no 0 :) )

Then I tested this other query:

select count(?s) as ?nb
from <http://localhost/datasets/test/>
where
{
  ?s ?p ?type.
}

And then I got 0.

So, if I was using a or not was impacting the query to return results or not (even the first thing I did is to clear the graph!).

This is really weird and totally unexpected and this is why I am wondering if this is not due to a corrupted index or something similar. Is there some procedure I could run to detect/fix issues with an index? Can you reproduce this issue?

@kidehen
Copy link

kidehen commented Jan 28, 2015

On 1/28/15 2:39 PM, Frederick Giasson wrote:

@HughWilliams https://github.com/HughWilliams, @iv-an-ru
https://github.com/iv-an-ru,

I am having a really weird issue with my Virtuoso 7 instance. It is
using the latest Dev branch code, but I am wondering if the index is
not somehow broken.

I did import a dataset using |DB.DBA.TTLP_MT|.

Then I cleared it using the following SPARQL Update query:

|sparql clear graph http://localhost/datasets/test/;
|

Then I ran that query:

|sparql
select count(?s) as ?nb
from http://now.winnipeg.ca/datasets/zoning-parcels/
where
{
?s a ?type.
};
|

I was expecting to get |0|, but I got |16| (the number doesn't matter,
what matters is that it is no |0| :) )

Then I tested this other query:

|select count(?s) as ?nb
from http://now.winnipeg.ca/datasets/zoning-parcels/
where
{
?s ?p ?type.
}
|

And then I got |0|.

So, if I was using |a| or not was impacting the query to return
results or not (even the first thing I did is to clear the graph!).

This is really weird and totally unexpected and this is why I am
wondering if this is not due to a corrupted index or something
similar. Is there some procedure I could run to detect/fix issues with
an index? Can you reproduce this issue?

What happens when you run:

DROP SILENT GRAPH

Regards,

Kingsley Idehen
Founder & CEO
OpenLink Software
Company Web: http://www.openlinksw.com
Personal Weblog 1: http://kidehen.blogspot.com
Personal Weblog 2: http://www.openlinksw.com/blog/~kidehen
Twitter Profile: https://twitter.com/kidehen
Google+ Profile: https://plus.google.com/+KingsleyIdehen/about
LinkedIn Profile: http://www.linkedin.com/in/kidehen
Personal WebID: http://kingsley.idehen.net/dataspace/person/kidehen#this

@fgiasson
Copy link
Author

Hi @kidehen,

I tried that too, but I am getting that error:

SQLState: 22023 Message: SPARUL_DROP() failed: graph <http://localhost/datasets/test/> has not been explicitly created before

Is it necessary to create it in a particular manner?

@kidehen
Copy link

kidehen commented Jan 28, 2015

On 1/28/15 3:35 PM, Frederick Giasson wrote:

Hi @kidehen https://github.com/kidehen,

I tried that too, but I am getting that error:

|SQLState: 22023 Message: SPARUL_DROP() failed: graph http://localhost/datasets/test/ has not been explicitly created before
|

Is it necessary to create it in a particular manner?

No, SILENT should simply stop the aforementioned error occurring i.e.,
don't require that said named graph was explicitly created using CREATE
GRAPH .

Regards,

Kingsley Idehen
Founder & CEO
OpenLink Software
Company Web: http://www.openlinksw.com
Personal Weblog 1: http://kidehen.blogspot.com
Personal Weblog 2: http://www.openlinksw.com/blog/~kidehen
Twitter Profile: https://twitter.com/kidehen
Google+ Profile: https://plus.google.com/+KingsleyIdehen/about
LinkedIn Profile: http://www.linkedin.com/in/kidehen
Personal WebID: http://kingsley.idehen.net/dataspace/person/kidehen#this

@fgiasson
Copy link
Author

@kidehen,

thanks for clarifying for the silent clause. However, exactly the same behavior happens.

Could it be possible that it is because the database comes from a V6 installation (even if I think they are supposedly compatible)?

@fgiasson
Copy link
Author

Another thing I just noticed, the dataset I just dropped still appears in the resultset of that query:

select distinct ?g
where
{
    graph ?g {?s ?p ?o}
}

@fgiasson
Copy link
Author

@kidehen, @HughWilliams,

I exported the datasets, created a new empty V7.1 database, re-imported the datasets in it, and now I cannot reproduce this issue. I think the DB has been corrupted in some ways which was leading to these weird behaviors.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants