kensho-technologies / qwikidata Goto Github PK
View Code? Open in Web Editor NEWPython tools for interacting with Wikidata
Home Page: http://qwikidata.rtfd.io/
License: Apache License 2.0
Python tools for interacting with Wikidata
Home Page: http://qwikidata.rtfd.io/
License: Apache License 2.0
Hello,
I am using your qwikidata for the last part of my thesis. The function return_sparql_query_results
returns an exception for all queries since today afternoon. When I run the SPARQL from Wikidata Query service interface, it returns the results.
Could you check this function ?
Thank in advance.
Best Regards.
Hi, thank you for your so useful library.
I get incorrect results relying on WikidataItem.get_truthy_claim_groups method.
Let's take for example Kochi city from India:
`kochi = WikidataItem(get_entity_dict_from_api('Q1800'))
located_in = item.get_truthy_claim_groups()['P131']
`
P131 is the property of located in the administrative territorial entity.
As result we will have 3 entities, 2 of which have end time.
It means that P582 qualifier is not taken into consideration.
Perhaps it was not your intention, but if so the name get_truthy_claim_groups looks to be incorrect.
Thank you
The Time datavalue type has "precision", which affects how the time is interpreted or rendered.
The following example is taken from the comments in qwikidata/datavalue.py
That is, 1988-07-13T00:00:00 with
precision 8 (decade) will be interpreted as 198?-??-?? and rendered as "1980s".
However, the Time class does not seem to have a method to render the time value in such way according to its precision. The __str__()
method simply prints the precision, while the get_parsed_datetime_dict()
method ignores the precision.
Am I missing anything? Thanks.
I sometimes come across the following error:
ValueError: required qualifier_dict keys are ['hash', 'snaktype', 'property', 'datavalue', 'datatype']. only found ['snaktype', 'property', 'hash', 'datatype']
This arises when running command get_truthy_claim_group
, it seems that for some properties datavalue
is not available as a dictionary key.
https://github.com/kensho-technologies/qwikidata/blob/develop/qwikidata/utils.py#L33
ent_hi
will be undefined
There are some wikimedia services (e.g. https://tools.wmflabs.org/) that would benefit from Python 3.5 support. This would require,
When using the example code from https://github.com/kensho-technologies/qwikidata/tree/develop/examples/basic_json_dump.py (which appears to be the same as the docs), I get the following error messages:
File "test-qwikidata.py", line 56, in <module>
dump_entities_to_json(politicians, out_fname)
File "path/to/py35/lib/python3.5/site-packages/qwikidata/utils.py", line 31, in dump_entities_to_json
ent = next(entities, None)
TypeError: 'list' object is not an iterator
Used dump latest-all.json.bz2
downloaded 11/4/22 from here
Occurs in both python 3.5 and 3.10.
Is there a way around this?
Is there any way to get the claims for an item whithout specifiying the property id? I tried item.get_claim_group() but it gives me : TypeError: get_claim_group() missing 1 required positional argument: 'property_id'.
Thank you for the help.
Is there a need for a feature to filter on some condition when writing the chunks? For example, one might be interested only in geographical information or data on humans? This would substantially reduce the (filtered) dump.
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.