({{, (RefLink[EntityInstance, paclet:ref/EntityInstance])[entity,qual->val] 
represents an entity whose qualifier qual has value val.}, {, (RefLink[EntityInstance, paclet:ref/EntityInstance])[entity,{(Subscript[qual, 1])->(Subscript[val, 1]),(Subscript[qual, 2])->(Subscript[val, 2]),…}] 
represents an entity whose qualifiers (Subscript[qual, i]) have values (Subscript[val, i]).}, {, (RefLink[EntityInstance, paclet:ref/EntityInstance])[entity,quantity]
represents an entity qualified by quantity.}})

OpenersNotesSection(Spacer1)Details

(RefLink[Entity, paclet:ref/Entity]) expressions can be created by using the (Key1[ctrl, ==]) interface.

A qualifier qual can be a property qualifier of an (RefLink[EntityProperty, paclet:ref/EntityProperty]) of entity, a (RefLink[QuantityVariable, paclet:ref/QuantityVariable]) or a (RefLink[Function, paclet:ref/Function]) argument.

If entity[property] returns (RefLink[Function, paclet:ref/Function])[params,body] with a parameter equal to qual, then the associated value is substituted into body and qual is dropped from params. If no parameters remain then the (RefLink[Function, paclet:ref/Function]) wrapper is removed.

OpenersPrimaryExamplesSection(Spacer1)Examples  (14)

OpenersExampleSection0(Spacer1)Basic Examples  (4)

Represent Ireland in the year 1950:

EntityInstance[Entity["Country","Ireland"],"Date"->1950]

Return its population on that date:

EntityValue[%,"Population"]

Specify values for a property that is returned as a pure function:

Entity["Solid","HalfTorus"]["SurfaceArea"]

EntityValue[
EntityInstance[Entity["Solid","HalfTorus"],{\[FormalA]->1,\[FormalC]->2}],
"SurfaceArea"
]

Specify the same values for multiple properties:

EntityValue[
EntityInstance[Entity["Solid","Ball"],\[FormalA]->1],
{"SurfaceArea","Volume"}
]

Specify values for properties that contain quantity variables:

EntityValue[
EntityInstance[(Entity["harmonic oscillator", Entity["PhysicalSystem","HarmonicOscillator1D"], "Entity[\"PhysicalSystem\", \"HarmonicOscillator1D\"]", "physical system"]),(QuantityVariable["ω", "AngularFrequency"])->(Quantity[1, "rad""/""s", radians per second, (("Radians")/("Seconds"))])],
{"Lagrangian","EquationsOfMotion"},
"PropertyAssociation"
]

Specify the mass of a substance:

EntityValue[EntityInstance[(Entity["oxygen", Entity["Chemical","MolecularOxygen"], "Entity[\"Chemical\", \"MolecularOxygen\"]", "chemical"]),(Quantity[1, "kg", kilograms, "Kilograms"])],"AbsoluteVolume"]

OpenersExampleSection1(Spacer1)Scope  (8)

OpenersExampleSubsection0(Spacer1)Property Qualifiers  (2)

Specify the properties in the year 1980 using a qualifier inside a property:

EntityValue[(Entity["Spain", Entity["Country","Spain"], "Entity[\"Country\", \"Spain\"]", "country"]),{EntityProperty["Country","Population","Date"->1980],EntityProperty["Country","PopulationGrowth","Date"->1980]}]

This is equivalent to using an entity instance with unqualified properties:

EntityValue[EntityInstance[(Entity["Spain", Entity["Country","Spain"], "Entity[\"Country\", \"Spain\"]", "country"]),"Date"->1980],{EntityProperty["Country","Population"],EntityProperty["Country","PopulationGrowth"]}]

Inapplicable qualifiers are silently ignored:

EntityValue[EntityInstance[(Entity["Spain", Entity["Country","Spain"], "Entity[\"Country\", \"Spain\"]", "country"]),"Date"->1980],"Name"]

OpenersExampleSubsection1(Spacer1)Dates  (1)

Date qualifiers in an entity instance can be specified as a rule (in the case of a single qualifier):

EntityValue[EntityInstance[Entity["Country","Ireland"],"Date"->1950],"Population"]

As a rule list:

EntityValue[EntityInstance[Entity["Country","Ireland"],{"Date"->1950}],"Population"]

Or as a (RefLink[DateObject, paclet:ref/DateObject]):

EntityValue[EntityInstance[Entity["Country","Ireland"],DateObject[{1950}]],"Population"]

OpenersExampleSubsection2(Spacer1)Pure Function Arguments  (1)

Obtain the variables appearing in solid properties:

(Entity["half\[Hyphen]torus", Entity["Solid","HalfTorus"], "Entity[\"Solid\", \"HalfTorus\"]", "solid"])[(EntityProperty["variables", EntityProperty["Solid","Variables"], "EntityProperty[\"Solid\", \"Variables\"]"])]

The properties are pure functions of the variables:

(Entity["half\[Hyphen]torus", Entity["Solid","HalfTorus"], "Entity[\"Solid\", \"HalfTorus\"]", "solid"])[{(EntityProperty["centroid", EntityProperty["Solid","Centroid"], "EntityProperty[\"Solid\", \"Centroid\"]"]),(EntityProperty["surface area", EntityProperty["Solid","SurfaceArea"], "EntityProperty[\"Solid\", \"SurfaceArea\"]"]),(EntityProperty["defining inequalities", EntityProperty["Solid","Inequalities"], "EntityProperty[\"Solid\", \"Inequalities\"]"])}]

Specify \[FormalC] to get functions of the remaining variable:

EntityValue[EntityInstance[(Entity["half\[Hyphen]torus", Entity["Solid","HalfTorus"], "Entity[\"Solid\", \"HalfTorus\"]", "solid"]),{\[FormalC]->10}],{(EntityProperty["centroid", EntityProperty["Solid","Centroid"], "EntityProperty[\"Solid\", \"Centroid\"]"]),(EntityProperty["surface area", EntityProperty["Solid","SurfaceArea"], "EntityProperty[\"Solid\", \"SurfaceArea\"]"]),(EntityProperty["defining inequalities", EntityProperty["Solid","Inequalities"], "EntityProperty[\"Solid\", \"Inequalities\"]"])}]

Specify all variables:

EntityValue[EntityInstance[(Entity["half\[Hyphen]torus", Entity["Solid","HalfTorus"], "Entity[\"Solid\", \"HalfTorus\"]", "solid"]),{\[FormalC]->10,\[FormalA]->2}],{(EntityProperty["centroid", EntityProperty["Solid","Centroid"], "EntityProperty[\"Solid\", \"Centroid\"]"]),(EntityProperty["surface area", EntityProperty["Solid","SurfaceArea"], "EntityProperty[\"Solid\", \"SurfaceArea\"]"]),(EntityProperty["defining inequalities", EntityProperty["Solid","Inequalities"], "EntityProperty[\"Solid\", \"Inequalities\"]"])}]

OpenersExampleSubsection3(Spacer1)Quantity Variable Values  (1)

Get the variables a harmonic oscillator depends on:

(Entity["harmonic oscillator", Entity["PhysicalSystem","HarmonicOscillator1D"], "Entity[\"PhysicalSystem\", \"HarmonicOscillator1D\"]", "physical system"])[(EntityProperty["system variables", EntityProperty["PhysicalSystem","SystemVariables"], "EntityProperty[\"PhysicalSystem\", \"SystemVariables\"]"])]

Specify quantity variables:

EntityValue[EntityInstance[(Entity["harmonic oscillator", Entity["PhysicalSystem","HarmonicOscillator1D"], "Entity[\"PhysicalSystem\", \"HarmonicOscillator1D\"]", "physical system"]),{QuantityVariable["m","Mass"]->1,QuantityVariable["ω","AngularFrequency"]->1}],"EquationsOfMotionSolution"]

OpenersExampleSubsection4(Spacer1)Quantities  (2)

Specify 1 mole of water:

EntityInstance[(Entity["water", Entity["Chemical","Water"], "Entity[\"Chemical\", \"Water\"]", "chemical"]),(Quantity[1, "mol", moles, "Moles"])]

Get its mass:

EntityValue[%,"AbsoluteMass"]

Compute the mass using the molar mass:

(Entity["water", Entity["Chemical","Water"], "Entity[\"Chemical\", \"Water\"]", "chemical"])[EntityProperty["Chemical","MolarMass"]](Quantity[1, "mol", moles, "Moles"])

The result is the same:

%==%%

Specify 50 grams of a croissant:

EntityInstance[
Entity["Food",{
"FoodType"->Entity["FoodType","Croissant"],
"RelativeWaterContent"->Quantity[Interval[{0,0.5}],"Grams"/"Grams"]
}],
Quantity[50,"Grams"]
]

Get the absolute vitamin A content:

%["AbsoluteVitaminAContent"]

OpenersExampleSubsection5(Spacer1)Entity Store  (1)

Register "shape" entities:

EntityRegister[EntityStore["shape"-><|
"Entities"-><|
"rectangle"-><|"variables"->{\[FormalA],\[FormalB]},"area"->Function[{\[FormalA],\[FormalB]},\[FormalA]*\[FormalB]]|>,
"disk"-><|"variables"->{\[FormalR]},"area"->Function[\[FormalR],π*\[FormalR]^2]|>
|>
|>]]

Represent a disk of radius 2 meters:

EntityInstance[Entity["shape","disk"],\[FormalR]->(Quantity[2, "m", meters, "Meters"])]

Get the area:

%["area"]

A rectangle with one side specified:

EntityInstance[Entity["shape","rectangle"],\[FormalA]->(Quantity[9, "cm", centimeters, "Centimeters"])]

The area is given as a (RefLink[Function, paclet:ref/Function]) of the other side:

%["area"]

Unregister the "shape" entities:

EntityUnregister["shape"]

OpenersExampleSection3(Spacer1)Properties & Relations  (1)

Expressions containing unknown or inapplicable instances are silently ignored:

EntityValue[
Entity["Solid","HalfTorus"],
"SurfaceArea"
]

EntityValue[
EntityInstance[Entity["Solid","HalfTorus"],{"blah"->2}],
"SurfaceArea"
]

Expressions containing multiple instances apply only to the applicable ones:

EntityValue[
EntityInstance[Entity["Solid","HalfTorus"],{"blah"->2,\[FormalA]->1}],
"SurfaceArea"
]

OpenersExampleSection4(Spacer1)Neat Examples  (1)

Get the equations of motion of a double pendulum:

eqn=EntityValue[
EntityInstance[(Entity["double pendulum", Entity["PhysicalSystem","DoublePendulum"], "Entity[\"PhysicalSystem\", \"DoublePendulum\"]", "physical system"]),{(QuantityVariable[(Subscript["l", 1]), "Length"])->1,(QuantityVariable[(Subscript["m", 1]), "Mass"])->1,(QuantityVariable[(Subscript["l", 2]), "Length"])->1,(QuantityVariable[(Subscript["m", 2]), "Mass"])->1,(QuantityVariable["g", "Acceleration"])->9.81}],
"EquationsOfMotion"
]

Choose initial conditions:

theta10=0.7;
theta20=0;

Solve the equations:

{theta1sol,theta2sol}=NDSolveValue[
Join[
eqn/.{(QuantityVariable[(Subscript["θ", 1]), "Angle"])->theta1,(QuantityVariable[(Subscript["θ", 2]), "Angle"])->theta2},
{
theta1[0]==theta10,
theta1'[0]==0,
theta2[0]==theta20,
theta2'[0]==0
}
],
{theta1,theta2},
{(QuantityVariable["t", "Time"]),0,10}
]

Plot the time evolution of the two arms:

Plot[{theta1sol[t],theta2sol[t]},{t,0,10}]

Animate the double pendulum:

Animate[
Graphics[{
Disk[{0,0},0.1],
With[{p1=RotationMatrix[theta1sol[t]].{0,-1}},{
Line[{{0,0},p1}],
Disk[p1,0.1],
With[{p2=p1+RotationMatrix[theta2sol[t]].{0,-1}},{
Line[{p1,p2}],
Disk[p2,0.1]
}]
}]
},
PlotRange->{{-3,3},{-3,1}}
],
{t,0,10},SaveDefinitions->True
]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[EntityValue, paclet:ref/EntityValue])  ▪  (RefLink[EntityProperty, paclet:ref/EntityProperty])  ▪  (RefLink[Entity, paclet:ref/Entity])  ▪  (RefLink[EntityCopies, paclet:ref/EntityCopies])  ▪  (RefLink[EntityGroup, paclet:ref/EntityGroup])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Knowledge Representation & Access, paclet:guide/KnowledgeRepresentationAndAccess])}, {▪(RefLinkPlain[Physics & Chemistry: Data and Computation, paclet:guide/PhysicsAndChemistryDataAndComputation])}})}})

({{(Spacer1), ({{(Spacer1)Related Links}, {(WebLink[DocumentationFooterIconsRelatedLinks-EIWL.png(Spacer1)An Elementary Introduction to the Wolfram Language, https://www.wolfram.com/language/elementary-introduction/16-real-world-data.html])(WebLink[: Real-World Data, https://www.wolfram.com/language/elementary-introduction/16-real-world-data.html])}})}})