SPARQL examples: Difference between revisions

Line 34: Line 34:
PREFIX clbno: <https://clb-lod.wikibase.cloud/prop/novalue/>
PREFIX clbno: <https://clb-lod.wikibase.cloud/prop/novalue/>


select ?marc_creator_prop ?marc_creator_role_label (count(?bibItem) as ?number_of_creator_statements)
select ?marc_creator_prop (group_concat(distinct ?marc_code) as ?marc_codes) ?marc_creator_role_label (count(?bibItem) as ?number_of_creator_statements)                        
                         
where {                        
where {
?marc_creator_prop clbdp:P5 clbwb:Q33; wikibase:directClaim ?marc_creator_role; clbdp:P59 ?marc_code; rdfs:label ?marc_creator_role_label .
                         
?marc_creator_prop clbdp:P5 clbwb:Q33; wikibase:directClaim ?marc_creator_role; rdfs:label ?marc_creator_role_label .
   filter (lang(?marc_creator_role_label)="en")
   filter (lang(?marc_creator_role_label)="en")
?bibItem ?marc_creator_role [] .                 
?bibItem ?marc_creator_role [] .                 
}
}
group by ?marc_creator_prop ?marc_creator_role_label ?number_of_creator_statements         
group by ?marc_creator_prop ?marc_codes ?marc_creator_role_label ?number_of_creator_statements         
order by desc(?number_of_creator_statements)
order by desc(?number_of_creator_statements)
</sparql>
</sparql>