How do you get the value of an "instance" property? #56
Unanswered
michaelmendoza42
asked this question in
Q&A
Replies: 1 comment
-
Follow the algorithm: first the entity, then the property, and not vice versa.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm new to wikidata in general.
I can't figure out how to get the start/end dates of someone who held office.
For example, president George Washington (Q23), there is a property P39 (offices held) and within that I can get that he was a president (Q11696). But that item itself has no start/end date property (P580, P582). However, on the wikidata page there is definitely those properties for each office held.
In my code I'm doing something like:
which returns
<wikidata.entity.Entity Q11696 'President of the United States'>
which is my dead end. this is the same object you'd get if i just did
client.get('Q11696')
because the item has no relation to the original item Q23.Even the SPARQL to figure out the dates for a held office is kinda crazy. You have to do something like:
any help is appreciated. thanks.
Beta Was this translation helpful? Give feedback.
All reactions