How to validate the corresponding values in two lists by shacl

Hi, all, I am learning SHACL.
In practice, I often encounter the following application scenario:
The inputValue  is in [a1, a2, ...an],
and the outputValue should be in [b1, b2, ...bn] correspondingly,
that is,  when inputValue =a[i], then outputValue should  be b[i].
Let's look at a practical example:
-----------------------------------
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:clo="http://ex.org/clothing#">

<rdf:Description rdf:about="http://ex.org/clothing/shirt">

  <clo:format> Men's shirt</clo:format>
  <clo:sizeType>
    <rdf:Alt>
      <rdf:li>Small</rdf:li>
      <rdf:li>Medium</rdf:li>
      <rdf:li>Larger</rdf:li>
      <rdf:li>XL</rdf:li>
      <rdf:li>XXL</rdf:li>
    </rdf:Alt>
  </clo:sizeType>

  <clo:bustSize>
    <rdf:Alt>                           <!--  unit:cm  tolerance: +-2 cm   -->
      <rdf:li>35 </rdf:li>
      <rdf:li>39 </rdf:li>
      <rdf:li>43 </rdf:li>
      <rdf:li>47 </rdf:li>
      <rdf:li>51 </rdf:li>
    </rdf:Alt>
  </clo:bustSize>
</rdf:Description>

</rdf:RDF>
----------------------------------------
According to the above data, for a qualified XL shirt, the bustSize should be 47+-2 (45~49).

How do I write the correct SHACL shape file in this case?
Thank you for your help.

Joylix

Received on Wednesday, 7 July 2021 14:41:17 UTC