I am in EDG trying to find instances where another Concept has the exact same values for the property (no more or less). The values can be inherited through skos:broader or directly stated on the concept itself. The property connects to a blank node which contains 2 additional properties and values.
Example:
ConceptA ex:category [ex:map ex:default ;
ex:attribute ex:S03.01] ;
[ex:map ex:alternate ;
ex:attribute ex:S03.02] .
ConceptB ex:category [ex:map ex:default ;
ex:attribute ex:S03.01] ;
[ex:map ex:alternate ;
ex:attribute ex:S03.02] .
ConceptC ex:category [ex:map ex:default ;
ex:attribute ex:S03.01] .
ConceptD ex:category [ex:map ex:default ;
ex:attribute ex:S03.01] ;
[ex:map ex:alternate ;
ex:attribute ex:S03.02] ;
[ex:map ex:alternate ;
ex:attribute ex:S03.03] .
I want to return both ConceptA and ConceptB but not ConceptC or ConceptD since it doesn't match ConceptA exactly.
I have tried different variations of a sparql query shown below (removed FILTER clause) but haven't been able to return the results I am expecting.
SELECT DISTINCT $this ?concept ?map ?attr
WHERE { $this skos:broader*/ex:category ?blank .
?blank ex:map ?map ;
ex:attribute ?attr .
?concept skos:broader*/ex:category ?blank1 .
?blank1 ex:map ?map ;
ex:attribute ?attr .
FILTER(?concept != $this)
}
#find concept with the same modeling
SELECT DISTINCT $this ?map ?attr
WHERE { $this skos:broader*/ex:category ?blank .
?blank ex:map ?map ;
ex:attribute ?attr .
FILTER EXISTS{?concept skos:broader*/ex:category ?blank1 .
?blank1 ex:map ?map ;
ex:attribute ?attr .
FILTER(?concept != $this)}
}