As I understand it the only way to query for a reference is to use the hash of said reference (example below)
```
SELECT ?s WHERE {?s prov:wasDerivedFrom wdref:7b7e7e8cce78cd60ee82a71ffa3dc6b063a9d37c}
```
Would it be possible to create a service that could create this hash from another query?
The creation of the hash can be found in the DataModel component https://github.com/wmde/WikibaseDataModel
My usecase for this is running the following query that lists all instance of language version of wikipedia
```
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
SELECT ?wiki ?wikiLabel WHERE {
?wiki wdt:P31 wd:Q10876391 .
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
}
}
```
And then be able to get hashes from these and look for statements that are references using P143 -> (item id from the first query)
As I said I have no idea if this is possible so this ticket is a proposal / question as to if it can be done!