Skip to content

Commit cc4e9cb

Browse files
authored
Merge pull request #14 from knowsys/sparql
Documentation for preliminary SPARQL query support
2 parents c812157 + f4a4e16 commit cc4e9cb

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

src/content/docs/reference/builtins.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ that starts at the given index and extends to the end of the string. Optionally,
2828
- `STRENDS`: checks if the string given as the first parameter ends with the string given as the second parameter
2929
- `CONTAINS`: checks if the string given as the first parameter contains the string given as the second parameter
3030
- `REGEX`: checks if the string given as the first parameter matches the regular expression given as second the parameter
31+
- `URIENCODE`: transforms the given string according to the rules of [RFC 3986, Section 2.1](https://www.rfc-editor.org/rfc/rfc3986#section-2.1), making it suitable for use as part of the query string of a URI by percent-encoding all characters except `-`, `_`, `.`, and `~`.
32+
- `URIDECODE`: decodes a string transformed by `URIENCODE` back to the original, unencoded version.
3133

3234
### Format Strings
3335

@@ -128,4 +130,4 @@ result(?x, ?y) :- r(?x, ?y), OR(NUMGREATER(?x, 2), EQUALITY(?y, 0)).
128130
129131
% Invalid rule
130132
% result(?x, ?y) :- r(?x, ?y), OR(?x > 2, ?y = 0).
131-
```
133+
```

src/content/docs/reference/datatypes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ mydata("3.14"^^xsd:double, "2023-06-19"^^xsd:date) .
1212
```
1313

1414
However, it is often nicer to use the shortcuts:
15-
- *Strings* can be written in `"double quotes 🙂"` and support Unicode.
15+
- *Strings* can be written in `"double quotes 🙂"` and support Unicode. Multi-line strings can also be written using `"""triple quotes"""`.
1616
- *Integers* can be written as plain numerals with an optional sign: `42`, `-23`, `+911` all work.
1717
- *Double precision floats* can be written with decimal point and optional exponent: `3.14`, `.05`, `10.345E6` all work.
1818
- *Language-tagged strings* are written like in RDF, e.g., `"Dresden"@de` or `ドレスデン@ja`.

src/content/docs/reference/exports.md

+5
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,8 @@ Besides the above, there are format-specific parameters:
5151
| `format` | `csv`, `dsv` | The output-format of the exported data. Might be `int`, `double`, `string`, `rdf` or `skip`. |
5252

5353
When using the [Nemo command-line client](/nemo-doc/guides/cli), some cli options are available to override the export directives in the program, to set the output (base) directory, and to control if existing files should be overwritten.
54+
55+
+The parameters in export directives can also make use of format strings, e.g.,
56+
+```
57+
+@export table :- csv{resource = f"file-{?x}-{?y}.csv"}, ?x = "name", ?y = 42 .
58+
+```

src/content/docs/reference/imports.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Nemo allows importing external data files as predicates. The general syntax for
99

1010
Here, `table` denotes the predicate that data is imported to, `csv` is the data format (comma-separated values),
1111
and `path/to/file.csv` is the path to the file. Instead of a local path, it is also possible to define a URL from
12-
which data should be downloaded, e.g., `resource = <https://example.org/file.csv>`.
12+
which data should be downloaded, e.g., `resource = "https://example.org/file.csv"`.
1313

1414
The following formats are currently supported:
1515
- Delimiter-separated values: `csv`, `tsv` (tab-separated), `dsv` (delimiter required as parameter, e.g., `delimiter=";"`)
@@ -66,4 +66,10 @@ Import directives support various other optional parameters:
6666
- `limit`: if specified, only at most this many tuples are imported (great for testing when working with large files)
6767
- `compression`: used to define a compression format (`gzip` or `none`); this will normally be guessed correctly from the file extension, but can be useful for non-standard file names or URLs
6868
- `delimiter`: only for import format `dsv`, specify a delimiter string (should be a single character)
69+
- `ignore_headers`: only for import formats `csv`, `dsv`, and `tsv`, if true, the first record (containing the column headers) is ignored
6970
- `base`: specify the base IRI to be used when importing RDF data; if given, relative IRIs will be made absolute based on this base; otherwise, relative IRIs remain relative in Nemo
71+
72+
The parameters in import directives can also make use of format strings, e.g.,
73+
```
74+
@import table :- csv{resource = f"file-{?x}-{?y}.csv"}, ?x = "name", ?y = 42 .
75+
```

0 commit comments

Comments
 (0)