Querying Locality Detail via Collection Object

Hi @phb,

Thanks for reaching out!

I am able to build a query that returns results when searching via ‘Collection Object → Collecting Event → Locality → Locality Detail’ in the Query Builder in a copy of your database.

For example, you can see this query here (Locality Detail Test) where I searched for any cases where “Locality Detail → Island = Mo'orea” in the Algae collection and 11 results are returned.

I believe the issue may be a matter of how scoping impacts query behavior. Your database follows this institutional scoping hierarchy:

Divisions Disciplines Collection Name
Natural History Botany 1 Vascular Plants
Natural History Botany 1 Algae
Natural History Botany 2 Bryophytes
Natural History Botany 2 Lichen
Natural History Botany 2 Fungi
Natural History Tetrapods Birds
Natural History Tetrapods Herpetology
Natural History Tetrapods Mammals
Natural History Marine Invertebrates Marine Invertebrates
Natural History Fishes Fishes
Natural History Paleontology Paleontology
Natural History Entomology Entomology
Teaching and learning Teaching and Learning Teaching and Learning

Locality, Collecting Event, and Locality Detail are scoped to the Discipline level, meaning querying any of these tables directly will return all records that exist within that discipline.

Querying for all cases where ‘Island’ is not empty from one of those base tables will display results, even if no Collection Objects in the ‘Mammals’ collection are connected.

I created the Locality with Detail query to demonstrate this behavior, showing the collection name of the associated Collection Object with each Locality (via the Collecting Event relationship):bookmark:

You can test this by running the Mammals Island Query that I created, showing this result when running that query in the ‘Mammals’ collection:

I hope this clarifies things a bit! If you start from the Collecting Event or Locality side of things, you can return all records associated with a particular island or island group across collections, but querying Collection Object simply returns records from the current collection.