Skip to content

Commit

Permalink
more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
wistefan committed Jul 4, 2024
1 parent d5b1d1f commit b2f9ded
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/resources/rego/ngsi-ld/leftOperand.rego
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import rego.v1

# helper method to retrieve the type from the path
type_from_path(path) := tfe if {
print(path)
path_without_query := split(path, "?")[0]
path_elements := split(path_without_query, "/")
id_elements := split(path_elements[count(path_elements) - 1], ":")
Expand All @@ -22,9 +23,13 @@ type_from_body(body) := body.type
## ngsi-ld:entityType
# retrieves the type from an entity, either from the request path or from the body
entity_type(http_part) := tfp if {
tfp = type_from_path(http_part.path)
tf := type_from_path(http_part.path)
print(tf)
tfp = tf
} else := tfb if {
tfb = type_from_body(http_part.body)
tb := type_from_body(http_part.body)
print(tb)
tfb = tb
}

## ngsi-ld:<property>
Expand Down

0 comments on commit b2f9ded

Please sign in to comment.