garlik/4store — Issue #56: Repeated triples when using CONSTRUCT
Author: philjohn
Created: 2012-01-31 10:54:19+00:00
State: open

As requested by Manuel, I'm opening a new issue for repeated triples seen during CONSTRUCT.

Using the stripped down test triples below:

```
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
```

and the following query:

```
CONSTRUCT {
?p ?o .
?o ?p2 ?o2 .
}
WHERE {
?p ?o .
OPTIONAL {
?o ?p2 ?o2 .
}
}
```
the expected number of triples returned is 16, however, 30 are being returned.

an explain outputs the following:

```
execute: triple(uri, variable(p), variable(o)) DISTINCT LIMIT 998
mmmms (_,_[d772c8df1933543a],?,?) -> 1
1 bindings (2)
execute: triple(variable(o), variable(p2), variable(o2)) DISTINCT LIMIT 998
mmmms (_,?[d5b19b1e8220ff0a],?,?) -> 15
15 bindings (45)
```

It appears that the following triple is emitted multiple times:

```
.
```

- Phil.

Phil.