Reputation: 37
I would like to get all DISTINCT type value of P31 property for all entities. For example :
Here the query:
SELECT DISTINCT ?item ?itemLabel ?itemDescription
WHERE {
VALUES (?property) {
(wdt:P31)
}
?article schema:about ?item .
SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
}LIMIT 100
Result is an exception timeout :
SPARQL-QUERY: queryStr=SELECT DISTINCT ?item ?itemLabel ?itemDescription
WHERE {
VALUES (?property) {
(wdt:P31)
}
?article schema:about ?item .
SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
}LIMIT 100
java.util.concurrent.TimeoutException
at java.util.concurrent.FutureTask.get(FutureTask.java:205)
at com.bigdata.rdf.sail.webapp.BigdataServlet.submitApiTask(BigdataServlet.java:292)
at com.bigdata.rdf.sail.webapp.QueryServlet.doSparqlQuery(QueryServlet.java:678)
at com.bigdata.rdf.sail.webapp.QueryServlet.doGet(QueryServlet.java:290)
at com.bigdata.rdf.sail.webapp.RESTServlet.doGet(RESTServlet.java:240)
at com.bigdata.rdf.sail.webapp.MultiTenancyServlet.doGet(MultiTenancyServlet.java:273)
Upvotes: 1
Views: 62
Reputation: 37
With the help of the others in question's comments, here the correct query :
SELECT ?type ?typeLabel WHERE {
{
SELECT DISTINCT ?type WHERE { ?item wdt:P31 ?type. }
OFFSET 0 LIMIT 10000
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
}
Use offset for pagignated results.
Upvotes: 1