Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Aklakan authored Oct 22, 2024
1 parent 4b30819 commit 9e97184
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,10 @@ SELECT * { <example-data/people.csv> csv:parse (?rowJson "excel -h") }
```
## Lambdas in SPARQL

The function pair `norse:fn.of` and `norse:fn.call` is used to define and invoke a lambda. The definition of a lambda allows
The function pair `norse:sparql.fn.of` and `norse:fn.call` is used to define and invoke a lambda. The definition of a lambda allows
is based on conventional SPARQL expressions which however are evaluated lazily.

* The function `norse:fn.of(var1, ... varN, expr)` first accepts a list of input sparql variables followed by a single sparql expression.
* The function `norse:sparql.fn.of(var1, ... varN, expr)` first accepts a list of input sparql variables followed by a single sparql expression.
Any non-input variable mentioned in `expr` is substituted with the current binding's value.
The result of the function is an RDF literal of type `norse:lambda` which holds the lambda. The syntax of lambda literals is `?v1 v2 -> expr`.
* The function `norse:fn.call(lambdaLiteral, value1, ... valueN)` is used to invoke a lambda. The declared input variables are thereby substituted with the corresponding
Expand All @@ -430,9 +430,9 @@ is based on conventional SPARQL expressions which however are evaluated lazily.
PREFIX norse: <https://w3id.org/aksw/norse#>
SELECT ?resultA ?resultB {
BIND('Dear' AS ?salutation)
BIND(norse:fn.of(?honorific, ?name, CONCAT(?salutation, ' ', ?honorific, ' ', ?name)) AS ?greetingsFn)
BIND(norse:fn.call(?greetingsFn, "Mrs.", "Miller") AS ?resultA)
BIND(norse:fn.call(?greetingsFn, "Ms.", "Smith") AS ?resultB)
BIND(norse:sparql.fn.of(?honorific, ?name, CONCAT(?salutation, ' ', ?honorific, ' ', ?name)) AS ?greetingsFn)
BIND(norse:sparql.fn.call(?greetingsFn, "Mrs.", "Miller") AS ?resultA)
BIND(norse:sparql.fn.call(?greetingsFn, "Ms.", "Smith") AS ?resultB)
}
```

Expand Down

0 comments on commit 9e97184

Please sign in to comment.