ToEntity
✖
ToEntity
Details

- ToEntity evaluates for Wolfram Language expressions corresponding to entities of type "Character", "Chemical", "Color", "Graph", "MathematicalFunction", "PhysicalConstant", "PhysicalQuantity" and "WolframLanguageSymbol".
Examples
open allclose allBasic Examples (8)Summary of the most common use cases
Convert characters to entities:

https://wolfram.com/xid/0bdpb7jby-242x9i


https://wolfram.com/xid/0bdpb7jby-73pt33


https://wolfram.com/xid/0bdpb7jby-ih9wtp


https://wolfram.com/xid/0bdpb7jby-3g7di5


https://wolfram.com/xid/0bdpb7jby-k6zmpa


https://wolfram.com/xid/0bdpb7jby-74u1i3

Convert a molecule to an entity:

https://wolfram.com/xid/0bdpb7jby-g7asi6


https://wolfram.com/xid/0bdpb7jby-v1nslv


https://wolfram.com/xid/0bdpb7jby-h74ju7


https://wolfram.com/xid/0bdpb7jby-emozc2


https://wolfram.com/xid/0bdpb7jby-1iolfw


https://wolfram.com/xid/0bdpb7jby-jrxnln

Convert undirected graphs to entities:

https://wolfram.com/xid/0bdpb7jby-g9dgsb


https://wolfram.com/xid/0bdpb7jby-kte1xs


https://wolfram.com/xid/0bdpb7jby-lg2owl


https://wolfram.com/xid/0bdpb7jby-wt4dv9

Use ToEntity for "MathematicalFunction" entity discovery:

https://wolfram.com/xid/0bdpb7jby-4w94lx


https://wolfram.com/xid/0bdpb7jby-h3tmia


https://wolfram.com/xid/0bdpb7jby-vdsp1y


https://wolfram.com/xid/0bdpb7jby-foeb9u


https://wolfram.com/xid/0bdpb7jby-f52n2


https://wolfram.com/xid/0bdpb7jby-f77xj5

Convert a quantity to a physical constant:

https://wolfram.com/xid/0bdpb7jby-wsu9y


https://wolfram.com/xid/0bdpb7jby-17x356

Convert a mathematical constant to an entity:

https://wolfram.com/xid/0bdpb7jby-eqp4t3


https://wolfram.com/xid/0bdpb7jby-dfbcoo

Convert a Wolfram Language symbol to an entity:

https://wolfram.com/xid/0bdpb7jby-wspifb


https://wolfram.com/xid/0bdpb7jby-qyn3es


https://wolfram.com/xid/0bdpb7jby-046vpf

Scope (7)Survey of the scope of standard use cases
"Character" (1)
Convert a character to an entity:

https://wolfram.com/xid/0bdpb7jby-1m3fld


https://wolfram.com/xid/0bdpb7jby-why43x

Use FromCharacterCode:

https://wolfram.com/xid/0bdpb7jby-ctkklu

"Color" (1)
Convert a named Wolfram Language color to an entity:

https://wolfram.com/xid/0bdpb7jby-2za59d


https://wolfram.com/xid/0bdpb7jby-rrfsu1

Use a typeset form of a color:

https://wolfram.com/xid/0bdpb7jby-kb0eqp


https://wolfram.com/xid/0bdpb7jby-2fndg2

"Graph" (1)
Convert an explicitly constructed graph to an entity:

https://wolfram.com/xid/0bdpb7jby-p5zu5u

Use a graph from GraphData:

https://wolfram.com/xid/0bdpb7jby-kpcxks

Use a graph constructor function:

https://wolfram.com/xid/0bdpb7jby-j0ism

Use a programmatically constructed graph:

https://wolfram.com/xid/0bdpb7jby-umun9g

"MathematicalFunction" (1)
"PhysicalConstant" (1)
"PhysicalQuantity" (1)
"WolframLanguageSymbol" (1)
Convert a Wolfram Language symbol to an entity:

https://wolfram.com/xid/0bdpb7jby-sbleae


https://wolfram.com/xid/0bdpb7jby-t9a48v

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

https://wolfram.com/xid/0bdpb7jby-369kna


https://wolfram.com/xid/0bdpb7jby-v8zoub

Applications (1)Sample problems that can be solved with this function
Verify that all small graphs in GraphData give entities with canonical names equivalent to their standard names:

https://wolfram.com/xid/0bdpb7jby-il10sh

Properties & Relations (4)Properties of the function, and connections to other functions
For suitable graph entities, FromEntity can be used to effectively "reverse" ToEntity:

https://wolfram.com/xid/0bdpb7jby-qfk07a


https://wolfram.com/xid/0bdpb7jby-thw7sg


https://wolfram.com/xid/0bdpb7jby-yttp1h

This is similar for suitable character entities:

https://wolfram.com/xid/0bdpb7jby-6p7l5i


https://wolfram.com/xid/0bdpb7jby-wqn8kp

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

https://wolfram.com/xid/0bdpb7jby-ji15lm


https://wolfram.com/xid/0bdpb7jby-xu38pg

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

https://wolfram.com/xid/0bdpb7jby-n44a6h


https://wolfram.com/xid/0bdpb7jby-h1rqqd

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

https://wolfram.com/xid/0bdpb7jby-lqckq9


https://wolfram.com/xid/0bdpb7jby-n91bn8


https://wolfram.com/xid/0bdpb7jby-50sd1o


https://wolfram.com/xid/0bdpb7jby-3tvvyh

Possible Issues (3)Common pitfalls and unexpected behavior
Entities may not exist for all possible Wolfram Language objects of appropriate type:

https://wolfram.com/xid/0bdpb7jby-qp8enr


https://wolfram.com/xid/0bdpb7jby-c9gjw9

Some inputs may have multiple representations available:

https://wolfram.com/xid/0bdpb7jby-sm8231


https://wolfram.com/xid/0bdpb7jby-d0n7hp

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

https://wolfram.com/xid/0bdpb7jby-5thock


https://wolfram.com/xid/0bdpb7jby-myfup5

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

https://wolfram.com/xid/0bdpb7jby-pmmodg


https://wolfram.com/xid/0bdpb7jby-dompg5


https://wolfram.com/xid/0bdpb7jby-lcpulf

Neat Examples (2)Surprising or curious use cases
Check that the following embeddings all correspond to the cubical graph:

https://wolfram.com/xid/0bdpb7jby-v58on6


https://wolfram.com/xid/0bdpb7jby-1x9w3i


https://wolfram.com/xid/0bdpb7jby-8q9fym

Convert a range of special characters to entities:

https://wolfram.com/xid/0bdpb7jby-jdycks


https://wolfram.com/xid/0bdpb7jby-ym886v

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).
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.
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
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: 05-June-2025
]}
BibLaTeX
@online{reference.wolfram_2025_toentity, organization={Wolfram Research}, title={ToEntity}, year={2021}, url={https://reference.wolfram.com/language/ref/ToEntity.html}, note=[Accessed: 05-June-2025
]}