How to use an EntityClass
This is more of a workaround. If you're willing and able to preload the data, you could create your own custom Entity
type with EntityStore
and treat it as if it were a built in.
Your data:
bport = Entity["City", {"Brockport", "NewYork", "UnitedStates"}]["Position"];
ps = EntityClass["PublicSchool", {"USState", "NewYork"}];
The nearby schools, per Jose's comment above:
ents = GeoNearest[ps, bport, 100];
Create the custom entity. For brevity I omit custom labels, properties, classes, etc.
store = EntityStore[
"NearbyPublicSchools" -> <|
"Entities" -> EntityValue[ents, "EntityPropertyAssociation"]
|>
];
EntityRegister[store];
Query as if it were a built in type. For example:
largefaculty = EntityClass["NearbyPublicSchools",
{"TotalTeachers" -> GreaterThan[Quantity[50, "People"]]}];
largefaculty["EntityCount"]
28
GeoListPlot[largefaculty]
Here's another workaround, but unfortunately your example returns Missing["QueryTooSlow"]
.
EntityClass["PublicSchool",
{"Entity" -> ps, "TotalTeachers" -> GreaterThan[Quantity[200, "People"]]}
]["EntityCount"]
Missing["QueryTooSlow", {"PublicSchool", {EntityProperty["PublicSchool", "Entity"] -> EntityClass["PublicSchool", {"USState", "NewYork"}]}}]
Here's a smaller example:
EntityClass["Lattice",
{"Entity" -> EntityClass["Lattice", "Even"], "Determinant" -> GreaterThan[10]}
]["EntityCount"]
6