Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method to get qualifiers #57

Open
aGGre55or opened this issue Mar 10, 2024 · 2 comments
Open

Method to get qualifiers #57

aGGre55or opened this issue Mar 10, 2024 · 2 comments

Comments

@aGGre55or
Copy link

aGGre55or commented Mar 10, 2024

elon_musk_educated_at

Code:

client = Client()  # doctest: +SKIP
entity = client.get('Q317521', load=True)

client = Client()
prop = client.get('P69', load=True)

res = entity.getlist(prop)
print(res[0])
print(res[0].label)

client = Client()
start_time = res[0].get('P580')
print(start_time)

entity2 = client.get('Q105424537', load=True)
prop2 = client.get('P580', load=True)
print(prop2)
print(prop2.label)
print(type(prop2))
print(prop2.get('start time'))
print(prop2.get('P580'))

Output:

<wikidata.entity.Entity Q105424537>
Smith School of Business
None
<wikidata.entity.Entity P580 'start time'>
start time
<class 'wikidata.entity.Entity'>
None
None

@dahlia
Copy link
Owner

dahlia commented Mar 11, 2024

Qualifiers are not supported yet.

@dahlia dahlia changed the title How to get start_time of nested entity? Method to get qualifiers Mar 11, 2024
@dreua
Copy link

dreua commented Dec 6, 2024

That sounds like an important feature for me, how hard would it be to implement it? As another usage example, I'd like to query the release and eol dates of Fedora Linux in order to compare them with other databases. Getting only a list of the versions without any extra data is not at all helpful. (Also took me a moment to figure out that this is a missing feature and not me using the wrong api functions.)

I'll try it now with pywikibot which looks promising in order to get the data but - in my first glance opinion - worse in terms of a good and pythonic api interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants