Trying to find if there is a property that connects two arbitrary entities on Wikidata. This works fine, unless one of the entities is in a list for the other entity. In this case only the first entity in the list is seen as being connected to the other. For example: 'Python' and 'object-based language' (first in the list for property 'instance of') return a property, but 'Python' and 'programming language' do not.
SELECT ?prop
WHERE {
wd:Q28865 ?prop wd:Q9143.
}
How to make this work for all entities in such a list?