Sample queries: Difference between revisions

From Black Bibliography Project
Jump to navigation Jump to search
(Created page with "Until we can update the Query Service to include our own sample queries, let's list those here...")
 
No edit summary
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 ==
==== 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. ====
<pre>
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)
</pre>
[http://tinyurl.com/vr66u8a Try it out!]

Revision as of 20:31, 10 November 2019

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


Sample queries

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!