Giter VIP home page Giter VIP logo

qwikidata's People

Contributors

elordahl avatar galtay avatar kunaltawatia avatar sultanorazbayev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qwikidata's Issues

Exception from`return_sparql_query_results`

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.

get_truthy_claim_group does not take into consideration qualifiers

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

How to render Time (datavalue type)

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.

Checking value types

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.

Add python 3.5 support

There are some wikimedia services (e.g. https://tools.wmflabs.org/) that would benefit from Python 3.5 support. This would require,

  • removing f-strings (e.g. f"the name of this thing is {name}")
  • making inline typehints comments (e.g. thisint: int = 2 -> thisint = 2 # type: int)

basic_json_dump.py yields: TypeError: 'list' object is not an iterator

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?

getting all claims for an items

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.

Filtering the dump

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.