As an editor I want to query for data based on existence of references.
**Problem:**
We currently don't allow querying for statements with references or without references.
**Example:**
- All items that are instance of human and have date of birth statement without the reference.
**[[ https://www.figma.com/file/hZpaYX0xNNhK0L7kBvN6WK/Query-Builder?node-id=2943%3A0 | mockup ]]**
{F34038170}
**BDD**
GIVEN a visual query
WHEN restricting your condition to statements without references
THEN the output only contains results with statements lacking references for that statement
GIVEN a visual query
WHEN restricting your condition to statements with references
THEN the output only contains results with statements having references for that statement
**Acceptance criteria:**
[ ] Filter for statements with/without references is applied when selected
[ ] Default to "with and without references"
**Open questions:**
**SPARQL example for only with references:**
```
SELECT DISTINCT ?item ?itemLabel ?reference WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
{
SELECT DISTINCT ?item WHERE { ?item p:P31 ?statement.
?statement ps:P31/wdt:P279* wd:Q482994.
FILTER EXISTS { ?statement prov:wasDerivedFrom ?reference. }
}
LIMIT 100
}
}
```