Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • System Modeler

    Multidomain modeling and simulation of complex systems

  • Compute ServicesUse with Mathematica and Wolfram|One
  • AI AccessUse with Mathematica and Wolfram|One
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Wolfram|Alpha

  • Wolfram|Alpha Website
  • Wolfram|Alpha APIs

AI Products

  • Wolfram AI Ecosystem
  • Wolfram Foundation Tool
  • Wolfram Cloud MCP
  • Wolfram Local MCP
  • Agent One API
  • CAG Component APIs

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • Linguistic Understanding

Additional Deployment Options

  • Wolfram Cloud
  • Wolfram Web Engine
  • wolframscript
  • WSTPServer
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

Wolfram Consulting

Data Science, Finance & Business

  • Artificial Intelligence
  • Data Science
  • Healthcare
  • Real Estate

Engineering

  • Civil Engineering
  • Automotive Engineering
  • Sustainable Energy

Science & Technology

  • AgTech
  • Biosciences
  • Environmental Science
  • Food Science
  • Quantum Computation
  • Social and Behavioral Sciences

More Wolfram Solutions

Technology for Education

  • Research Universities
  • Colleges & Teaching Universities
  • High Schools
  • Resources for Students

Education Initiatives

  • Next-Gen EdTech
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
For AIs
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • System Modeler
    • Compute ServicesUse with Mathematica and Wolfram|One
    • AI AccessUse with Mathematica and Wolfram|One
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Wolfram|Alpha
      • Wolfram|Alpha Website
      • Wolfram|Alpha APIs
    • AI Products
      • Wolfram AI Ecosystem
      • Wolfram Foundation Tool
      • Wolfram Cloud MCP
      • Wolfram Local MCP
      • Agent One API
      • CAG Component APIs
    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • Linguistic Understanding
    • Additional Deployment Options
      • Wolfram Cloud
      • Wolfram Web Engine
      • wolframscript
      • WSTPServer
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions
    • Wolfram Consulting

    Data Science, Finance & Business

    • Artificial Intelligence
    • Data Science
    • Healthcare
    • Real Estate

    Engineering

    • Civil Engineering
    • Automotive Engineering
    • Sustainable Energy

    Science & Technology

    • AgTech
    • Biosciences
    • Environmental Science
    • Food Science
    • Quantum Computation
    • Social and Behavioral Sciences

    More Wolfram Solutions

    Technology for Education

    • Research Universities
    • Colleges & Teaching Universities
    • High Schools
    • Resources for Students

    Education Initiatives

    • Next-Gen EdTech
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • For AIs
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
EntityFunction
  • See Also
    • EntityProperty
    • EntityValue
    • Function
    • Association
    • ExtendedEntityClass
  • Related Guides
    • Knowledge Representation & Access
    • Database Connectivity
    • Engineering Data
    • Working with Information in Relational Databases
    • Life Sciences & Medicine: Data & Computation
    • People & History
    • Cultural Data
    • Transportation Data
    • Internet and Computer Systems Data
    • Physics & Chemistry: Data and Computation
    • Astronomical Computation & Data
  • Tech Notes
    • Relational Databases Quick Start
    • See Also
      • EntityProperty
      • EntityValue
      • Function
      • Association
      • ExtendedEntityClass
    • Related Guides
      • Knowledge Representation & Access
      • Database Connectivity
      • Engineering Data
      • Working with Information in Relational Databases
      • Life Sciences & Medicine: Data & Computation
      • People & History
      • Cultural Data
      • Transportation Data
      • Internet and Computer Systems Data
      • Physics & Chemistry: Data and Computation
      • Astronomical Computation & Data
    • Tech Notes
      • Relational Databases Quick Start

EntityFunction[x,body]

is a function with a single formal parameter x, to be used in EntityValue and related functions.

EntityFunction[{x1,x2,…},body]

is an EntityFunction with a list of formal parameters.

Details
Details and Options Details and Options
Examples  
Basic Examples  
Properties & Relations  
Possible Issues  
See Also
Tech Notes
Related Guides
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • EntityProperty
    • EntityValue
    • Function
    • Association
    • ExtendedEntityClass
  • Related Guides
    • Knowledge Representation & Access
    • Database Connectivity
    • Engineering Data
    • Working with Information in Relational Databases
    • Life Sciences & Medicine: Data & Computation
    • People & History
    • Cultural Data
    • Transportation Data
    • Internet and Computer Systems Data
    • Physics & Chemistry: Data and Computation
    • Astronomical Computation & Data
  • Tech Notes
    • Relational Databases Quick Start
    • See Also
      • EntityProperty
      • EntityValue
      • Function
      • Association
      • ExtendedEntityClass
    • Related Guides
      • Knowledge Representation & Access
      • Database Connectivity
      • Engineering Data
      • Working with Information in Relational Databases
      • Life Sciences & Medicine: Data & Computation
      • People & History
      • Cultural Data
      • Transportation Data
      • Internet and Computer Systems Data
      • Physics & Chemistry: Data and Computation
      • Astronomical Computation & Data
    • Tech Notes
      • Relational Databases Quick Start

EntityFunction

EntityFunction[x,body]

is a function with a single formal parameter x, to be used in EntityValue and related functions.

EntityFunction[{x1,x2,…},body]

is an EntityFunction with a list of formal parameters.

Details

  • EntityFunction[x, body] behaves exactly like an EntityProperty and can be used directly in EntityValue.
  • In EntityFunction[x,body], x is usually bound to a single Entity at a time. The second argument of AggregatedEntityClass is an exception to this rule, since the formal parameter will bind to each group of entities.
  • In the context of the second argument of AggregatedEntityClass for relational-database-backed entities, the following aggregation functions are supported:
  • Minminimum of values
    Maxmaximum of values
    Lengthnumber of values
    Totalsum of values
    Meanthe mean value
    StandardDeviationsample standard deviation
    Variancesample variance
  • EntityFunction[{left,right},body] can appear as the condition for CombinedEntityClass. Here, left will bind to each Entity in the first argument of CombinedEntityClass and right to each Entity in the second argument.
  • When dealing with entities registered in a relational-database-backed EntityStore, only the following forms can be compiled to SQL:
  • a+badditions between numbers, dates and time quantities
    a-bdifferences between numbers or dates
    a*bmultiplications between numbers
    a/bratios between numbers
    a^bpowers between numbers
    Quotient[a,b]integer division
    Mod[a,b]remainder of division between integers
    Sqrt[a]square root
    Exp[a]exponential of numbers
    Log,Log10,Log2logarithms in different bases
    Abs[a]absolute value
    OddQ[a],EvenQ[a]parity checks on integers
    ab,a>b,a≠b,…comparisons between numbers, dates, strings
    a&&b,a||b,!a,…Boolean algebra
    If[a,b,c]if statements
    Which[…]which statements
    MissingQ[a]check whether an element is missing
    Length[list]0check whether a list is empty
    OrderedQ[a,b]check the alphabetical order of strings
    MemberQ[list,a]check whether an element is in a list or an entity in a class
    StringJoin[a,b,…]string concatenation
    StringMatchQ[…],StringStartsQ[…],…basic string matching operations
    Now,Todaygetting the current date
    AllTrue,AnyTrueBoolean operations on lists
    SelectFirst[list,Not@*MissingQ]select the first non-missing value in a list
    BitNot,BitAnd,BitOr,BitShiftLeft,…bitwise operations
    Sin,Cos,Tan,…trigonometric functions
    ArcSin,ArcCos,ArcTan,…inverse trigonometric functions
    Sinh,Cosh,Tanh,…hyperbolic functions
    ArcSinh,ArcCosh,ArcTanhinverse hyperbolic functions
    Round,Floor,Ceilingrounding functions
    Min,Maxminimum and maximum (outside aggregations)
    StringTake,StringDropextract a subpart of a string (including UpTo support)
    ToString[a]convert a number or date to string
    N[a]convert an integer to real
    IntegerPart[a]extract the integer part of a real number
    FromDigits[a]convert a string to integer
    Boole[a]convert a Boolean to 0 or 1
    Interpreter["StructuredDate"][a],Interpreter["StructuredTime"][a],Interpreter["StructuredDateTime"][a]convert a string to date or time object
    UnixTime[a]convert a date object with time to a number
    FromUnixTime[a]convert a number to a date object with time
    JulianDate[a]convert a date object to a number
    FromJulianDate[a]convert a number to a date object
    DateValue[a,"SecondsFromMidnight"]convert a time object to a number
    DateValue[UnixTime[a],"TimeObject"]convert a number to a time object
  • In the context of relational-database-backed entities, the functions above might have limited functionality with respect to their Wolfram Language counterpart. For example, SQL lacks support for complex numbers; because of this, the domains of numerical functions are limited to regions where they are real valued. Symbolic evaluation is generally not available. Precision-tracking semantics may also vary.

Examples

open all close all

Basic Examples  (3)

Compute the ratio between atomic mass and atomic number for all noble gases:

Wolfram Language code: EntityValue[EntityClass["Element", "NobleGas"], EntityFunction[e, N[e["AtomicMass"] / e["AtomicNumber"]]]]

EntityFunction can be applied directly to a single entity, like EntityProperty:

Wolfram Language code: EntityFunction[c, c[EntityProperty["Country", "LivestockPopulation", {"FAOLivestockType" -> "Sheep"}]] / c[EntityProperty["Country", "Population"]]][Entity["Country", "Ireland"]]

Use EntityFunction as a condition for FilteredEntityClass:

Wolfram Language code: EntityList[FilteredEntityClass["Country", EntityFunction[c, c["Population"] > Quantity[10^8, "People"]]]]

Properties & Relations  (6)

Use in ExtendedEntityClass to add a new computed property:

Wolfram Language code: ExtendedEntityClass[EntityClass["Country", "G8"], "AdultFraction" -> EntityFunction[c, c["AdultPopulation"] / c["Population"]]]["AdultFraction"]

Use in FilteredEntityClass as a predicate to select certain entities:

Wolfram Language code: EntityList[FilteredEntityClass["Country", EntityFunction[c, c["Population"] > Quantity[1*10^8, "People"] || c["Continent"] === EntityClass["Country", "Oceania"]]]]

Use in SortedEntityClass as a sorting criterion:

Wolfram Language code: EntityList[SortedEntityClass[EntityClass["Country", "Europe"], EntityFunction[c, c[EntityProperty["Country", "LivestockPopulation", {"FAOLivestockType" -> "Sheep"}]] / c[EntityProperty["Country", "Population"]] -> "Descending"], 3]]

Use in the second argument of AggregatedEntityClass as an aggregator:

Wolfram Language code: AggregatedEntityClass["Country", "TotalPopulation" -> EntityFunction[e, Total[e[EntityProperty["Country", "Population"]]]]]["TotalPopulation"]

Use in the third argument of AggregatedEntityClass as a grouping criterion:

Wolfram Language code: AggregatedEntityClass["Country", "MeanArea" -> EntityFunction[e, Mean[e["Area"]]], "RoundedPopulation" -> EntityFunction[c, Round[c["Population"], 100000000]]][{"RoundedPopulation", "MeanArea"}]

Use in CombinedEntityClass as a combining criterion:

Wolfram Language code: CombinedEntityClass["Isotope", EntityClass["Element", "Period1"], EntityFunction[{i, e}, i["AtomicMass"] < e["AtomicMass"]]][{EntityProperty["Isotope", "Name"], EntityProperty["Element", "Name"]}]

Possible Issues  (1)

SQL doesn't support all operations supported by the Wolfram Language:

Wolfram Language code: EntityRegister[EntityStore[RelationalDatabase[FindFile["ExampleData/ecommerce-database.sqlite"]]]]
Wolfram Language code: EntityFunction[e, ToUpperCase[e["firstName"]]][EntityClass["employees", {}]]

Mathematical operations in SQL only support real numbers; performing operations that would return a complex number might result in Missing or a runtime error, depending on the backend:

Wolfram Language code: EntityFunction[p, Sqrt[-p["amount"]]][EntityClass["payments", {}]]//Short

SQL doesn't support returning anything but scalars from properties or EntityFunction:

Wolfram Language code: EntityClass["customers", {}][EntityFunction[c, c["payments"]["amount"]]]

See Also

EntityProperty  EntityValue  Function  Association  ExtendedEntityClass

Tech Notes

    ▪
  • Relational Databases Quick Start

Related Guides

    ▪
  • Knowledge Representation & Access
  • ▪
  • Database Connectivity
  • ▪
  • Engineering Data
  • ▪
  • Working with Information in Relational Databases
  • ▪
  • Life Sciences & Medicine: Data & Computation
  • ▪
  • People & History
  • ▪
  • Cultural Data
  • ▪
  • Transportation Data
  • ▪
  • Internet and Computer Systems Data
  • ▪
  • Physics & Chemistry: Data and Computation
  • ▪
  • Astronomical Computation & Data

History

Introduced in 2019 (12.0) | Updated in 2020 (12.1)

Wolfram Research (2019), EntityFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/EntityFunction.html (updated 2020).

Text

Wolfram Research (2019), EntityFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/EntityFunction.html (updated 2020).

CMS

Wolfram Language. 2019. "EntityFunction." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/EntityFunction.html.

APA

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

BibTeX

@misc{reference.wolfram_2026_entityfunction, author="Wolfram Research", title="{EntityFunction}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/EntityFunction.html}", note=[Accessed: 01-September-2026]}

BibLaTeX

@online{reference.wolfram_2026_entityfunction, organization={Wolfram Research}, title={EntityFunction}, year={2020}, url={https://reference.wolfram.com/language/ref/EntityFunction.html}, note=[Accessed: 01-September-2026]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • AI Access
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English