Desired output: a list of entities from the same class that have been filtered (e.g., they aren't missing "Image", they have a "Length" > 30 ft., or they have a "BirthDate" ? 1950).
I can accomplish this by retrieving one entity at a time, testing it, and adding it to a list if it passes the test:
dinos = {};
While[Length[dinos] < 4,
tryDino = RandomChoice[EntityList[EntityClass["Dinosaur", "DinosaurSpecies"]]];
If[! (MemberQ[dinos, tryDino] || MissingQ[EntityValue[tryDino, "Image"]]),
dinos = Append[dinos, tryDino]]];
{dinos}
In this case, I get four dinosaurs that have images, which is what I want. But I get the feeling that there is a better way to do this, something along the lines of "Get a list four dinosaurs that have images" rather than "Get one dinosaur, and if it has an image, add it to the list." I know how to use the RandomSample[] function. Is there a way to stipulate when querying the database that the entities should have certain properties or property values?
(By the way, I did search this community for answers first and found a discussion about dwarf planets that seemed to answer the question. On further investigation, though, I was unable to apply that solution to my situation.)
Thank you in advance,
Mark Greenberg