We are having a PHP application that is heavily using a dockerized version of Virtuoso and is working fine (A complete Drupal website storing and retrieving data constantly from the endpoint).
We have a problem which is VERY weird and we have come across it only now after 5 years of using the endpoint.

We are using a simple query to test the write permission, mainly we write a simple triple and delete it. We are using the following:
```SPARQL
 WITH <http://example.com/id/rdf_entity_21092>
 INSERT { <http://example.com/id/rdf_entity_21092> <http://example.com/predicate> "test value" }
 CLEAR GRAPH <http://example.com/id/rdf_entity_21092>
```

The problem is that it works fine most of the times but there was this one case where we cannot really query or delete the triple.

The following is a list of queries we ran:
```
SQL> sparql select * where { ?s ?p "test value" };
s                                                                                 p
LONG VARCHAR                                                                      LONG VARCHAR
_______________________________________________________________________________

http://example.com/id/rdf_entity_21092                                            http://example.com/predicate
```
The query searches directly for the triples with the "test value" and returns results.

```
1 Rows. -- 3 msec.
SQL> sparql delete where { graph ?g { ?s ?p "test value" } };

Done. -- 4 msec.
```
The query seems to be able to delete the quad (using the web version, we get "Successfully deleted 1 triple".

```
SQL> sparql select * where { ?s ?p "test value" };
s                                                                                 p
LONG VARCHAR                                                                      LONG VARCHAR
_______________________________________________________________________________

http://example.com/id/rdf_entity_21092                                            http://example.com/predicate

1 Rows. -- 0 msec.
```
We still get results.

```
SQL> sparql delete where { graph ?g { <http://example.com/id/rdf_entity_21092> ?p ?o } };

Done. -- 1 msec.
```
Trying to delete using the subject
```
SQL> sparql select * where { ?s ?p "test value" };
s                                                                                 p
LONG VARCHAR                                                                      LONG VARCHAR
_______________________________________________________________________________

http://example.com/id/rdf_entity_21092                                            http://example.com/predicate

1 Rows. -- 0 msec.
```
Still getting results.

And the weirdest part is that the following query bring 0 results even though the subject is correct.
```
SQL> sparql select * where { <http://example.com/id/rdf_entity_21092> ?p ?o };
p                                                                                 o
LONG VARCHAR                                                                      LONG VARCHAR
_______________________________________________________________________________


0 Rows. -- 1 msec.
```

Triple with string value cannot be deleted
This is a GitHub Issue
repo:virtuoso-opensource
owner:openlink
Title : Triple with string value cannot be deleted
Issue date:

--- start body ---
We are having a PHP application that is heavily using a dockerized version of Virtuoso and is working fine (A complete Drupal website storing and retrieving data constantly from the endpoint).
We have a problem which is VERY weird and we have come across it only now after 5 years of using the endpoint.

We are using a simple query to test the write permission, mainly we write a simple triple and delete it. We are using the following:
```SPARQL
 WITH <http://example.com/id/rdf_entity_21092>
 INSERT { <http://example.com/id/rdf_entity_21092> <http://example.com/predicate> "test value" }
 CLEAR GRAPH <http://example.com/id/rdf_entity_21092>
```

The problem is that it works fine most of the times but there was this one case where we cannot really query or delete the triple.

The following is a list of queries we ran:
```
SQL> sparql select * where { ?s ?p "test value" };
s                                                                                 p
LONG VARCHAR                                                                      LONG VARCHAR
_______________________________________________________________________________

http://example.com/id/rdf_entity_21092                                            http://example.com/predicate
```
The query searches directly for the triples with the "test value" and returns results.

```
1 Rows. -- 3 msec.
SQL> sparql delete where { graph ?g { ?s ?p "test value" } };

Done. -- 4 msec.
```
The query seems to be able to delete the quad (using the web version, we get "Successfully deleted 1 triple".

```
SQL> sparql select * where { ?s ?p "test value" };
s                                                                                 p
LONG VARCHAR                                                                      LONG VARCHAR
_______________________________________________________________________________

http://example.com/id/rdf_entity_21092                                            http://example.com/predicate

1 Rows. -- 0 msec.
```
We still get results.

```
SQL> sparql delete where { graph ?g { <http://example.com/id/rdf_entity_21092> ?p ?o } };

Done. -- 1 msec.
```
Trying to delete using the subject
```
SQL> sparql select * where { ?s ?p "test value" };
s                                                                                 p
LONG VARCHAR                                                                      LONG VARCHAR
_______________________________________________________________________________

http://example.com/id/rdf_entity_21092                                            http://example.com/predicate

1 Rows. -- 0 msec.
```
Still getting results.

And the weirdest part is that the following query bring 0 results even though the subject is correct.
```
SQL> sparql select * where { <http://example.com/id/rdf_entity_21092> ?p ?o };
p                                                                                 o
LONG VARCHAR                                                                      LONG VARCHAR
_______________________________________________________________________________


0 Rows. -- 1 msec.
```

--- end body ---
