Sample queries: Difference between revisions

From Black Bibliography Project
Jump to navigation Jump to search
Line 1: Line 1:
Until we can update the Query Service to include our own sample queries, let's list those here...
Until we can update the Query Service to include our own sample queries, let's list those here...


= Sample queries =


== Instance count ==
== Instance count ==

Revision as of 20:33, 10 November 2019

Until we can update the Query Service to include our own sample queries, let's list those here...


Instance count

To get an overview of what's in the BBP, the following query will return a count of all of the different instances, such as works, people, and places.

SELECT ?typeLabel (count(distinct ?x) as ?count)
WHERE
{
  ?x wdt:P8 ?type .
  ?type rdfs:label ?typeLabel.
  FILTER((LANG(?typeLabel)) = "en")
}
group by ?type ?typeLabel
order by desc(?count)

Try it out!