acdh-oeaw / apis-core-rdf

APIS Core refactored
https://acdh-oeaw.github.io/apis-core-rdf/
MIT License
3 stars 3 forks source link

Filtering by "related entity contains" returns more/different objects than expected #1092

Open koeaw opened 1 month ago

koeaw commented 1 month ago

Filtering by "Related Property" and "Related entity contains" doesn't seem to work 100%.

Example: Filtering Frischmuth Works by related property WorkType containing "Artikel" returns 11 objects; the "Artikel" WorkType, however, is only linked to 5 works.

It seems to me the remaining non-Artikel works are themselves linked to entirely different entity objects which contain the word "Artikel" (i.e. the relationship chain is traversed in different directions on the next level, or possibly on all levels). E.g.:

koeaw commented 1 month ago

I'll add there are two WorkTypes which contain the word "Artikel" but "Journalartikel" is currently not connected to any Works at all. The six additional work objects returned by the filter are of completely different types.

b1rger commented 1 month ago

Filtering Frischmuth Works by related property WorkType containing "Artikel" returns 11 objects; the "Artikel" WorkType, however, is only linked to 5 works.

The filtering means: give me entities that are related to entities that have "Artikel" in their name and that are somehow connected to a WorkType via has type | werktyp. It does not filter for entities that are related to werktyps with "Artikel" in their name. The two filters are combined with && but they are independent

koeaw commented 1 month ago

The two filters are combined with && but they are independent

Ohhhhh. Yeah, I was about to follow up with the question if "related entity contains" ignores whatever is selected in "related property" after testing this with a word that only appears in PhysicalObjects.

I thought the two worked in conjunction with each other. D'oh.

koeaw commented 1 month ago

Hmm, seeing as the rest of the filters are stacked/combined, I'd argue these two should follow the same pattern.

b1rger commented 1 month ago

Hmm, seeing as the rest of the filters are stacked/combined, I'd argue these two should follow the same pattern.

They are combined with all the other filters with &&.

koeaw commented 1 month ago

Hmm, seeing as the rest of the filters are stacked/combined, I'd argue these two should follow the same pattern.

They are combined with all the other filters with &&.

Yeah, but I was/am thinking of the relationship filters as stacked (on top of one another), much like the field filters for the entity itself stack.

Perhaps it would help to imagine the two fields flipped, because that's actually how I was thinking of them in my head (i.e. I thought they were arranged weirdly). First I filter by "related property" type, then I restrict that further by adding a search term on top.

Idk, this seems much more logical to me than to simultaneously filter for objects connected via a specific property and for words in objects connected via random (other) properties. But maybe let's discuss this further in person.