I have bulk loaded the wikidata dump using tdbloader2. And now I am trying to make SPARQL queries. A query like this runs very slowly(can not be finished in more than 24 hours), though it works on https://query.wikidata.org/ :
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?item ?property ?itemLabel
WHERE
{
wd:Q5487302 ?property ?item.
?item rdfs:label ?itemLabel.
FILTER(LANG(?itemLabel) = "" || LANG(?itemLabel) = "en").
}
However, this runs pretty fast(less than 5 seconds):
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?item ?property ?itemLabel
WHERE
{
wd:Q5487302 ?property ?item.
}
And this runs fast, too:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?item ?property ?itemLabel
WHERE
{
?item rdfs:label ?itemLabel.
FILTER(LANG(?itemLabel) = "" || LANG(?itemLabel) = "en").
} LIMIT 1000
So I don't know what is wrong with the first query.