diff --git a/tests/unit/dataclasses/test_shape_collection.py b/tests/unit/dataclasses/test_shape_collection.py index ed04c085..8d310a11 100644 --- a/tests/unit/dataclasses/test_shape_collection.py +++ b/tests/unit/dataclasses/test_shape_collection.py @@ -189,3 +189,12 @@ def test_shape_to_query(clean_building_motif): "?target ?label" in query5 ), query5 assert "UNION" in query5, query5 + + query6 = sc.shape_to_query(URIRef("urn:shapes_to_query/test_sh_or")) + assert ( + "?target " + ), query6 + assert ( + "?target " + ), query6 + assert "UNION" in query6, query6 diff --git a/tests/unit/fixtures/shape_to_query/shapes.ttl b/tests/unit/fixtures/shape_to_query/shapes.ttl index ec3f8f22..b58c0a73 100644 --- a/tests/unit/fixtures/shape_to_query/shapes.ttl +++ b/tests/unit/fixtures/shape_to_query/shapes.ttl @@ -67,6 +67,23 @@ ] ; . +:test_sh_or a sh:NodeShape, owl:Class ; + sh:targetClass brick:Sensor ; + sh:or ( [ + sh:property [ + sh:name "unit" ; + sh:path brick:hasUnits ; + sh:hasValue unit:DEG_C ; + ] ; + ] [ + sh:property [ + sh:name "unit" ; + sh:path brick:hasUnits ; + sh:hasValue unit:DEG_F ; + ] ; + ] ) + . + :subjectTarget a sh:NodeShape, owl:Class ; sh:targetSubjectsOf brick:hasPoint ; sh:property [