Ironholds
Welcome to Wikidata, Ironholds!
Wikidata is a free knowledge base that you can edit! It can be read and edited by humans and machines alike, and you can help. Go to any item page now and add to this ever-growing database!
Need some help getting started? Here are some pages you can familarise yourself with:
- Wikidata:About - About the project.
- Wikidata:Introduction - Another introduction to the project.
- Help:Contents - The main help portal for editing and using the site.
- Wikidata:Project chat - Discussions about the project.
If you have any questions, please ask me on my talk page. If you want to try out editing, you can use the sandbox to try. Once again, welcome, and I hope you quickly feel comfortable here, and become an active editor for Wikidata.
- Regards, --Jitrixis (talk | support my candidacy) 13:34, 1 November 2012 (UTC)
US Congress? edit
@Ironholds: A question and a comment:
How to obtain a data.frame with names, party, districts, etc., of the members of the US Congress? edit
What might be the best way you might suggest to obtain lists (data.frames) of the members of the US Congress?
The Ecdat package contains functions readUShouse and readUSsenate that used to do that. However, I just learned that neither of them currently work. The two functions use very different algorithms, and I wondered if there might be a way to get that information using WikidataR?
readUShouse reads "house.gov" while readUSsenate read the Wikipedia article on "List of current United States Senators". Duncan Temple Lang <duncan@wald.ucdavis.edu>, maintainer for RCurl, said I may be able to fix readUShouse by replacing
- RCurl::getURL(url.)
with
- RCurl::getURL(url., followlocation = TRUE)
However, fixing readUSsenate seems more difficult, because the Wikipedia article on "List of current United States Senators" has been altered so much (including redirecting that title to "Current members of the United States Senate") that my previous function returns garbage. I'd have to recode it from scratch, and before I tried that, I thought I would ask you if we might be able to accomplish this using Wikidata?
Problems with the WikidataR vignette edit
The current code in the WikidataR vignette seems to fail for me:
- item <- get_item(id = 1) # returns a "Large Wikidata (537.7 Kb)" using WikidataR 1.4.0 under R 3.4.3 and RStudio 1.1.383. The next line
- first_claim <- get_property(id = names(item$claims)[1]) # returns "List of 0".
Part of the problem here, I believe, is that "item" does NOT have a component named "claims". It's a list with length(item) == 1 and names(item) == NULL.
I'm not sure how you think this problem should be fixed, but without changing WikidataR, I can get something more substantive by looking at item1:
- item1 <- item1 # Large list (7 elements, 537.4 Kb)
- first_claim1 <- get_property(id = names(item1$claims)[1]) # List of 1
Wikidata and "United States Congress (Q11268)" edit
For the US Congress, I tried the following:
- USCongress <- get_item('Q11268') # List of 1
- USCongress1 <- USCongress1 # List of 7
I could not see how to proceed from here, apart from asking others like you.
Other postings edit
Before posting here, did the following:
- Sent an email to Duncan Temple Lang <duncan@wald.ucdavis.edu>, maintainer for RCurl, as I mentioned above.
- Sent an email to Julia Silge <julia.silge@gmail.com>, lead author of "Text Mining in R: A Tidy Approach" (https://juliasilge.com/blog/rstudio-conf).
- Asked about this at w:Talk:Current members of the United States Senate#Computer-readable list of the Current members of the US House & Senate?
- Asked about this at Wikidata:Requests for comment/Members of the US Congress?
So far I've only heard back from Duncan Temple Lang, whose reply was noted above. I plan to try his suggestion next. That may help with the US House but not the Senate.
Thanks, DavidMCEddy (talk) 16:44, 11 January 2018 (UTC)