tests for BulkFilter

This commit is contained in:
Elijah McMorris 2024-08-26 00:04:53 -07:00
parent 057dcb3308
commit 7624d7209d
Signed by: NexVeridian
SSH key fingerprint: SHA256:bsA1SKZxuEcEVHAy3gY1HUeM5ykRJl0U0kQHQn0hMg8
5 changed files with 53 additions and 0 deletions

View file

@ -1,3 +1,16 @@
# filter.surql examples
## Delete entity and related claims, if entity doesn't have the claim, number of episodes property (P1113)
```
let $del = select claims, id from Entity
where claims.claims[where id = Property:1113].value.Thing == [];
let $entity = return (select id from $del).id;
let $claims = return (select claims from $del).claims;
delete $claims;
delete $entity;
```
# Get number of episodes
```
let $number_of_episodes = (select claims.claims[where id = Property:1113][0].value.ClaimValueData.Quantity.amount as number_of_episodes from Entity where label = "Black Clover, season 1")[0].number_of_episodes;