Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I'd like to get football data out of Wolfram|Alpha and into Mathematica 9, but I'm having some minor difficulty. Naturally, I'd like to know how to accomplish this task (details below), but I'm more interested in learning how I should have figured it out on my own.

TeamNames = {"Giants", "Redskins", "Cowboys", "Eagles", "Packers", 
   "Bears", "Vikings", "Lions", "Falcons", "Saints", "Panthers", 
   "Buccaneers", "49ers", "Seahawks", "Rams", "Cardinals", "Patriots",
   "Dolphins", "Bills", "Jets", "Ravens", "Bengals", "Steelers", 
   "Browns", "Texans", "Colts", "Titans", "Jaguars", "Broncos", 
   "Chargers", "Raiders", "Chiefs"};
Table[WolframAlpha[ TeamNames[[i]] <> " in 2010", 
   {{"Schedule:NFLTeamData", 1}, "ComputableData"}], 
   {i, 1, 32}]

This code gets the schedules for all but three teams (Cardinals, Bills, Texans). I'm unable to get schedules for those teams through the "WolframAlpha" command, although they are available through the web interface.

So here's the (big) question in a nutshell: how do I figure out how to phrase a WolframAlpha query so that it gets exactly what I want? Of course that question is too broad, but I mean that a best answer will not be a simple command that gets the data I want, but a route by which I could have figured it out myself.

share|improve this question
1  
No expert an Alpha, but my guess is trial and error is the only way. This question may be not constructive since your (big) question is rather broad in scope (although I hope someone can answer with authority - it would also be very interesting to hear about longterm stability of such queries). –  Yves Klett Jan 14 '13 at 15:53
    
The "big question" is completely unanswerable. Suggest the OP edit his query to remove it because it is both subjective ("What I want") and too broad (OP wants answer the cover any possible query). –  m_goldberg Jan 14 '13 at 16:16
add comment

1 Answer

Although WolframAlpha is a pretty clever engine it has troubles when dealing with ambiguous information. In your example, WolframAlpha interprets "Bills" as a given name, "Texans" as a US state and "Cardinals" as a MLB team.

enter image description here

By just adding "NFL" in your query you get the schedules of all teams:

Table[WolframAlpha[
    TeamNames[[i]] <> " in 2010 NFL", {{"Schedule:NFLTeamData", 1}, 
    "ComputableData"}], {i, 1, 32}]
share|improve this answer
    
Hmm .. so WA does not give a list of catholic cardinals extant in 2010? :) –  image_doctor Jan 14 '13 at 16:35
    
It worked for those three "problem" teams this morning, but now this is not working for some other teams, which really punctuates the question. Could it be an issue of timing out? The web form gives an "Input Interpretation", is there some way to give input in this form (to avoid misinterpretations)? –  Kevin O'Bryant Jan 15 '13 at 19:22
    
@KevinO'Bryant Try to match the way "input interpretation" stores different datasets. What I mean is that when you ask WolframAlpha to search for "Cardinals in 2010 NFL" the "input interpretation" field displays "Arizona Cardinals" and you could use this as a hint on how to ask for this sort of information. Redefine your TeamNames by substituting the team names with the longer version that matches the "input interpretation", e.g. "Arizona Cardinals" instead of just "Cardinals". –  VLC Jan 16 '13 at 7:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.