KM Wikidata export: Difference between revisions

From Inguma Wikibase
 
Line 117: Line 117:
</sparql>
</sparql>


= Aldizkarika, zenbat artikuluk aipatzen du KM? =
<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 ?aldizkariaLabel (count(distinct ?aipatzen_duena) as ?zenbat_artikulu)
where {
  ?oocc_item ip:P89 ?oocc_st.
  ?oocc_st ips:P89 ?oocc_id.
  ?oocc_st ipq:P75 ?oocc_text.
  ?oocc_item idp:P10 ?oocc_title.
  ?oocc_item idp:P1 ?wd_cit_xede.
 
  ?aipatzen_duena idp:P62 [idp:P88* ?oocc_item].
  ?aipatzen_duena idp:P19 ?data; idp:P37 ?aldizkaria; idp:P17 [rdfs:label ?egileaLabel]. filter(lang(?egileaLabel)="eu")
  ?aipatzen_duena idp:P1 ?wd_cit_iturri.
  bind(iri(concat(str(wd:),?wd_cit_iturri)) as ?wd_cit_iturri_item)
  bind(iri(concat(str(wd:),?wd_cit_xede)) as ?wd_cit_xede_item)
#  filter not exists {
#  SERVICE <https://query.wikidata.org/sparql> {
#            select ?wd_cit_iturri_item ?wd_cit_xede_item where {?wd_cit_iturri_item wdt:P2860 ?wd_cit_xede_item. } }
#  }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,eu". }
group by ?aldizkariaLabel ?zenbat_artikulu
</sparql>
= Export ASJU articles (for articles-to-wikidata.py) =
= Export ASJU articles (for articles-to-wikidata.py) =
<sparql tryit="1">
<sparql tryit="1">
Line 144: Line 173:
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>
</sparql>
= Export UZTARO articles (for uztaro-to-wikidata.py) =
= Export UZTARO articles (for uztaro-to-wikidata.py) =
UZTARO-ko artikuluen zerrenda, bakoitza Wikidatara bidali izanaren datarekin
UZTARO-ko artikuluen zerrenda, bakoitza Wikidatara bidali izanaren datarekin

Latest revision as of 10:12, 26 November 2024

KM aipatzen duten ASJU artikuluak

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 ?aipatzen_duena  ?title ?data (group_concat(distinct strafter(str(?egilea),str(iwb:))) as ?egileak)
?issue ?sp ?ep
where {
  ?oocc_item ip:P89 ?oocc_st.
    
  ?aipatzen_duena idp:P37 iwb:Q13228; idp:P62 [idp:P88* ?oocc_item].
  filter not exists {?aipatzen_duena idp:P1 ?wd.}
  
  ?aipatzen_duena idp:P19 ?data; idp:P17 ?egilea; idp:P10 ?title. filter(lang(?title)="eu")
  ?aipatzen_duena idp:P20 ?doi.
  optional {?aipatzen_duena idp:P26 ?issue.}
  optional {?aipatzen_duena idp:P27 ?sp.}
  optional {?aipatzen_duena idp:P28 ?ep.}

}  
group by ?aipatzen_duena ?title ?data ?egileak ?issue ?sp ?ep

Try it!

Find Wikidata-article using DOI

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 ?wb_item ?title ?doi ?wd_item ?wd_doi
where {
  
    
   ?wb_item idp:P37 iwb:Q13228; idp:P62 ?cit.
 filter not exists {   ?wb_item idp:P1 ?linked_wd.}
   ?wb_item idp:P19 ?data; idp:P10 ?title. filter(lang(?title)="eu")
  ?wb_item idp:P20 ?doi. bind (ucase(?doi) as ?wd_doi)  
#  bind(iri(concat(str(wd:),?linked_wd)) as ?wd_item)
  SERVICE <https://query.wikidata.org/sparql> {
           select * where
                            {?wd_item wdt:P356 ?wd_doi.
   } }

}     order by ?doi

Try it!

Find Wikidata-creator using ORCID

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 ?wb_item ?title ?doi ?wd_item ?wd_doi
where {
  
    
   ?wb_item idp:P5 iwb:Q5.
 filter not exists {   ?wb_item idp:P1 ?linked_wd.}
   ?wb_item idp:P39 ?orcid.
  
#  bind(iri(concat(str(wd:),?linked_wd)) as ?wd_item)
  SERVICE <https://query.wikidata.org/sparql> {
           select * where
                            {?wd_item wdt:P496 ?orcid.
   } }

}     order by ?orcid

Try it!


Find Wikidata-creator using inguma

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 ?egilea ?egilea_label ?wd ?wikidata ?inguma ?ing_wikidata

where {
  ?oocc_item ip:P89 ?oocc_st.

  ?aipatzen_duena idp:P37 iwb:Q13228; idp:P62 [idp:P88* ?oocc_item].


  ?aipatzen_duena idp:P19 ?data; idp:P17 ?egilea; idp:P10 ?title. filter(lang(?title)="eu")
  ?egilea rdfs:label ?egilea_label. filter(lang(?egilea_label)="en")
  optional {?egilea idp:P3 ?inguma.}
  optional {

   SERVICE <https://query.wikidata.org/sparql> {
           select ?ing_wikidata ?inguma where
                            {?ing_wikidata wdt:P7558 ?inguma.}
   } }
   optional {?egilea idp:P1 ?wd. bind(iri(concat(str(wd:),?wd)) as ?wikidata)}
  
  }

Try it!

Find KM items not linked to OOCC

PREFIX iwb: <https://wikibase.inguma.eus/entity/>
PREFIX idp: <https://wikibase.inguma.eus/prop/direct/>

select ?older ?olderLabel 
where {?aip idp:P62 ?older. ?older idp:P17 iwb:Q201. 
       filter not exists {?older idp:P88 ?oocc .} # exclude items linked to OOCC
       filter not exists {?older idp:P89 ?oocc_id .} # exclude OOCC items themselves
       filter not exists {?contained idp:P42 ?older .} # exclude containers
       
       SERVICE wikibase:label { bd:serviceParam wikibase:language "en,eu". }
      } group by ?older ?olderLabel

Try it!


Aldizkarika, zenbat artikuluk aipatzen du KM?

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 ?aldizkariaLabel (count(distinct ?aipatzen_duena) as ?zenbat_artikulu)
where {
  ?oocc_item ip:P89 ?oocc_st.
  ?oocc_st ips:P89 ?oocc_id.
  ?oocc_st ipq:P75 ?oocc_text.
  ?oocc_item idp:P10 ?oocc_title.
  ?oocc_item idp:P1 ?wd_cit_xede.
  
  ?aipatzen_duena idp:P62 [idp:P88* ?oocc_item].
  ?aipatzen_duena idp:P19 ?data; idp:P37 ?aldizkaria; idp:P17 [rdfs:label ?egileaLabel]. filter(lang(?egileaLabel)="eu")
  ?aipatzen_duena idp:P1 ?wd_cit_iturri. 
  bind(iri(concat(str(wd:),?wd_cit_iturri)) as ?wd_cit_iturri_item)
  bind(iri(concat(str(wd:),?wd_cit_xede)) as ?wd_cit_xede_item)
#   filter not exists {
#   SERVICE <https://query.wikidata.org/sparql> {
#            select ?wd_cit_iturri_item ?wd_cit_xede_item where {?wd_cit_iturri_item wdt:P2860 ?wd_cit_xede_item. } }
#   }
 SERVICE wikibase:label { bd:serviceParam wikibase:language "en,eu". }
}  
group by ?aldizkariaLabel ?zenbat_artikulu

Try it!

Export ASJU articles (for articles-to-wikidata.py)

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 ?aipatzen_duena ?wd ?inguma ?title ?data (group_concat(distinct concat('"',?sordinal,'": "',?wd_egilea,'"'); SEPARATOR=", ") as ?wd_egileak)
?issue ?sp ?ep ?doi
where {
  

  ?aipatzen_duena idp:P37 iwb:Q13228; idp:P62 ?cit.

  ?aipatzen_duena idp:P19 ?data; ip:P17 [ips:P17 ?egilea; ipq:P36 ?sordinal]; idp:P10 ?title. filter(lang(?title)="eu")
  ?aipatzen_duena idp:P20 ?doi.
  ?egilea idp:P1 ?wd_egilea.
  filter not exists {?aipatzen_duena idp:P1 ?wd.}
  optional {?aipatzen_duena idp:P12 ?inguma.}
  optional {?aipatzen_duena idp:P26 ?issue.}
  optional {?aipatzen_duena idp:P27 ?sp.}
  optional {?aipatzen_duena idp:P28 ?ep.}

}
group by ?aipatzen_duena ?wd ?inguma ?title ?data ?wd_egileak ?issue ?sp ?ep ?doi

Try it!


Export UZTARO articles (for uztaro-to-wikidata.py)

UZTARO-ko artikuluen zerrenda, bakoitza Wikidatara bidali izanaren datarekin

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 ?artikulua ?wikidata_item ?wd ?p1guid ?inguma ?title ?data (group_concat(distinct concat('"',?sordinal,'": "',?wd_egilea,'"'); SEPARATOR=", ") as ?wd_egileak)
?issue ?sp ?ep ?doi ?ojs_landing ?pdf ?wd_upload (strafter(str(?ref),"http://www.wikidata.org/reference/") as ?reference)
where {
  

  ?artikulua idp:P37 iwb:Q13091.# ; idp:P59 iwb:Q13367.

  ?artikulua idp:P19 ?data; ip:P17 [ips:P17 ?egilea; ipq:P36 ?sordinal]; idp:P10 ?title. filter(lang(?title)="eu")
  optional {?artikulua idp:P20 ?doi.}
  ?egilea idp:P1 ?wd_egilea.
  optional {?artikulua ip:P1 ?p1guid. ?p1guid ips:P1 ?wd. bind(iri(concat(str(wd:),?wd)) as ?wikidata_item)
            optional {
           SERVICE <https://query.wikidata.org/sparql> {
           select ?wikidata_item ?wd_upload ?ref where {?wikidata_item p:P31 [ps:P31 wd:Q13442814; prov:wasDerivedFrom ?ref]. ?ref pr:P248 wd:Q12259621; pr:P813 ?wd_upload.}
    }
          }
            }
  optional {?artikulua idp:P12 ?inguma.}
  ?artikulua idp:P26 ?issue.
  optional {?artikulua idp:P27 ?sp.}
  optional {?artikulua idp:P28 ?ep.}
  ?artikulua idp:P24 ?ojs_landing.
  ?artikulua idp:P48 ?pdf.
   
}  
group by ?artikulua ?wikidata_item ?wd ?p1guid ?inguma ?title ?data ?wd_egileak ?issue ?sp ?ep ?doi ?ojs_landing ?pdf ?wd_upload ?ref

Try it!


Export OOCC articles (for oocc-to-wikidata.py)

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 (lang(?title) as ?title_lang) ?wd_lang (group_concat(distinct concat('"',?sordinal,'": "',?wd_egilea,'"'); SEPARATOR=", ") as ?wd_egileak)
?pag ?oocc (count(?citing) as ?citations) (min(xsd:integer(?regexdata)) as ?data) ?wd_container ?oocc_wd
where {
  

  ?oocc_item idp:P42 ?oocc.
  ?oocc_item ip:P89 ?oocc_st.
  ?oocc_st ips:P89 ?oocc_id.
  ?oocc_st ipq:P75 ?oocc_text.
  bind(replace(?oocc_text, "(.*)(19[0-9][0-9])(.*)", "$2") as ?regexdata)
  ?km_item idp:P88* ?oocc_item.
  ?citing idp:P62 ?km_item.
  ?km_item idp:P19 ?old_date.
  ?oocc idp:P1 ?wd_container.
  ?oocc_item ip:P17 ?creator_st. 
  optional {?creator_st ips:P17 ?egilea.} 
  optional {?creator_st ipq:P36 ?sordinal.} 
  ?oocc_item idp:P10 ?title.
  ?oocc_item idp:P16 [idp:P1 ?wd_lang].
    
  ?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.}
  optional {?oocc_item idp:P1 ?oocc_wd.}
 
}
group by ?oocc_item ?title ?wd_lang ?wd_egileak ?pag ?oocc  ?citations ?data ?wd_container ?oocc_wd
order by desc(?citations)

Try it!

Export citations (for citation-to-wikidata.py)

Wikidatara exportatzeko aipu-erlazioak

Galdeketa honek Wikidatan oraindik idatzi ez diren aipu-erlazioak zerrendatzen ditu:

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 ?aipatzen_duena ?aipatzen_duenaLabel (group_concat(?egileaLabel; SEPARATOR=", ") as ?egileak) (year(?data) as ?urtea) ?aldizkariaLabel ?oocc_item ?oocc_title ?wd_cit_iturri ?wd_cit_xede
where {
  ?oocc_item ip:P89 ?oocc_st.
  ?oocc_st ips:P89 ?oocc_id.
  ?oocc_st ipq:P75 ?oocc_text.
  ?oocc_item idp:P10 ?oocc_title.
  ?oocc_item idp:P1 ?wd_cit_xede.
  
  ?aipatzen_duena idp:P62 [idp:P88* ?oocc_item].
  ?aipatzen_duena idp:P19 ?data; idp:P37 ?aldizkaria; idp:P17 [rdfs:label ?egileaLabel]. filter(lang(?egileaLabel)="eu")
  ?aipatzen_duena idp:P1 ?wd_cit_iturri. 
  bind(iri(concat(str(wd:),?wd_cit_iturri)) as ?wd_cit_iturri_item)
  bind(iri(concat(str(wd:),?wd_cit_xede)) as ?wd_cit_xede_item)
  filter not exists {
  SERVICE <https://query.wikidata.org/sparql> {
           select ?wd_cit_iturri_item ?wd_cit_xede_item where {?wd_cit_iturri_item wdt:P2860 ?wd_cit_xede_item. } }
  }
 SERVICE wikibase:label { bd:serviceParam wikibase:language "en,eu". }
}  
group by ?aipatzen_duena ?aipatzen_duenaLabel ?egileak ?data ?aldizkariaLabel ?oocc_item ?oocc_id ?oocc_title ?wd_cit_iturri ?wd_cit_xede
order by ?aipatzen_duena

Try it!

Wikidaten idatzitako aipu-erlazioak

Galdeketa honek Wikidatan zitazioak noiz idatzi ditugun erakusten du:

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 ?aipatzen_duena ?aipatzen_duenaLabel (group_concat(distinct ?egileaLabel; SEPARATOR=", ") as ?egileak) (year(?data) as ?urtea) ?aldizkariaLabel ?oocc_item ?oocc_title ?wd_cit_iturri ?wd_cit_xede ?wikidata_upload
where {
  ?oocc_item ip:P89 ?oocc_st.
  ?oocc_st ips:P89 ?oocc_id.
  ?oocc_st ipq:P75 ?oocc_text.
  ?oocc_item idp:P10 ?oocc_title.
  ?oocc_item idp:P1 ?wd_cit_xede.
  
  ?aipatzen_duena idp:P62 [idp:P88* ?oocc_item].
  ?aipatzen_duena idp:P19 ?data; idp:P37 ?aldizkaria; idp:P17 [rdfs:label ?egileaLabel]. filter(lang(?egileaLabel)="eu")
  ?aipatzen_duena idp:P1 ?wd_cit_iturri. 
  bind(iri(concat(str(wd:),?wd_cit_iturri)) as ?wd_cit_iturri_item)
  bind(iri(concat(str(wd:),?wd_cit_xede)) as ?wd_cit_xede_item)
  
  SERVICE <https://query.wikidata.org/sparql> {
           select ?wd_cit_iturri_item ?wd_cit_xede_item ?wikidata_upload where {?wd_cit_iturri_item p:P2860 [ps:P2860 ?wd_cit_xede_item; prov:wasDerivedFrom [pr:P248 wd:Q12259621; pr:P813 ?wikidata_upload]]. } }
  
 SERVICE wikibase:label { bd:serviceParam wikibase:language "en,eu". }
}  
group by ?aipatzen_duena ?aipatzen_duenaLabel ?egileak ?data ?aldizkariaLabel ?oocc_item ?oocc_id ?oocc_title ?wd_cit_iturri ?wd_cit_xede ?wikidata_upload
order by ?aipatzen_duena

Try it!


Aipamena duten argitalpen guztiak Wikidatan daude?

Galdeketa honek galdetzen du KM aipatzen duen lanen bat Wikidatan existitzen ez oten den:

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 ?aipatzen_duena ?aipatzen_duenaLabel (group_concat(?egileaLabel; SEPARATOR=", ") as ?egileak) (year(?data) as ?urtea) ?aldizkariaLabel ?oocc_item ?oocc_title 
where {
  ?oocc_item ip:P89 ?oocc_st.
  ?oocc_st ips:P89 ?oocc_id.
  ?oocc_st ipq:P75 ?oocc_text.
  ?oocc_item idp:P10 ?oocc_title.
  ?oocc_item idp:P1 ?wd_cit_xede.
  
  ?aipatzen_duena idp:P62 [idp:P88* ?oocc_item].
  ?aipatzen_duena idp:P19 ?data; idp:P37 ?aldizkaria; idp:P17 [rdfs:label ?egileaLabel]. filter(lang(?egileaLabel)="eu")
  filter not exists {?aipatzen_duena idp:P1 ?wd_cit_iturri.}
  
 SERVICE wikibase:label { bd:serviceParam wikibase:language "en,eu". }
}  
group by ?aipatzen_duena ?aipatzen_duenaLabel ?egileak ?data ?aldizkariaLabel ?oocc_item ?oocc_id ?oocc_title 
order by ?aipatzen_duena

Try it!