Skip to content

Commit 3abf7c7

Browse files
committed
fixed example and exercise queries
1 parent 91be6cf commit 3abf7c7

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

examples/semantic_annotations.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ from semantic_digital_twin.reasoning.predicates import ContainsType
167167
from krrood.entity_query_language.entity import a
168168
169169
with symbolic_mode():
170-
fruit_box_query = a(fb := FruitBox(), ContainsType(fb.fruits, Apple))
170+
fb = let(FruitBox, domain=world.semantic_annotations)
171+
fruit_box_query = a(fb, ContainsType(fb.fruits, Apple))
171172
172173
query_result = fruit_box_query.evaluate()
173174
print(list(query_result)[0] == fruit_box_with_apples)

self_assessment/exercises/5_semantic_annotations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,12 @@ Your goals:
223223
```{code-cell} ipython3
224224
:tags: [example-solution]
225225
with symbolic_mode():
226+
bottle = let(Bottle, domain=world.semantic_annotations)
226227
bottles_with_cap_query = an(
227228
entity(
228-
Bottle(cap=an(Cap())
229+
bottle, bottle.cap != None
229230
)
230231
)
231-
)
232232
query_result = list(bottles_with_cap_query.evaluate())
233233
print(query_result)
234234
```

0 commit comments

Comments
 (0)