dahlia / wikidata

Wikidata client library for Python
https://pypi.org/project/Wikidata/
GNU General Public License v3.0
342 stars 32 forks source link

Method to get qualifiers #57

Open aGGre55or opened 8 months ago

aGGre55or commented 8 months ago

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:

Smith School of Business None start time None None
dahlia commented 8 months ago

Qualifiers are not supported yet.