You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ Each element in the array will become an API endpoint in the microservice. An ex
39
39
## Using variables in the export query
40
40
You can also define variables in your SPARQL export query which will be replaced with query param values at runtime. Therefore, we use [ES6's tagged template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals).
41
41
42
-
Import the `template` tag function from `/app/template.js` in your `export.js` and apply the tag function on your query. You can then define variables in your SPARQL query using `${'myVariable'}` (note the quotes around the variable name). At runtime the variable will be replaced with the value provided in the `myVariable` query param of the request.
42
+
Import the `template` tag function from `/app/template.js` in your `export.js` and apply the tag function on your query. You can then define variables in your SPARQL query using `${['myVariable', 'type']}`. `myVariable` is the name of the variable that must be replaced. `type` is the datatype of the variable. This must be one of `'string'`, `'uri'`, `'int'`, `'float'`, `'date'`, `'dateTime'`, `'bool'`. At runtime the variable will be replaced with the value provided in the `myVariable` query param of the request.
43
43
44
44
An example `export.js` including variables file may look as follows:
0 commit comments