Wolfram Language

Knowledgebase Expansion

Access Wikipedia Content Using Wolfram Language Entities

A large and growing number of Wolfram Knowledgebase entities have been aligned to external sources, including Wikipedia.

Use WikipediaData to retrieve the pages of these entities and take the first sentence of each page.

In[1]:=
Click for copyable input
entities = {Entity["Person", "JohnLennon::cpwy3"], Entity["Species", "Species:AcinonyxJubatus"], Entity["City", {"NewYork", "NewYork", "UnitedStates"}], Entity["MusicAct", "PinkFloyd::7523m"], Entity["AdministrativeDivision", {"Florida", "UnitedStates"}]};
In[2]:=
Click for copyable input
summaries = Table[{ent, First[TextSentences[WikipediaData[ent]]]}, {ent, entities}];

Create a formatted collection of brief textual summaries about these entities.

show complete Wolfram Language input
In[3]:=
Click for copyable input
Panel[TextGrid[summaries, Background -> {Automatic, {{LightOrange, White}}}, Alignment -> Left], ImageSize -> 500]
Out[3]=

As a second example, retrieve Wikipedia articles about each past member of the Rolling Stones.

In[4]:=
Click for copyable input
stones = Entity["MusicAct", "TheRollingStones::99n5n"]["Members"]
Out[4]=
In[5]:=
Click for copyable input
stonesWiki = WikipediaData[stones];

Generate a collage of word clouds, weighted by article word counts.

show complete Wolfram Language input
In[6]:=
Click for copyable input
weightedStonesClouds = WordCount[#] -> WordCloud[DeleteStopwords[#]] & /@ DeleteMissing[stonesWiki]; ImageCollage[weightedStonesClouds, Method -> "Columns"]
Out[6]=

Related Examples

de es fr ja ko pt-br ru zh