KM Wikidata export: Difference between revisions

From Inguma Wikibase
Line 103: Line 103:
}
}
group by ?aipatzen_duena ?wd ?inguma ?title ?data ?wd_egileak ?issue ?sp ?ep ?doi
group by ?aipatzen_duena ?wd ?inguma ?title ?data ?wd_egileak ?issue ?sp ?ep ?doi
</sparql>
= Export OOCC articles (for oocc-to-wikidata.py) =
<sparql tryit="1">
PREFIX iwb: <https://wikibase.inguma.eus/entity/>
PREFIX idp: <https://wikibase.inguma.eus/prop/direct/>
PREFIX ip: <https://wikibase.inguma.eus/prop/>
PREFIX ips: <https://wikibase.inguma.eus/prop/statement/>
PREFIX ipq: <https://wikibase.inguma.eus/prop/qualifier/>
select distinct ?oocc_item ?title (group_concat(distinct concat('"',?sordinal,'": "',?wd_egilea,'"'); SEPARATOR=", ") as ?wd_egileak)
?pag ?oocc ?oocc_wd (count(?citing) as ?citations) (min(?old_date) as ?data) ?wd_container
where { # values ?oocc { iwb:Q40479 iwb:Q40483 iwb:Q40482 iwb:Q40474 iwb:Q40484 iwb:Q40481 iwb:Q40480 iwb:Q40485 iwb:Q40473 iwb:Q40478 iwb:Q40472 iwb:Q40471 iwb:Q40476 iwb:Q40477 }
 
  ?oocc_item idp:P42 ?oocc.
  ?km_item idp:P88* ?oocc_item.
  ?citing idp:P62 ?km_item.
  ?km_item idp:P19 ?old_date.
  ?oocc idp:P1 ?oocc_wd.
  ?oocc_item idp:P19 ?data; ip:P17 ?creator_st.
  optional {?creator_st ips:P17 ?egilea.}
  optional {?creator_st ipq:P36 ?sordinal.}
  ?oocc_item idp:P10 ?title.
  ?oocc_item idp:P42 [idp:P1 ?wd_container].
 
  ?egilea idp:P1 ?wd_egilea.
  # filter not exists {?oocc_item idp:P1 ?wd.}
  optional {?oocc_item idp:P12 ?inguma.}
  optional {?oocc_item idp:P26 ?issue.}
  optional {?oocc_item idp:P80 ?pag.}
}
group by ?oocc_item ?title ?wd_egileak ?pag ?oocc ?oocc_wd ?citations ?data ?wd_container
order by desc(?citations)
</sparql>
</sparql>
Bureaucrats, emailconfirmed, Administrators
58,048

edits