Comparing shapes

Hello,

I am looking for a way to compare shapes in terms of their sets of valid 
nodes.

For nodes A and B in an RDF graph, I have sets S(A) and S(B) of shapes 
that target A or B, respectively. I am interested in the relationship of 
the sets V(S(A)) and V(S(B)) of valid nodes according to those shapes, 
*without looking at data*. I would like to know: do the sets of valid 
nodes overlap, is one contained in the other, or are they disjunct. Is 
there an algorithm that allows me to calculate that?

I don't think there is, so as a pragmatic (and not very interesting) 
proxy for this functionality, I'll compare S(A) and S(B) element-wise 
(i.e. shape by shape), for equivalence, which allows for calculating the 
set relationships I am interested in. If all shapes in S(A) have an 
equivalent shape in S(B) and vice versa, the sets are identical, if 
there are extra shapes in one of them, it is contained in the other, if 
there are extra shapes in both, they overlap, if there are no equivalent 
ones, they are disjunct. For this, however, I need a way to compare 
shapes for equality. My idea for the comparison would be to check if the 
subgraphs reachable via predicates from the SHACL vocabulary, starting 
from the shapes' main nodes are isomorphic. Is there a better way to 
check for equivalence? Is there a reason why this whole approach might 
not work?

Thanks!

Florian

Received on Saturday, 5 March 2022 09:26:54 UTC