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

How to get "also known as" field #21

Open
tbright17 opened this issue Dec 20, 2019 · 2 comments
Open

How to get "also known as" field #21

tbright17 opened this issue Dec 20, 2019 · 2 comments

Comments

@tbright17
Copy link

As in title, is there a way to get the "also known as" field in wikidata?

Thanks

@cdhx
Copy link

cdhx commented May 31, 2020

As in title, is there a way to get the "also known as" field in wikidata?

Thanks

from wikidata.client import Client
client = Client() 
entity = client.get('Q20145', load=True)
entity.attribute['aliases']['en']#get english “also know as”

@tbright17

@dahlia
Copy link
Owner

dahlia commented Jun 30, 2020

As @cdhx answered, there is the Entity.attributes attribute which has the entire raw data. As of now, you could get “also known as” field through entity.attributes['aliases'].

However, it would be better if we have an attribute/property like Entity.aliases.

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