Wolfram Computation Meets Knowledge

The Wolfram Language:
Fast Introduction for Programmers

Show additional notes for:
All sections 
Get Started

Real-World Entities View as Video

Notes for Java programmers:

Entities in the Wolfram Language combine natural-language processing, high-level data semantics and knowledgebase access to unify real-world data representation in a unique way that enables new kinds of programming workflows.

Notes for Python programmers:

Entities in the Wolfram Language combine natural language processing, high-level data semantics and knowledgebase access to unify real-world data representation in a unique way. Together with the tightly integrated notebook system, Wolfram Language entities enable new and expressive kinds of programming workflows not readily available in Python.

In the Wolfram Language, real-world entities are just another kind of symbolic expression.

The Wolfram Language knows about thousands of kinds of real-world entities:

It's usually convenient to specify entities using natural language:

In[1]:=1
los angeles
Out[1]=1

Entities have many properties. Here is the value of one:

In[2]:=2
EntityValue[Entity["City", {"LosAngeles", "California", "UnitedStates"}], "Population"]
Out[2]=2

Use entity["Properties"] to find a list of properties.


When you enter natural language, the is for disambiguation:

In[1]:=1
los angeles

indicates an entity class:

In[1]:=1
EntityList[EntityClass["Country", "GermanSpeaking"]]
Out[1]=1

Enter units and measures using ctrl+=:

In[1]:=1
3 meters
Out[1]=1

InputForm shows the structure of the symbolic expression:

In[2]:=2
InputForm[%]
Out[2]=2

GeoPosition represents a geographic position:

In[1]:=1
GeoPosition[\!\(\* NamespaceBox["LinguisticAssistant", DynamicModuleBox[{WolframAlphaClient`Private`query$$ = "eiffel tower", WolframAlphaClient`Private`boxes$$ = TemplateBox[{"\"Eiffel Tower\"", RowBox[{"Entity", "[", RowBox[{"\"Building\"", ",", "\"TourEiffel\""}], "]"}], "\"Entity[\\\"Building\\\", \\\"TourEiffel\\\"]\"", "\"building\""}, "Entity"], WolframAlphaClient`Private`allassumptions$$ = {{ "type" -> "Clash", "word" -> "eiffel tower", "template" -> "Assuming \"${word}\" is ${desc1}. Use as \ ${desc2} instead", "count" -> "2", "Values" -> {{ "name" -> "Building", "desc" -> "a structure", "input" -> "*C.eiffel+tower-_*Building-"}, { "name" -> "Word", "desc" -> "a word", "input" -> "*C.eiffel+tower-_*Word-"}}}}, WolframAlphaClient`Private`assumptions$$ = {}, WolframAlphaClient`Private`open$$ = {1, 2}}, DynamicBox[ToBoxes[ AlphaIntegration`LinguisticAssistantBoxes["", 1, Dynamic[WolframAlphaClient`Private`query$$], Dynamic[WolframAlphaClient`Private`boxes$$], Dynamic[WolframAlphaClient`Private`allassumptions$$], Dynamic[WolframAlphaClient`Private`assumptions$$], Dynamic[WolframAlphaClient`Private`open$$]], StandardForm], ImageSizeCache->{183., {10., 18.}}, TrackedSymbols:>{ WolframAlphaClient`Private`query$$, WolframAlphaClient`Private`boxes$$, WolframAlphaClient`Private`allassumptions$$, WolframAlphaClient`Private`assumptions$$, WolframAlphaClient`Private`open$$}], DynamicModuleValues:>{}, UndoTrackedVariables:>{WolframAlphaClient`Private`open$$}], BaseStyle->{"Deploy"}, DeleteWithContents->True, Editable->False, SelectWithContents->True]\)]
Out[1]=1

In[2]:=2
GeoListPlot[{\!\(\* NamespaceBox["LinguisticAssistant", DynamicModuleBox[{WolframAlphaClient`Private`query$$ = "eiffel tower", WolframAlphaClient`Private`boxes$$ = TemplateBox[{"\"Eiffel Tower\"", RowBox[{"Entity", "[", RowBox[{"\"Building\"", ",", "\"TourEiffel\""}], "]"}], "\"Entity[\\\"Building\\\", \\\"TourEiffel\\\"]\"", "\"building\""}, "Entity"], WolframAlphaClient`Private`allassumptions$$ = {{ "type" -> "Clash", "word" -> "eiffel tower", "template" -> "Assuming \"${word}\" is ${desc1}. Use as \ ${desc2} instead", "count" -> "2", "Values" -> {{ "name" -> "Building", "desc" -> "a structure", "input" -> "*C.eiffel+tower-_*Building-"}, { "name" -> "Word", "desc" -> "a word", "input" -> "*C.eiffel+tower-_*Word-"}}}}, WolframAlphaClient`Private`assumptions$$ = {}, WolframAlphaClient`Private`open$$ = {1, 2}}, DynamicBox[ToBoxes[ AlphaIntegration`LinguisticAssistantBoxes["", 1, Dynamic[WolframAlphaClient`Private`query$$], Dynamic[WolframAlphaClient`Private`boxes$$], Dynamic[WolframAlphaClient`Private`allassumptions$$], Dynamic[WolframAlphaClient`Private`assumptions$$], Dynamic[WolframAlphaClient`Private`open$$]], StandardForm], ImageSizeCache->{183., {10., 18.}}, TrackedSymbols:>{ WolframAlphaClient`Private`query$$, WolframAlphaClient`Private`boxes$$, WolframAlphaClient`Private`allassumptions$$, WolframAlphaClient`Private`assumptions$$, WolframAlphaClient`Private`open$$}], DynamicModuleValues:>{}, UndoTrackedVariables:>{WolframAlphaClient`Private`open$$}], BaseStyle->{"Deploy"}, DeleteWithContents->True, Editable->False, SelectWithContents->True]\), \!\(\* NamespaceBox["LinguisticAssistant", DynamicModuleBox[{WolframAlphaClient`Private`query$$ = "Ayers Rock", WolframAlphaClient`Private`boxes$$ = TemplateBox[{"\"Uluru\"", RowBox[{"Entity", "[", RowBox[{"\"Mountain\"", ",", "\"Uluru\""}], "]"}], "\"Entity[\\\"Mountain\\\", \\\"Uluru\\\"]\"", "\"mountain\""}, "Entity"], WolframAlphaClient`Private`allassumptions$$ = {}, WolframAlphaClient`Private`assumptions$$ = {}, WolframAlphaClient`Private`open$$ = {1, 2}}, DynamicBox[ToBoxes[ AlphaIntegration`LinguisticAssistantBoxes["", 1, Dynamic[WolframAlphaClient`Private`query$$], Dynamic[WolframAlphaClient`Private`boxes$$], Dynamic[WolframAlphaClient`Private`allassumptions$$], Dynamic[WolframAlphaClient`Private`assumptions$$], Dynamic[WolframAlphaClient`Private`open$$]], StandardForm], ImageSizeCache->{130., {10., 18.}}, TrackedSymbols:>{ WolframAlphaClient`Private`query$$, WolframAlphaClient`Private`boxes$$, WolframAlphaClient`Private`allassumptions$$, WolframAlphaClient`Private`assumptions$$, WolframAlphaClient`Private`open$$}], DynamicModuleValues:>{}, UndoTrackedVariables:>{WolframAlphaClient`Private`open$$}], BaseStyle->{"Deploy"}, DeleteWithContents->True, Editable->False, SelectWithContents->True]\)}]
Out[2]=2

DateObject represents a date/time:

In[1]:=1
Sunset[Tomorrow]
Out[1]=1

In[2]:=2
InputForm[%]
Out[2]=2

Notes for Python programmers:

DateObjects are unique to the Wolfram Language and are automatically parsed for importing or exporting into other environments. In Python, there are separate libraries for easier parsing of date strings, but they must be manually split or joined.


© 2018 Wolfram. All rights reserved.