Anonymous

SPARQL examples: Difference between revisions

From clb-lod
Line 45: Line 45:


== Creators ==
== Creators ==
=== Creators in CLB-LOD ===
<sparql tryit="1">
PREFIX clbwb: <https://clb-lod.wikibase.cloud/entity/>
PREFIX clbdp: <https://clb-lod.wikibase.cloud/prop/direct/>
PREFIX clbp: <https://clb-lod.wikibase.cloud/prop/>
PREFIX clbps: <https://clb-lod.wikibase.cloud/prop/statement/>
PREFIX clbpq: <https://clb-lod.wikibase.cloud/prop/qualifier/>
PREFIX clbpr: <https://clb-lod.wikibase.cloud/prop/reference/>
PREFIX clbno: <https://clb-lod.wikibase.cloud/prop/novalue/>
select ?wikibase_item ?label
  (iri(concat("http://www.wikidata.org/entity/",?wikidata)) as ?wikidata_link)
  (iri(concat("https://aleph.nkp.cz/F/?func=find-c&local_base=aut&ccl_term=ica=",?nkcr)) as ?nkcr_link)
  (count(?bibitem) as ?author_roles)
     
where {
  ?wikibase_item clbdp:P5 clbwb:Q5; rdfs:label ?label. filter (lang(?label)="en")
  ?wikibase_item clbdp:P8 ?nkcr .
  optional {?wikibase_item clbdp:P1 ?wikidata .}
  optional {?bibitem clbdp:P12 ?wikibase_item .}
 
} group by ?wikibase_item ?label ?nkcr ?wikidata ?author_roles order by desc(?author_roles)
</sparql>
=== Distribution of MARC creator roles ===
=== Distribution of MARC creator roles ===
This will list MARC creator roles existing in the data, and number of creator statements.
This will list MARC creator roles existing in the data, and number of creator statements.
<sparql tryit="1">
<sparql tryit="1">
Line 70: Line 92:
order by desc(?number_of_creator_statements)
order by desc(?number_of_creator_statements)
</sparql>
</sparql>
=== How many NKCR creators don't have are not on Wikidata? ===
=== How many NKCR creators don't have are not on Wikidata? ===
This gives the number of NKCR-disambiguated authors not found on Wikidata.
This gives the number of NKCR-disambiguated authors not found on Wikidata.