I refer to SPARQL - Find objects with the most similar properties and Sparql query: find objects with same property objects
My problem is perhaps midway between the above two: I want to find exact (not similar) matches of properties and property values. I know beforehand the input entity I want to match, but the properties are arbitrary variables (and so are the values).
I restrict the level of properties to one level (up to the type of an object value), but it would definitely be helpful to see a solution that basically finds me entity matches (based on property values).
chicago:store1 :sells :Music1 ;
:employees 2 ;
:code "123" .
:Music1 a :Music .
# should not match - # employees different
nyc:store2 :sells :Music2 ;
:employees 1 ;
:code "123" .
:Music2 a :Music .
# should not match - # code string different
nyc:store3 :sells :Music3 ;
:employees 2 ;
:code "12" .
:Music3 a :Music .
# should not match - # type of sells value is not same
nyc:store4 :sells :Music4 ;
:employees 2 ;
:code "123" .
:Music4 a :DisjointThing .
# exact match
nyc:store5 :sells :Music5 ;
:employees 2 ;
:code "123" .
:Music5 a :Music .
And a pseudoquery to demonstrate what I want:
Given the store in chicago
Find me all other stores in nyc that have exactly the same properties (no more, no less)
A similar problem also would be "list equality", whereby in this case it can be considered that there are lists of properties being compared. However, it could be that one of the properties of :store
has an actual list, like chicago:store1 :inventory "Blues" , "Rock"
. So then I'd actually be looking for list equality as well. Please feel free to ignore this last one (until we can make sense of the main problem highlighted in this question above).