({{, (RefLink[SampledEntityClass, paclet:ref/SampledEntityClass])[class,n] 
represents an entity class containing n entities from class.}, {, (RefLink[SampledEntityClass, paclet:ref/SampledEntityClass])[class,{m,n}]
represents an entity class containing entities m through n of class.}})

OpenersNotesSection(Spacer1)Details

(RefLink[SampledEntityClass, paclet:ref/SampledEntityClass])[class,n] gives the first n entities from the internal representation of class. This representation may change when operations are done on class.

(RefLink[SampledEntityClass, paclet:ref/SampledEntityClass])[(RefLink[SortedEntityClass, paclet:ref/SortedEntityClass])[class,…],n] gives the first n entities from class with an ordering defined by (RefLink[SortedEntityClass, paclet:ref/SortedEntityClass]).

If class contains fewer than n entities, (RefLink[SampledEntityClass, paclet:ref/SampledEntityClass])[class,n] is equivalent to class.

OpenersPrimaryExamplesSection(Spacer1)Examples  (7)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Use (RefLink[SampledEntityClass, paclet:ref/SampledEntityClass]) to look at the first few entities:

EntityList[SampledEntityClass["Dinosaur", 2]]

Use (RefLink[SampledEntityClass, paclet:ref/SampledEntityClass]) to look at the following entities by specifying an offset:

EntityList[SampledEntityClass["Dinosaur", {3,4}]]

When used with relational-database-backed entities, (RefLink[SampledEntityClass, paclet:ref/SampledEntityClass]) is compiled to LIMIT and OFFSET statements:

EntityRegister[EntityStore[RelationalDatabase[FindFile["ExampleData/ecommerce-database.sqlite"]]]]

SampledEntityClass["employees" , 2]["firstName"]

OpenersExampleSection1(Spacer1)Scope  (1)

Whenever there are more entities than requested, all of the entities are returned:

SampledEntityClass[EntityClass["Country", "GroupOf8"],10]//EntityList

OpenersExampleSection3(Spacer1)Properties & Relations  (2)

When (RefLink[SampledEntityClass, paclet:ref/SampledEntityClass]) is applied to (RefLink[SortedEntityClass, paclet:ref/SortedEntityClass]):

EntityList[SampledEntityClass[SortedEntityClass["Dinosaur",(EntityProperty["full length", EntityProperty["Dinosaur","Length"], "EntityProperty[\"Dinosaur\", \"Length\"]"])-> "Descending"] , 2]]

The same class can be more simply expressed by using (RefLink[SortedEntityClass, paclet:ref/SortedEntityClass]) with three arguments:

EntityList[SortedEntityClass["Dinosaur",(EntityProperty["full length", EntityProperty["Dinosaur","Length"], "EntityProperty[\"Dinosaur\", \"Length\"]"])-> "Descending", 2]]

Some entity types support the special property "SampleEntities":

EntityValue["Country" ,"SampleEntities"]

(RefLink[SampledEntityClass, paclet:ref/SampledEntityClass]) can also be used on various types of entity classes:

SampledEntityClass[EntityClass["Country", "GroupOf8"],3]//EntityList

OpenersExampleSection4(Spacer1)Neat Examples  (1)

Create an image collage of 16 elements:

ImageCollage[SampledEntityClass["Element", 16]["Image"]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[EntityValue, paclet:ref/EntityValue])  ▪  (RefLink[EntityList, paclet:ref/EntityList])  ▪  (RefLink[EntityStore, paclet:ref/EntityStore])  ▪  (RefLink[RandomSample, paclet:ref/RandomSample])  ▪  (RefLink[Take, paclet:ref/Take])  ▪  (RefLink[UpTo, paclet:ref/UpTo])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Working with Information in Relational Databases, paclet:guide/WorkingWithRelationalDatabases])}, {▪(RefLinkPlain[Knowledge Representation & Access, paclet:guide/KnowledgeRepresentationAndAccess])}})}})