heardlibrary / digital-scholarship Goto Github PK
View Code? Open in Web Editor NEWCode and documentation for digital scholarship projects
License: Creative Commons Zero v1.0 Universal
Code and documentation for digital scholarship projects
License: Creative Commons Zero v1.0 Universal
Hi,
I successfully used your 2 Python scripts to populate my Wikibase instance, thank you!
It took me a while, but I also managed to modify the data type to have 'strings' instead of 'items' in the script load_csv.py.
By the way, I would recommend suggesting in your tutorial [https://heardlibrary.github.io/digital-scholarship/host/wikidata/bot/] that the line 95 can be replaced by 'value':'"' + stringValue + '"'
OR by '"' + objectQNumber + '"'
(maybe not the best practice but it works) if we want to add the content of the csv column below 'P...' instead of one specific string literal. (And of course, examples for other types would help ;))
I was wondering to what extent the script can be adapted to deal with various types/values (url, string, items, external ID, etc.) contained in the same csv file?
For the moment I can't see how to do it, but your script is the most crystal clear I've tested so far (compare with Piwikibot or WikidataIntegrator, for example), so I'd love to continue working with...
I hope you can help on this point and thx again for sharing (and commenting!) your code @baskaufs.
Running the write-statements script on a local wikibase instance results in the following error:
Write confirmation: {'error': {'code': 'invalid-snak', 'info': 'Invalid snak data.', 'messages': [{'name': 'wikibase-api-invalid-snak', 'parameters': [], 'html': {'*': 'Invalid snak data.'}}], '*': 'See http://.../w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes.'}}
.
I have updated Lines 129 - 131 in the script to refer to items that have been verified to exist in my local Wikibase instance.
I suspect the error is related to the issue of how to represent the JSON "value" property that is an item and not a string as discussed in the "Time for a snak" section of this blog post: http://baskauf.blogspot.com/2019/06/putting-data-into-wikidata-using.html.
However, the Wikibase API sandbox also gives the same error when providing a seemingly valid value
property e.g. {"entity-type":"item","numeric-id":1}
for the wbcreateclaim
endpoint. Interestingly, the sandbox does respond successfully when providing the following value: "{\"entity-type\":\"item\",\"numeric-id\":1}"
however, use of quotes in this manner appears to treat the value as a string and not an item, the latter is the expected behavior.
My goal is conceptually simple - I just want to be able to add a triple (e.g. Q6 P4 Q9
) to a Wikibase instance using Python. Your write-statements script appears to be the closest or most relevant potential solution. I have tried https://github.com/SuLab/WikidataIntegrator and https://github.com/samuelmeuli/wikibase-api, both unsuccessfully.
Do on Friday, Mar 4. We'll submit to university calendar and tag DiSC and Libraries so that it will automatically get picked up there.
issue checking
Preliminary learning objectives are here.
Machelle knows how to do it.
Probably around the last week of March and first week of April.
blah
Met with Facilities review committee on 2022-03-17. Action items:
We can hold off on this until we hear back from Greg #10
We need the specific outcomes to put on the lesson webpage.
This is more complicated, need to set up an account
Testing if Francisco can route issues to projects (i.e., Circuit Python)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.