WOLFRAM

Enable JavaScript to interact with content and submit forms on Wolfram websites. Learn how
Wolfram Language & System Documentation Center

ToEntity [expr]

returns an entity object corresponding to the given expression.

ToEntity [expr,type]

returns an entity object of the specified type corresponding to expr.

Details
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
"Character"  
"Color"  
"Graph"  
Show More Show More
"MathematicalFunction"  
"PhysicalConstant"  
"PhysicalQuantity"  
"WolframLanguageSymbol"  
Applications  
Properties & Relations  
Possible Issues  
Neat Examples  
See Also
Related Guides
History
Cite this Page

ToEntity [expr]

returns an entity object corresponding to the given expression.

ToEntity [expr,type]

returns an entity object of the specified type corresponding to expr.

Details

Examples

open all close all

Basic Examples  (5)

Convert a molecule to an entity:

Convert colors to entities:

Convert undirected graphs to entities:

Convert a quantity to a physical constant:

Convert a Wolfram Language symbol to an entity:

Scope  (9)

"Character"  (2)

Convert a character to an entity:

Use FromCharacterCode :

Convert characters to entities:

"Color"  (1)

Convert a named Wolfram Language color to an entity:

Use a typeset form of a color:

"Graph"  (1)

Convert an explicitly constructed graph to an entity:

Use a graph from GraphData :

Use a graph constructor function:

Use a programmatically constructed graph:

"MathematicalFunction"  (2)

Convert a Mathematica special function to an entity:

Convert a Mathematica special function expression to an entity:

Use ToEntity for "MathematicalFunction" entity discovery:

"PhysicalConstant"  (1)

Convert a quantity representing a physical constant to an entity:

Use a quantity with unit multiplier:

"PhysicalQuantity"  (1)

Convert a quantity variable to an entity:

"WolframLanguageSymbol"  (1)

Convert a Wolfram Language symbol to an entity:

Use a second argument to specify the type of entity desired:

Applications  (1)

Verify that all small graphs in GraphData give entities with canonical names equivalent to their standard names:

Properties & Relations  (4)

For suitable graph entities, FromEntity can be used to effectively "reverse" ToEntity :

This is similar for suitable character entities:

When a GraphData standard name is known, ToEntity is equivalent to the GraphData "Entity" property:

The result of ToEntity is typically Entity ["type","canonicalname"]:

The canonical name of a character entity is typically the value returned by ToCharacterCode :

Possible Issues  (3)

Entities may not exist for all possible Wolfram Language objects of appropriate type:

Some inputs may have multiple representations available:

The second argument can be used to specify to which type the input should be converted:

Specifying different arguments to same symbol may result in different "MathematicalFunction" entities:

Neat Examples  (2)

Check that the following embeddings all correspond to the cubical graph:

Convert a range of special characters to entities:

Wolfram Research (2014), ToEntity, Wolfram Language function, https://reference.wolfram.com/language/ref/ToEntity.html (updated 2021).

Text

Wolfram Research (2014), ToEntity, Wolfram Language function, https://reference.wolfram.com/language/ref/ToEntity.html (updated 2021).

CMS

Wolfram Language. 2014. "ToEntity." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/ToEntity.html.

APA

Wolfram Language. (2014). ToEntity. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ToEntity.html

BibTeX

@misc{reference.wolfram_2025_toentity, author="Wolfram Research", title="{ToEntity}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/ToEntity.html}", note=[Accessed: 04-January-2026]}

BibLaTeX

@online{reference.wolfram_2025_toentity, organization={Wolfram Research}, title={ToEntity}, year={2021}, url={https://reference.wolfram.com/language/ref/ToEntity.html}, note=[Accessed: 04-January-2026]}

Top [フレーム]

AltStyle によって変換されたページ (->オリジナル) /