Main Page: Difference between revisions

From KBTestWikibase
Jump to navigation Jump to search
 
(60 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=Test Wikibase instance for the national library of The Netherlands.=
=Unofficial Wikibase sandbox for the national library of The Netherlands.=
==Disclaimer==
''<span style="color:maroon">This Wikibase sandbox is for playing, experimenting, learning about the functionalities, possibilities and limitations etc. of Wikibase, and knowledge sharing activities resulting from these learnings. It is maintained by [https://www.wikidata.org/wiki/User:OlafJanssen Olaf Janssen], the Wikimedia coordinator of the KB, mainly as a '''tool for experimentation, learning, skill-building, knowledge sharing and consultancy about Wikibase''', both towards KB staff, (inter)national Wiki(base) communities, GLAMs, KB network partners, as well as other 3rd parties. It does not contain any offical data(sets) of the KB, and the data can be changed/deleted at any time. This instance is not supported by the KB, nor is it part of the official KB IT infrastructure. If you are interested in the official Wikibase instance of the KB, please visit xxx.</span>''


== Quick links==
== Quick links ==
'''Eigenschappen (properties)''' (namespace = 122)
=== Eigenschappen (properties) (namespace 122) ===
*[[Special:ListProperties|Alle eigenschappen 1]]
* [[Special:ListProperties|Alle eigenschappen 1]]
*[https://kbtestwikibase.wikibase.cloud/wiki/Special:AllPages?from=&to=&namespace=122 Alle eigenschappen 2]
* [https://kbtestwikibase.wikibase.cloud/wiki/Special:AllPages?from=&to=&namespace=122 Alle eigenschappen 2]
*[[Special:NewProperty|Nieuwe eigenschap aanmaken]]
* [[Special:NewProperty|Nieuwe eigenschap aanmaken]]
==== Basiseigenschappen voor personen ====
* [[Property:P3|is een uniek exemplaar van]] (waarde: Q-nummer van mens)
* [[Property:P76|NTA-label]]
* [[Property:P44|voornaam]]
* [[Property:P34|voornaam (als tekenreeks)]]
* [[Property:P60|achternaam]]
* [[Property:P59|achternaam (als tekenreeks)]]
* [[Property:P67|sekse of geslacht]] (waarde: Q-nummer van man of vrouw)
* [[Property:P74|land van nationaliteit]]
* [[Property:P75|land van nationaliteit (tweeletterige landcode als tekenreeks)]]
* [[Property:P61|geboortedatum (EDTF)]]
* [[Property:P63|geboorteplaats]]
* [[Property:P64|geboorteplaats (als tekenreeks)]]
* [[Property:P62|overlijdensdatum (EDTF)]]
* [[Property:P65|overlijdensplaats]]
* [[Property:P66|overlijdensplaats (als tekenreeks)]]
* [[Property:P71|beroep]]
* [[Property:P72|beroep (als tekenreeks)]]
* [[Property:P7|PPN identificatiecode voor persoonsnaam]]
* [[Property:P43|VIAF-identificatiecode]]
* [[Property:P68|DBNL-identificatiecode voor auteur]]
* [[Property:P69|ISNI-identificatiecode]]
* [[Property:P70|LCAuth-identificatiecode]]
* [[Property:P1|Wikidata URI]]
* [[Property:P4|Wikidata Qid]]


'''Items''' (namespace = 120)
==== Basiseigenschappen voor werken ====
* [[Property:P3|is een uniek exemplaar van]]
* [[Property:P2|subklasse van]]
* [[Property:P5|titel]]
* [[Property:P9|beschrijving]]
* [[Property:P17|taal van werk]]
* [[Property:P25|taal van werk (als tekenreeks)]]
* [[Property:P18|genre]]
* [[Property:P26|genre (als tekenreeks)]]
* [[Property:P10|auteur]]
* [[Property:P19|auteur (als tekenreeks)]]
* [[Property:P11|illustrator]]
* [[Property:P20|illustrator (als tekenreeks)]]
* [[Property:P12|uitgever]]
* [[Property:P21|uitgever (als tekenreeks)]]
* [[Property:P13|plaats van publicatie]]
* [[Property:P22|plaats van publicatie (als tekenreeks)]]
* [[Property:P73|datum van uitgave (EDTF)]]
* [[Property:P15|in collectie]]
* [[Property:P23|in collectie (als tekenreeks)]]
* [[Property:P8|inventarisnummer]]
* [[Property:P16|gebruikt materiaal]]
* [[Property:P24|gebruikt materiaal (als tekenreeks)]]
* [[Property:P6|PPN identificatiecode voor het oorspronkelijke fysieke werk]]
* [[Property:P1|Wikidata URI]]
* [[Property:P4|Wikidata Qid]]
 
=== Items (namespace 120) ===
*[https://kbtestwikibase.wikibase.cloud/wiki/Special:AllPages?from=&to=&namespace=120 Alle items]
*[https://kbtestwikibase.wikibase.cloud/wiki/Special:AllPages?from=&to=&namespace=120 Alle items]
*[[Special:NewItem|Nieuw item aanmaken]]
*[[Special:NewItem|Nieuw item aanmaken]]
==== Basisitems algemeen ====
* [[Item:Q1|Koninklijke Bibliotheek (Nederland)]]
* [[Item:Q2|nationale bibliotheek]]
* [[Item:Q5|organisatie]]
==== Basisitems voor personen ====
* [[Item:Q3|mens]]
* [[Item:Q27|mannelijk]]
* [[Item:Q28|vrouwelijk]]
==== Basisitems voor werken ====
* [[Item:Q6|geografische locatie]]
* [[Item:Q7|genre]]
* [[Item:Q8|taal]]
* [[Item:Q9|materiaal]]
* [[Item:Q4|centsprent]]


== Terminologie ==
== Terminologie ==
Line 29: Line 98:


=== Personen ===
=== Personen ===
* '''Q10''' - [[Item:Q10|Louis Auguste Gustave Doré]] - basaal Qitem dat een mens van vlees en bloed beschrijft
Basale Qitems die mensen van vlees en bloed beschrijven
* '''Q10''' - [[Item:Q10|Louis Auguste Gustave Doré]]
* '''Q29''' - [[Item:Q29|Theun de Vries]]
:Openstaande issues (Phabricator):  
:Openstaande issues (Phabricator):  
:* [https://phabricator.wikimedia.org/T310899 Allow custom ordering of properties in wikibase.cloud instances]
:* [https://phabricator.wikimedia.org/T310899 Allow custom ordering of properties in wikibase.cloud instances] --> Opgelost, sortering is nu aanpasbaar. Zie oplossing in https://phabricator.wikimedia.org/T310899 , Olaf heeft https://kbtestwikibase.wikibase.cloud/wiki/MediaWiki:Wikibase-SortedProperties aangemaakt en de paginacache geleegd via [[Special:Purge]].
:* [https://phabricator.wikimedia.org/T310898 Clustering of external ID properties in Qitems in wikibase.cloud (as in Wikidata)]
:* [https://phabricator.wikimedia.org/T310898 Clustering of external ID properties in Qitems in wikibase.cloud (as in Wikidata)] --> hangt met bovenstaande samen
 
Openstaand vragen:
* Welke datamodel zit er achter de personen die we in onze Wikibase gaan beschrijven? Moeten/kunnen we aansluiten bij (hergebruik maken van) reeds bestaande datamodellen over personen en persoonsnamen?


== SPARQL==
== SPARQL==
Line 45: Line 119:
<nowiki>PREFIX wikibase: <http://wikiba.se/ontology#></nowiki><br>
<nowiki>PREFIX wikibase: <http://wikiba.se/ontology#></nowiki><br>
<nowiki>PREFIX p: <https://kbtestwikibase.wikibase.cloud/prop/></nowiki><br>
<nowiki>PREFIX p: <https://kbtestwikibase.wikibase.cloud/prop/></nowiki><br>
<nowiki>PREFIX ps: <http://www.wikidata.org/prop/statement/></nowiki><br>
<nowiki>PREFIX xsd: <http://www.w3.org/2001/XMLSchema#></nowiki><br></code>
<nowiki>PREFIX xsd: <http://www.w3.org/2001/XMLSchema#></nowiki><br></code>
=== Wat zit er in de Wikibase? ===
 
* [https://kbtestwikibase.wikibase.cloud/query/#%23All%20properties%20with%20descriptions%20and%20aliases%20and%20types%0APREFIX%20wikibase%3A%20%3Chttp%3A%2F%2Fwikiba.se%2Fontology%23%3E%0A%0ASELECT%20%3Fproperty%20%3FpropertyType%20%3FpropertyLabel%20%3FpropertyDescription%20%3FpropertyAltLabel%20WHERE%20%7B%0A%20%20%3Fproperty%20wikibase%3ApropertyType%20%3FpropertyType%20.%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%20%7D%0A%7D%0AORDER%20BY%20ASC%28xsd%3Ainteger%28STRAFTER%28STR%28%3Fproperty%29%2C%20%27P%27%29%29%29 Alle Ps in deze Wikibase]
=== Queries===
* [https://kbtestwikibase.wikibase.cloud/query/#%23%20All%20Qnumbers%20in%20this%20Wikibase%0APREFIX%20wikibase%3A%20%3Chttp%3A%2F%2Fwikiba.se%2Fontology%23%3E%0ASELECT%20%20%3Fidentifier%20%3FidentifierLabel%20%3FidentifierDescription%20%3FidentifierAltLabel%20%0AWHERE%20%0A%7B%0A%20%20%20%20%3Fidentifier%20wikibase%3Aidentifiers%20%3Fb%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22nl%22.%20%7D%0A%7D%0AORDER%20BY%20ASC%28xsd%3Ainteger%28STRAFTER%28STR%28%3Fidentifier%29%2C%20%27Q%27%29%29%29 Alle Qs in deze Wikibase]
* Zie [[Project:SPARQL/examples|deze voorbeelden van SPARQL queries]] - de queries op deze pagina worden in de Voorbeelden-dropdown op https://kbtestwikibase.wikibase.cloud/query/ weergegeven.
* [https://kbtestwikibase.wikibase.cloud/query/#%23%20All%20Ps%20and%20Qs%20in%20this%20Wikibase%0APREFIX%20wikibase%3A%20%3Chttp%3A%2F%2Fwikiba.se%2Fontology%23%3E%0A%0ASELECT%20%20%3Fstatement%20%3FstatementLabel%20%3FstatementDescription%20%3FstatementAltLabel%0AWHERE%20%0A%7B%0A%20%20%20%3Fstatement%20wikibase%3Astatements%20%3Fb%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22nl%22.%20%7D%0A%7D%0AORDER%20BY%20%3Fstatement Alle Ps en Qs samen]
*[https://kbtestwikibase.wikibase.cloud/query/#%23%20Find%20claim%20ids%20%28GUID%29%20for%20Qnumbers%20in%20this%20Wikibase%0A%23%20https%3A%2F%2Fkbtestwikibase.wikibase.cloud%2Fw%2Fapi.php%3Faction%3Dhelp%26modules%3Dwbgetclaims%0APREFIX%20wikibase%3A%20%3Chttp%3A%2F%2Fwikiba.se%2Fontology%23%3E%0APREFIX%20p%3A%20%3Chttps%3A%2F%2Fkbtestwikibase.wikibase.cloud%2Fprop%2F%3E%0APREFIX%20ps%3A%20%3Chttps%3A%2F%2Fkbtestwikibase.wikibase.cloud%2Fprop%2Fstatement%2F%3E%0A%0ASELECT%20%20%3Fitem%20%3FitemLabel%20%3FitemDescription%20%3Fclaim%20%3FIsEenLabel%0AWHERE%20%0A%7B%0A%20%20%20%20%3Fitem%20wikibase%3Aidentifiers%20%3Fb.%0A%20%20%20%20%3Fitem%20p%3AP3%20%3Fclaim.%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%3Fclaim%20ps%3AP3%20%3FIsEen.%20%20%20%20%20%20%20%20%20%20%20%0A%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22nl%22.%20%7D%0A%7D%0AORDER%20BY%20ASC%28xsd%3Ainteger%28STRAFTER%28STR%28%3Fitem%29%2C%20%27Q%27%29%29%29%0ALIMIT%2035 Claim ids (GUID) for Qnumbers in this Wikibase]
=== Eenvoudige zoekvragen ===
* [https://kbtestwikibase.wikibase.cloud/query/#%23kbwb%20%3D%20KB%20Wikibase%0APREFIX%20wd%3A%20%3Chttps%3A%2F%2Fkbtestwikibase.wikibase.cloud%2Fentity%2F%3E%0APREFIX%20wdt%3A%20%3Chttps%3A%2F%2Fkbtestwikibase.wikibase.cloud%2Fprop%2Fdirect%2F%3E%0APREFIX%20wikibase%3A%20%3Chttp%3A%2F%2Fwikiba.se%2Fontology%23%3E%0A%0ASELECT%20%3Fding%20%3FdingLabel%20%3FdingDescription%20%20%3FIsEen%20%3FIsEenLabel%20%3FIsEenDescription%20WHERE%0A%7B%0A%3Fding%20wdt%3AP3%20%3FIsEen%20%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22nl%22.%20%7D%0A%7D Dingen die een instantie (P3) zijn van andere dingen]


== Interactie via de API ==
== Interactie via de API ==
Line 64: Line 135:
* https://github.com/KBNLresearch/wikibase-api/tree/master/examples-kb - Examples on how to read, write, delete, update Ps, Qs, claims, qualifiers and references in https://kbtestwikibase.wikibase.cloud using Python
* https://github.com/KBNLresearch/wikibase-api/tree/master/examples-kb - Examples on how to read, write, delete, update Ps, Qs, claims, qualifiers and references in https://kbtestwikibase.wikibase.cloud using Python
* Docs/manual are on https://wikibase-api.readthedocs.io/en/latest/.
* Docs/manual are on https://wikibase-api.readthedocs.io/en/latest/.
=== Nog verder bekijken, waarschijnlijk relevant===
* https://github.com/LeMyst/WikibaseIntegrator. Zie ook de verdere import opties op https://www.mediawiki.org/wiki/Wikibase/Importing
==Reconciliation service for this Wikibase==
https://github.com/KBNLresearch/OpenRefine-Wikibase
* Recon service o.b.v. Docker: https://openrefine-wikibase.readthedocs.io/en/latest/install.html
* Example config file: https://github.com/KBNLresearch/OpenRefine-Wikibase/blob/main/config.py
* Configuration of OpenRefine: add URLs of recon service and manifest to OpenRefine
* Example manifest: https://github.com/KBNLresearch/OpenRefine-Wikibase/blob/main/kb-test-wikibase-cloud-manifest.json


== Snelheid van bulk data-importeren ==
== Snelheid van bulk data-importeren ==
* [https://wikibase.consulting/fast-bulk-import-into-wikibase/ Fast Bulk Import Into Wikibase] - ''Importing a large amount of Items into Wikibase can be a challenge. This post provides a high level overview of different importing approaches and their performance.''
* [https://wikibase.consulting/fast-bulk-import-into-wikibase/ Fast Bulk Import Into Wikibase] - ''Importing a large amount of Items into Wikibase can be a challenge. This post provides a high level overview of different importing approaches and their performance.''
== Wikibase.cloud project updates ==
* https://meta.wikimedia.org/wiki/Wikibase/Wikibase.cloud
== Wikibase.cloud documenation ==
* https://www.mediawiki.org/wiki/Wikibase/Wikibase.cloud
== Our Wikibase.cloud unboxing experience and first findings ==
'''<big>The text below is a transcript of the presentation ''[https://commons.wikimedia.org/wiki/File:KB_Wikibase.cloud_Unboxing_Experience,_Netherlands_Wikibase_Knowlegde_Group,_22-07-2022.pdf KB's Wikibase.cloud Unboxing Experience]''</big>'''
In June-July 2022 the KB created and configured this instance on Wikibase.cloud. Many of the steps we needed to take in the setup process were as to be expected when working with fresh MediaWiki instances in general, and Wikidata in particular. However, some steps were not immediately logical, manifest, clearly documented or simply beyond our (then) knowledge and experience. We created a '''[https://commons.wikimedia.org/wiki/File:KB_Wikibase.cloud_Unboxing_Experience,_Netherlands_Wikibase_Knowlegde_Group,_22-07-2022.pdf presentation]''' in which we share experiences and first impressions of unboxing, setting up, configuring and tweaking '''our [https://kbtestwikibase.wikibase.cloud/wiki/Main_Page Wikibase.cloud sandbox instance]'''. We also present solutions for most of the issues we encountered.
Below is an overview of the most important issues we encountered. The numbering refers to the corresponding slides in the presentation:
;Setting up our Wikibase.cloud test instance ([https://commons.wikimedia.org/w/index.php?title=File:KB_Wikibase.cloud_Unboxing_Experience,_Netherlands_Wikibase_Knowlegde_Group,_22-07-2022.pdf&page=2 slide 2] - [https://commons.wikimedia.org/w/index.php?title=File:KB_Wikibase.cloud_Unboxing_Experience,_Netherlands_Wikibase_Knowlegde_Group,_22-07-2022.pdf&page=13 slide 13])
* We succesfully created our test instance at https://kbtestwikibase.wikibase.cloud via a personal [https://www.wikibase.cloud/dashboard Wikibase.cloud dashboard] every user gets, [https://www.mediawiki.org/wiki/Wikibase/Wikibase.cloud/Wikis as described here]. This went without any problems, as expected.
* ISSUE: ''We would have liked to be able to [https://www.wikibase.cloud/wikis/create create another Wikibase.cloud instance]'' from this dashboard, but currently (15th Aug 2022) there is a hard limit of [https://phabricator.wikimedia.org/T311121 one instance per account].
: SOLUTION: There is no solution yet.
;Setting up basic content (Ps and Qs) via the GUI ([https://commons.wikimedia.org/w/index.php?title=File:KB_Wikibase.cloud_Unboxing_Experience,_Netherlands_Wikibase_Knowlegde_Group,_22-07-2022.pdf&page=14 slide 14] - [https://commons.wikimedia.org/w/index.php?title=File:KB_Wikibase.cloud_Unboxing_Experience,_Netherlands_Wikibase_Knowlegde_Group,_22-07-2022.pdf&page=29 slide 29])
* As can be seen from the [https://kbtestwikibase.wikibase.cloud/wiki/Special:ListUsers users list], there is a preset default admin [[User:Ookgezellig]] account for this instance, resulting from the global wikibase.cloud creation account (ookgezellig@gmail.com)
* [https://kbtestwikibase.wikibase.cloud/w/index.php?title=Special:CreateAccount&returnto=Main+Page Creating additional, regular user accounts] on this Wiki instance was as expected. We created [[User:OlafJanssen]] with normal, restricted privileges.
* ISSUE: ''Regular user accounts with default privileges are not allowed to add  URLs to items'' (see Phabricator [https://phabricator.wikimedia.org/T310419 T310419], [https://phabricator.wikimedia.org/T86453 T86453] and [https://phabricator.wikimedia.org/T310421 T310421]).
: SOLUTION: In order to be able to add the Wikidata URL to (for instance) [https://kbtestwikibase.wikibase.cloud/wiki/Property:P3 P3] ("is a unique exmple of"), we used the [[User:Ookgezellig]] admin account to temporarily upgrade the [[User:OlafJanssen]] account to admin privileges as well.
* IMPORTANT: the Wikidata URL in [https://kbtestwikibase.wikibase.cloud/wiki/Property:P3 P3] must be formatted as '''http:'''//www.wikidata.org/'''entity'''/P31, and NOT as http'''s'''://www.wikidata.org/entity/P31, and NOT as <nowiki>https://www.wikidata.org/</nowiki>'''wiki/Property:'''P31, or any other mix of these incorrect URL syntaxes. This is important for correctly functioning, abbreviated display of these URLs in the Wikibase query service ("[http://www.wikidata.org/entity/P31 wd:P31]", as can be seen in the query result <nowiki>https://tinyurl.com/2kd5dthd</nowiki>).
* ISSUE: When adding statements to a Q-item such as [[Item:Q29|Theun de Vries]], ''by default the statements are (and remain) displayed in the same order as you originally added them''. This is different from Wikidata, where in the corresponding [https://www.wikidata.org/wiki/Q2143934 Wikidata item about Theun de Vries] the statements are displayed in a custom, fixed order, with "Instance of" and "Image" on top, and a list of external identifiers at the bottom of the page, irrespective of the exacty order these statements were originally added to this Wikidata item.
: SOLUTION: This issue was solved by adding the page [[MediaWiki:Wikibase-SortedProperties]] to the Wikibase, in which the custom order of statements can be specified. This is the same as in Wikidata, see [https://www.wikidata.org/wiki/MediaWiki:Wikibase-SortedProperties MediaWiki:Wikibase-SortedProperties] and [https://www.mediawiki.org/wiki/Manual:Interface/Wikibase-SortedProperties the manual] on Wikidata. Please note that the required page cache purging needed for this functionality to kick in can be actively triggered via [[Special:Purge]].       
;SPARQL and REST APIs ([https://commons.wikimedia.org/w/index.php?title=File:KB_Wikibase.cloud_Unboxing_Experience,_Netherlands_Wikibase_Knowlegde_Group,_22-07-2022.pdf&page=30 slide 30] - [https://commons.wikimedia.org/w/index.php?title=File:KB_Wikibase.cloud_Unboxing_Experience,_Netherlands_Wikibase_Knowlegde_Group,_22-07-2022.pdf&page=43 slide 43])
* We created a small number of [[Project:SPARQL/examples|SPARQL query examples]] on this Wikibase.
* ISSUE: ''the Wikidata [https://www.wikidata.org/wiki/Template:SPARQL SPARQL template] for query syntax highlighting is not implemented in this Wikibase''.
: SOLUTION: Instead one must use a ''<nowiki><sparql tryit="1">...</sparql></nowiki>'' wrapper, as demonstrated [https://kbtestwikibase.wikibase.cloud/w/index.php?title=Project:SPARQL/examples&action=submit in this example]. 
* IMPORTANT: ''in Wikidata prefixes don't need to be specified explicitly in SPARQL queries''. However, in our Wikibase.cloud instance, prefixes must be explicitly stated, as [[Project:SPARQL/examples#Federated_querying:_mixing_data_from_this_Wikibase_with_data_from_Wikidata|this example]] shows. Please note and mind the distinction between PREFIX kbwdt, kbwd, wdt and  wd.
* IMPORTANT: The exact URL [https://kbtestwikibase.wikibase.cloud/wiki/Project:SPARQL/examples https://kbtestwikibase.wikibase.cloud/wiki/'''Project:SPARQL/examples'''], as well as the correct formatting of this page, are important to correctly display these query examples in the [https://kbtestwikibase.wikibase.cloud/query/# query services interface] (click the ''Examples'' button at the top)
* Via the regular [https://kbtestwikibase.wikibase.cloud/w/api.php Wikimedia REST API] the full [[Item:Q29|item on Theun de Vries]] can be requested [https://kbtestwikibase.wikibase.cloud/w/api.php?action=wbgetentities&ids=Q29&format=json as JSON] or [https://kbtestwikibase.wikibase.cloud/w/api.php?action=wbgetentities&ids=Q29&format=xml as XML] as well. 
* An alternative way for requesting full Wikibase items directly from the Qnumber is via the [https://www.mediawiki.org/wiki/Wikibase/EntityData Special:EntityData] URL. The ouput can be obtained in seven different formats: [[Special:EntityData/Q29|HTML]], [[Special:EntityData/Q29.json|JSON]], [[Special:EntityData/Q29.rdf|RDF/XML]], [[Special:EntityData/Q29.nt|NT]], [[Special:EntityData/Q29.ttl|TTL]], [[Special:EntityData/Q29.n3|N3]] and [[Special:EntityData/Q29.php|PHP]].
: Or equivalently, using a format argument, eg [https://kbtestwikibase.wikibase.cloud/wiki/Special:EntityData?id=Q29&format=json Special:EntityData?id=Q29&format=json] for a JSON respons. 
* For simple interaction with the Wikibase API via Python, the [https://github.com/samuelmeuli/wikibase-api wikibase-api] Python library can be used . [https://wikibase-api.readthedocs.io/en/latest/getting_started/installation_and_usage.html Read the docs] for more details.
: Examples on how to use this library are available at https://github.com/KBNLresearch/wikibase-api/tree/master/examples-kb + https://github.com/kbnlresearch/wikibase-api/blob/master/examples-kb/wikibase-api.py
;Three problems we encounterd, yet unsolved ([https://commons.wikimedia.org/w/index.php?title=File:KB_Wikibase.cloud_Unboxing_Experience,_Netherlands_Wikibase_Knowlegde_Group,_22-07-2022.pdf&page=44 slide 44] - [https://commons.wikimedia.org/w/index.php?title=File:KB_Wikibase.cloud_Unboxing_Experience,_Netherlands_Wikibase_Knowlegde_Group,_22-07-2022.pdf&page=52 slide 52])
* ISSUE: ''Regular user accounts with default privileges are not allowed to add  URLs to items''
: SOLUTION: See discussion above
* ISSUE: ''Creation of common.js and common.css pages on Wikibase.cloud instances is not allowed.'' On Wikidata, users (eg. [https://www.wikidata.org/wiki/User:OlafJanssen User:OlafJanssen]) can create personal [https://www.wikidata.org/wiki/User:OlafJanssen/common.js common.js] and [https://www.wikidata.org/wiki/User:OlafJanssen/common.css common.css] pages for adding custom functionalities and layout to their Wikidata interfaces. On Wikibase.cloud, this is currently not possible.
: SOLUTION: No solution yet, see Phabricator [https://phabricator.wikimedia.org/T310787 T310787].
* ISSUE: ''Default data import speed is rather limited''. When importing items into a Wikibase using REST API-based tools such as [https://www.wikidata.org/wiki/Help:QuickStatements QuickStatements], [https://www.mediawiki.org/wiki/Manual:Pywikibot pywikibot] or [https://github.com/SuLab/WikidataIntegrator WikidataIntegrator], the maximum import speed is about 3-10 items per second, as explained in the article ''[https://www.wikibase.consulting/fast-bulk-import-into-wikibase/ Fast Bulk Import Into Wikibase]'' by [https://www.wikibase.consulting/ The Wikibase Consultancy]. This is an OK speed for small datasets, but if you (like the KB) plan to import millions of items, this is obviously too slow. 
: SOLUTION: PHP scripts or direct SQL tools such as [https://github.com/UB-Mannheim/RaiseWikibase RaiseWikibase], as further outlined in the article. At the moment these solutions are not considered nor used by the KB.
;Where to get help? ([https://commons.wikimedia.org/w/index.php?title=File:KB_Wikibase.cloud_Unboxing_Experience,_Netherlands_Wikibase_Knowlegde_Group,_22-07-2022.pdf&page=53 slide 53] - [https://commons.wikimedia.org/w/index.php?title=File:KB_Wikibase.cloud_Unboxing_Experience,_Netherlands_Wikibase_Knowlegde_Group,_22-07-2022.pdf&page=58 slide 58])
# Wikibase.cloud issues on Phabricator: https://phabricator.wikimedia.org/tag/wikibase.cloud/
# Wikibase.cloud updates: https://meta.wikimedia.org/wiki/Wikibase/Wikibase.cloud
# Wikibase.cloud user documentation: https://www.mediawiki.org/wiki/Wikibase/Wikibase.cloud
# Telegram for quick help: https://t.me/joinchat/FgqAnxNQYOeAKmyZTIId9g
# Wikibase-cloud mailing list: https://lists.wikimedia.org/postorius/lists/wikibase-cloud.lists.wikimedia.org/

Latest revision as of 12:58, 19 September 2023

Unofficial Wikibase sandbox for the national library of The Netherlands.

Disclaimer

This Wikibase sandbox is for playing, experimenting, learning about the functionalities, possibilities and limitations etc. of Wikibase, and knowledge sharing activities resulting from these learnings. It is maintained by Olaf Janssen, the Wikimedia coordinator of the KB, mainly as a tool for experimentation, learning, skill-building, knowledge sharing and consultancy about Wikibase, both towards KB staff, (inter)national Wiki(base) communities, GLAMs, KB network partners, as well as other 3rd parties. It does not contain any offical data(sets) of the KB, and the data can be changed/deleted at any time. This instance is not supported by the KB, nor is it part of the official KB IT infrastructure. If you are interested in the official Wikibase instance of the KB, please visit xxx.

Quick links

Eigenschappen (properties) (namespace 122)

Basiseigenschappen voor personen

Basiseigenschappen voor werken

Items (namespace 120)

Basisitems algemeen

Basisitems voor personen

Basisitems voor werken

Terminologie

  • Statements can also be expanded upon, annotated, or contextualized with the addition of optional qualifiers, references, and ranks.
  • The core part of a statement without references and ranks is also called claim. A claim without qualifiers is also referred to as snak. (= simplest P-Q pair)

Voorbeeld-items

om (het API-matig schrijven van) onze KB-datamodellen te testen en te verbeteren. Het zijn 1e, naieve schetsen, "praatstukken" om bij de datamodellering te helpen.

Centsprenten

Voer voor discussie:
Let op: Q20 beschrijft de fysieke centsprent , zie nbc.bibliotheek.nl/32226085X en KB-catalogus/32226085X.
Er is ook een PPN voor de gedigitaliseerde centsprent, zie nbc.bibliotheek.nl/380352362 en KB-catalogus/380352362, maar dat is een ander, digitaal object, een digitaal bestand, een jpg.
De conceptuele vraag die we i.h.k.v. EMMA moeten beantwoorden is hoe de fysieke en gedigitaliseerde objecten zich tot elkaar moeten verhouden, dus hoe we die relatie in onze Wikibase willen gaan vastleggen. Het aanmaken van 2 aparte Qitems , 1 voor de fysieke prent (PPN=32226085X), en 1 voor het jpg-bestand (PPN=380352362) - dus zoals het op dit moment ook in de GGC en KB-catalogus gebeurt, is mi (=Olaf) niet wenselijk, maar daar moeten we (mn. Danielle en ik) met de KB-metadata-experts een keer voor gaan zitten.
De GGC/KB-catalogus is hierin ook niet zuiver. Als je bv naar de beschrijving van het digitale ding ("de jpg") kijkt op https://webggc.oclc.org/cbs/DB=2.37/XMLPRS=Y/PPN?PPN=380352362, dan staan daar nog allerlei velden in die met het fysieke ding te maken hebben. Bv bij "Jaar van vervaardiging" - het jaar waarin de jpg gemaakt is - zou ik "2009" ipv "[tussen 1869 en 1886]" verwachten, want in de 19e eeuw kon men nog helemaal geen jpgs maken. Bij de beschrijving van het digitale bestand zou ik properties als resolutie, kleurdiepte, bestandsformaat (jpg, png, tiff..), EXIF-info, URL etc. verwachten.

Personen

Basale Qitems die mensen van vlees en bloed beschrijven

Openstaande issues (Phabricator):

Openstaand vragen:

  • Welke datamodel zit er achter de personen die we in onze Wikibase gaan beschrijven? Moeten/kunnen we aansluiten bij (hergebruik maken van) reeds bestaande datamodellen over personen en persoonsnamen?

SPARQL

Setup

PREFIX wd: <https://kbtestwikibase.wikibase.cloud/entity/>
PREFIX wds: <https://kbtestwikibase.wikibase.cloud/entity/statement/>
PREFIX wdv: <https://kbtestwikibase.wikibase.cloud/value/>
PREFIX wdt: <https://kbtestwikibase.wikibase.cloud/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX p: <https://kbtestwikibase.wikibase.cloud/prop/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

Queries

Interactie via de API

Endpoint / base URL

Via URLs

Via Python

Nog verder bekijken, waarschijnlijk relevant

Reconciliation service for this Wikibase

https://github.com/KBNLresearch/OpenRefine-Wikibase

Snelheid van bulk data-importeren

  • Fast Bulk Import Into Wikibase - Importing a large amount of Items into Wikibase can be a challenge. This post provides a high level overview of different importing approaches and their performance.

Wikibase.cloud project updates

Wikibase.cloud documenation

Our Wikibase.cloud unboxing experience and first findings

The text below is a transcript of the presentation KB's Wikibase.cloud Unboxing Experience

In June-July 2022 the KB created and configured this instance on Wikibase.cloud. Many of the steps we needed to take in the setup process were as to be expected when working with fresh MediaWiki instances in general, and Wikidata in particular. However, some steps were not immediately logical, manifest, clearly documented or simply beyond our (then) knowledge and experience. We created a presentation in which we share experiences and first impressions of unboxing, setting up, configuring and tweaking our Wikibase.cloud sandbox instance. We also present solutions for most of the issues we encountered.

Below is an overview of the most important issues we encountered. The numbering refers to the corresponding slides in the presentation:

Setting up our Wikibase.cloud test instance (slide 2 - slide 13)
SOLUTION: There is no solution yet.
Setting up basic content (Ps and Qs) via the GUI (slide 14 - slide 29)
SOLUTION: In order to be able to add the Wikidata URL to (for instance) P3 ("is a unique exmple of"), we used the User:Ookgezellig admin account to temporarily upgrade the User:OlafJanssen account to admin privileges as well.
  • IMPORTANT: the Wikidata URL in P3 must be formatted as http://www.wikidata.org/entity/P31, and NOT as https://www.wikidata.org/entity/P31, and NOT as https://www.wikidata.org/wiki/Property:P31, or any other mix of these incorrect URL syntaxes. This is important for correctly functioning, abbreviated display of these URLs in the Wikibase query service ("wd:P31", as can be seen in the query result https://tinyurl.com/2kd5dthd).
  • ISSUE: When adding statements to a Q-item such as Theun de Vries, by default the statements are (and remain) displayed in the same order as you originally added them. This is different from Wikidata, where in the corresponding Wikidata item about Theun de Vries the statements are displayed in a custom, fixed order, with "Instance of" and "Image" on top, and a list of external identifiers at the bottom of the page, irrespective of the exacty order these statements were originally added to this Wikidata item.
SOLUTION: This issue was solved by adding the page MediaWiki:Wikibase-SortedProperties to the Wikibase, in which the custom order of statements can be specified. This is the same as in Wikidata, see MediaWiki:Wikibase-SortedProperties and the manual on Wikidata. Please note that the required page cache purging needed for this functionality to kick in can be actively triggered via Special:Purge.
SPARQL and REST APIs (slide 30 - slide 43)
SOLUTION: Instead one must use a <sparql tryit="1">...</sparql> wrapper, as demonstrated in this example.
Or equivalently, using a format argument, eg Special:EntityData?id=Q29&format=json for a JSON respons.
  • For simple interaction with the Wikibase API via Python, the wikibase-api Python library can be used . Read the docs for more details.
Examples on how to use this library are available at https://github.com/KBNLresearch/wikibase-api/tree/master/examples-kb + https://github.com/kbnlresearch/wikibase-api/blob/master/examples-kb/wikibase-api.py
Three problems we encounterd, yet unsolved (slide 44 - slide 52)
  • ISSUE: Regular user accounts with default privileges are not allowed to add URLs to items
SOLUTION: See discussion above
  • ISSUE: Creation of common.js and common.css pages on Wikibase.cloud instances is not allowed. On Wikidata, users (eg. User:OlafJanssen) can create personal common.js and common.css pages for adding custom functionalities and layout to their Wikidata interfaces. On Wikibase.cloud, this is currently not possible.
SOLUTION: No solution yet, see Phabricator T310787.
SOLUTION: PHP scripts or direct SQL tools such as RaiseWikibase, as further outlined in the article. At the moment these solutions are not considered nor used by the KB.
Where to get help? (slide 53 - slide 58)
  1. Wikibase.cloud issues on Phabricator: https://phabricator.wikimedia.org/tag/wikibase.cloud/
  2. Wikibase.cloud updates: https://meta.wikimedia.org/wiki/Wikibase/Wikibase.cloud
  3. Wikibase.cloud user documentation: https://www.mediawiki.org/wiki/Wikibase/Wikibase.cloud
  4. Telegram for quick help: https://t.me/joinchat/FgqAnxNQYOeAKmyZTIId9g
  5. Wikibase-cloud mailing list: https://lists.wikimedia.org/postorius/lists/wikibase-cloud.lists.wikimedia.org/