I have tried several options and although I have looked at Wolfram Alpha snippets, I cannot get those to work in V11.

This link is the best I could find, but I cannot replicate it for wine, or wine grapes.

How do I find the number of countries that have a type of industry?

Any help much appreciated. I last worked in MM7 Henk

WolframAlpha["wine producing countries", 
{{"PropertyRanking:AgricultureData", 1}, "ComputableData"}, 
 PodStates -> {"PropertyRanking:AgricultureData__More"}]

(*  {{{1, "Italy", Quantity[5.287*10^6, ("ShortTons")/("Years")]}, {2, 
   "Spain", Quantity[5.079*10^6, ("ShortTons")/("Years")]}, {3, 
   "France", Quantity[4.733*10^6, ("ShortTons")/("Years")]}, {4, 
   "United States", 
   Quantity[3.638*10^6, ("ShortTons")/("Years")]}, {5, "China", 
   Quantity[1.874*10^6, ("ShortTons")/("Years")]}, {6, "Argentina", 
   Quantity[1.652*10^6, ("ShortTons")/("Years")]}, {7, "Chile", 
   Quantity[1.338*10^6, ("ShortTons")/("Years")]}, {8, "Australia", 
   Quantity[1.308*10^6, ("ShortTons")/("Years")]}, {9, "South Africa",
    Quantity[1.263*10^6, ("ShortTons")/("Years")]}, {10, "Germany", 
   Quantity[1.014*10^6, ("ShortTons")/("Years")]}, {11, "Portugal", 
   Quantity[665054, ("ShortTons")/("Years")]}, {12, "Romania", 
   Quantity[416986, ("ShortTons")/("Years")]}, {13, "Greece", 
   Quantity[368503, ("ShortTons")/("Years")]}, {14, "Russia", 
   Quantity[360897, ("ShortTons")/("Years")]}, {15, "New Zealand", 
   Quantity[353181, ("ShortTons")/("Years")]}, {16, "Brazil", 
   Quantity[301041, ("ShortTons")/("Years")]}, {17, "Hungary", 
   Quantity[284970, ("ShortTons")/("Years")]}, {18, "Austria", 
   Quantity[220318, ("ShortTons")/("Years")]}, {19, "Serbia", 
   Quantity[218459, ("ShortTons")/("Years")]}, {20, "Moldova", 
   Quantity[165181, ("ShortTons")/("Years")]}, {21, "Bulgaria", 
   Quantity[143852, ("ShortTons")/("Years")]}, {22, "Georgia", 
   Quantity[119711, ("ShortTons")/("Years")]}, {23, "Switzerland", 
   Quantity[102917, ("ShortTons")/("Years")]}, {24, "Ukraine", 
   Quantity[95795, ("ShortTons")/("Years")]}, {25, "Japan", 
   Quantity[93696, ("ShortTons")/("Years")]}, {26, "Peru", 
   Quantity[80469, ("ShortTons")/("Years")]}, {27, "Uruguay", 
   Quantity[79918, ("ShortTons")/("Years")]}, {28, "Canada", 
   Quantity[60256, ("ShortTons")/("Years")]}, {29, "Czech Republic", 
   Quantity[57320, ("ShortTons")/("Years")]}, {30, "Algeria", 
   Quantity[57320, ("ShortTons")/("Years")]}, {31, "Macedonia", 
   Quantity[56232, ("ShortTons")/("Years")]}, {32, "Croatia", 
   Quantity[49904, ("ShortTons")/("Years")]}, {33, "Turkey", 
   Quantity[49281, ("ShortTons")/("Years")]}, {34, "Mexico", 
   Quantity[43387, ("ShortTons")/("Years")]}, {35, "Turkmenistan", 
   Quantity[42990, ("ShortTons")/("Years")]}, {36, "Morocco", 
   Quantity[40786, ("ShortTons")/("Years")]}, {37, "Uzbekistan", 
   Quantity[39683, ("ShortTons")/("Years")]}, {38, "Slovakia", 
   Quantity[35855, ("ShortTons")/("Years")]}, {39, "Belarus", 
   Quantity[33047, ("ShortTons")/("Years")]}, {40, "Kazakhstan", 
   Quantity[24243, ("ShortTons")/("Years")]}, {41, "Tunisia", 
   Quantity[23700, ("ShortTons")/("Years")]}, {42, "Albania", 
   Quantity[19290, ("ShortTons")/("Years")]}, {43, "Montenegro", 
   Quantity[17637, ("ShortTons")/("Years")]}, {44, "Lebanon", 
   Quantity[16204, ("ShortTons")/("Years")]}, {45, "Slovenia", 
   Quantity[14582, ("ShortTons")/("Years")]}, {46, "Colombia", 
   Quantity[14330, ("ShortTons")/("Years")]}, {47, "Luxembourg", 
   Quantity[13772, ("ShortTons")/("Years")]}, {48, "Cuba", 
   Quantity[13316, ("ShortTons")/("Years")]}, {49, "Estonia", 
   Quantity[12240, ("ShortTons")/("Years")]}, {50, "Cyprus", 
   Quantity[11356, ("ShortTons")/("Years")]}, {51, "Azerbaijan", 
   Quantity[10485, ("ShortTons")/("Years")]}, {52, "Bolivia", 
   Quantity[10386, ("ShortTons")/("Years")]}, {53, "Madagascar", 
   Quantity[9204, ("ShortTons")/("Years")]}, {54, 
   "Bosnia and Herzegovina", 
   Quantity[8294, ("ShortTons")/("Years")]}, {55, "Armenia", 
   Quantity[6806, ("ShortTons")/("Years")]}, {56, "Lithuania", 
   Quantity[6619, ("ShortTons")/("Years")]}, {57, "Israel", 
   Quantity[5512, ("ShortTons")/("Years")]}, {58, "Egypt", 
   Quantity[5512, ("ShortTons")/("Years")]}, {59, "Belgium", 
   Quantity[3197, ("ShortTons")/("Years")]}, {60, "Libya", 
   Quantity[2910, ("ShortTons")/("Years")]}, {61, "Latvia", 
   Quantity[2701, ("ShortTons")/("Years")]}, {62, "Malta", 
   Quantity[2674, ("ShortTons")/("Years")]}, {63, "Zimbabwe", 
   Quantity[1929, ("ShortTons")/("Years")]}, {64, "Kyrgyzstan", 
   Quantity[1874, ("ShortTons")/("Years")]}, {65, "Paraguay", 
   Quantity[1653, ("ShortTons")/("Years")]}, {66, "Ethiopia", 
   Quantity[1430, ("ShortTons")/("Years")]}, {67, "Jordan", 
   Quantity[606.3, ("ShortTons")/("Years")]}, {68, "United Kingdom", 
   Quantity[468.5, ("ShortTons")/("Years")]}, {69, "Panama", 
   Quantity[175.3, ("ShortTons")/("Years")]}, {70, "Tajikistan", 
   Quantity[165.3, ("ShortTons")/("Years")]}, {71, "Liechtenstein", 
   Quantity[87.08, ("ShortTons")/("Years")]}, {72, "Syria", 
   Quantity[77.16, ("ShortTons")/("Years")]}, {73, "Réunion", 
   Quantity[33.07, ("ShortTons")/(
    "Years")]}}, "1969, 2013, and 2014 estimates"}  *)
  • $\begingroup$ Excellent! This shows me how to use Wolfram Alpha directly. Two countries are missing though, Mianmar and Thailand if I am not mistaken. Still, this is the best approach for this specific problem it seems. Question is, how can I do exactly this from Mathematica without using Alpha? (Without calling as above?) $\endgroup$
    – Henk
    Feb 8 '17 at 1:58
 Not@FreeQ[CountryData[#, "MajorIndustries"], "Wine"] &]

{Entity["Country", "Georgia"], Entity["Country", "Lebanon"], Entity["Country", "Portugal"], Entity["Country", "SanMarino"]}

Presumably "MajorIndustries" selects the largest $n$ industries in the country and for France, Italy, USA, etc., viticulture (as distinct from "Food") does not lie in that top $n$.

For instance,

CountryData[Entity["Country", "France"], "MajorIndustries"]


(* {"Aircraft", "Automobiles", "Chemicals", "Electronics", "Food", "Machinery", "Metals", "Textiles", "Tourism"} *)

(notice these are in alphabetical order) and

CountryData[Entity["Country", "Italy"], "MajorIndustries"]


(* {"Automobiles", "Ceramics", "Chemicals", "Clothing", "Food", "Iron", "Machinery", "Metals", "Shoes", "Textiles", "Tourism"} *)

We can be sure that the returned order is not ranked by commercial value by this example:

CountryData[Entity["Country", "SaudiArabia"], "MajorIndustries"]

(* {"AircraftRepairs", "Ammonia", "BuildingMaterials", "Construction", "Fertilizer", "IndustrialGases", "Metals", "Oil", "Petrochemicals", "Plastics", "ShipRepair", "SodiumHydroxide"} *)

which lists "Ammonia" far before "Oil".

  • $\begingroup$ There's also "ExportCommodities" $\endgroup$
    – ngenisis
    Feb 8 '17 at 0:31
  • $\begingroup$ Even ExportCommodities does not list wine (or even food) for France. $\endgroup$ Feb 8 '17 at 0:32
  • $\begingroup$ Unfortunate, but it does pick up Chile :P $\endgroup$
    – ngenisis
    Feb 8 '17 at 0:34
  • $\begingroup$ Yes, this is actually a problem, so although the data is curated in some form, it is not very coherent. Just wait until France discovers that wine is not a major thing! Thanks, this does help a lot though. $\endgroup$
    – Henk
    Feb 8 '17 at 1:55
  • $\begingroup$ The University of Adelaide has an extensive document on wien producing countries. It would be cool to get that into Wolfram. $\endgroup$
    – Henk
    Feb 19 '17 at 1:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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