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: docs/cli/create.md
+65-1Lines changed: 65 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
The *create* command has two subcommands, both of which create a new dataset on disk. The dataset name `:memory:` is a reserved value for datasets that exist only in memory and is not allowed in the CLI.
1
+
The *create* command has three subcommands, all of which create a new dataset on disk. The dataset name `:memory:` is a reserved value for datasets that exist only in memory and is not allowed in the CLI.
2
2
3
3
```
4
4
Usage: geist create [OPTIONS] COMMAND [ARGS]...
@@ -9,10 +9,74 @@ Options:
9
9
--help Show this message and exit.
10
10
11
11
Commands:
12
+
clingo Create a new ASP dataset using Clingo
12
13
duckdb Create a new SQL dataset using DuckDB
13
14
rdflib Create a new RDF dataset using RDFLib
14
15
```
15
16
17
+
??? info "geist create clingo [OPTIONS]"
18
+
19
+
```
20
+
Usage: geist create clingo [OPTIONS]
21
+
22
+
Create a new ASP dataset using Clingo
23
+
24
+
Options:
25
+
-d, --dataset TEXT Name of ASP dataset to create (default "kb")
26
+
-ifile, --inputfile FILENAME Path of the file to be loaded as facts,
27
+
rules, and contraints [required]
28
+
-iformat, --inputformat [lp|csv|json]
29
+
Format of the file to be loaded as facts,
30
+
rules, and constraints. Note that "csv" only
31
+
supports facts (default "lp"). If multiple
32
+
possibilities are provided (as a list), only
33
+
the first one will be considered.
34
+
-pred, --predicate TEXT "isfirstcol" for using the first column as
35
+
the predicate name; strings other than
36
+
"isfirstcol" are used as the predicate name
37
+
directly (default: "isfirstcol")
38
+
-prog, --programname TEXT Name of the program (default: "base")
39
+
--help Show this message and exit.
40
+
```
41
+
42
+
??? example "Example 1: create a `test` ASP dataset from stdin with LP format"
43
+
44
+
```
45
+
geist create clingo --dataset test --inputformat lp << __END_INPUT__
46
+
friends(a, b).
47
+
friends(a, c).
48
+
__END_INPUT__
49
+
```
50
+
51
+
??? example "Example 2: create a `test` ASP dataset from a file with LP format"
52
+
53
+
Here is the `friends.lp` file:
54
+
55
+
```file
56
+
friends(a, b).
57
+
friends(a, c).
58
+
```
59
+
60
+
Code:
61
+
```
62
+
geist create clingo --dataset test --inputfile friends.lp --inputformat lp
63
+
```
64
+
65
+
??? example "Example 3: create a `test` ASP dataset from a CSV file"
Copy file name to clipboardExpand all lines: docs/cli/destroy.md
+28-1Lines changed: 28 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
*destroy* command can delete a dataset. The `.duckdb` or the `.pkl` file of the corresponding dataset will be discarded.
2
2
3
-
There are two subcommands for *destroy*:
3
+
There are three subcommands for *destroy*:
4
4
```
5
5
Usage: geist destroy [OPTIONS] COMMAND [ARGS]...
6
6
@@ -10,10 +10,37 @@ Options:
10
10
--help Show this message and exit.
11
11
12
12
Commands:
13
+
clingo Delete an ASP dataset
13
14
duckdb Delete a SQL dataset
14
15
rdflib Delete an RDF dataset
15
16
```
16
17
18
+
??? info "geist destroy clingo [OPTIONS]"
19
+
20
+
```
21
+
Usage: geist destroy clingo [OPTIONS]
22
+
23
+
Delete an ASP dataset
24
+
25
+
Options:
26
+
-d, --dataset TEXT Name of an ASP dataset to be removed (default "kb")
27
+
-q, --quiet Suppress error messages if the provided dataset does not
28
+
exist
29
+
--help Show this message and exit.
30
+
```
31
+
32
+
??? example "Example: delete the `test` ASP dataset"
33
+
34
+
```
35
+
geist destroy clingo --dataset test
36
+
```
37
+
38
+
The `.geistdata/clingo/test.pkl` file will be removed after this operation. By default, you will get an error message if the provided dataset (in this case, it is the `test` dataset) does not exist. To suppress this error message, you can add `--quiet`:
Copy file name to clipboardExpand all lines: docs/geist-templates/tags/tag-create.md
+27-2Lines changed: 27 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,14 @@ The `create` tag creates a dataset based on the given string. By default, the gi
3
3
|Name | Description |
4
4
|---------------|-------------|
5
5
|`dataset`|Name of RDF dataset to create (by default, `kb`) |
6
-
|`datastore`|Data backend. `duckdb`and `rdflib` are available for now. (by default, `rdflib`) |
6
+
|`datastore`|Data backend. `duckdb`, `rdflib`, and `clingo` are available. (by default, `rdflib`) |
7
7
|`inputformat`|Format of the file to be loaded as triples (by default, `json-ld`). It has to be one of {`xml`, `n3`, `turtle`, `nt`, `pretty-xml`, `trix`, `trig`, `nquads`, `json-ld`, `hext`, `csv`} |
8
8
|`infer`|Inference to perform on update choosing from {`none`, `rdfs`, `owl`, `rdfs_owl`} (by default, `none`). Please check [OWL-RL](https://owl-rl.readthedocs.io/en/latest/owlrl.html) document for detailed information. |
9
9
|`isfilepath`|A bool value to denote if the given data is a file path or not (by default: `True`, which denotes the given data is a file path) |
10
10
|`table`|Table name. Available for `duckdb` data backend only. |
11
11
|`colnames`|Column names of triples with the format of `[[subject1, predicate1, object1], [subject2, predicate2, object2], ...]` when the input format is csv (by default, `None`). Available for `rdflib` data backend only. |
12
+
|`predicate`|`'isfirstcol'` for using the first column as the predicate name; strings other than `'isfirstcol'` are used as the predicate name directly (by default, `'isfirstcol'`). Available for `clingo` data backend only. |
13
+
|`name`|Name of the program (by default, `'base'`). Available for `clingo` data backend only. |
12
14
13
15
??? example "Example 1: the given string is not a file path"
14
16
@@ -19,7 +21,30 @@ The `create` tag creates a dataset based on the given string. By default, the gi
19
21
{% endcreate %}
20
22
```
21
23
22
-
??? example "Example 2: the given string is a file path"
24
+
??? example "Example 2: create a Clingo dataset (the given string is not a file path)"
|`dataset`| Name of RDF dataset to be removed (default `kb`) |
6
-
|`datastore`| Data backend. `duckdb`and `rdflib` are available for now. (by default, `rdflib`) |
6
+
|`datastore`| Data backend. `duckdb`, `rdflib`, and `clingo` are available. (by default, `rdflib`) |
7
7
|`quiet`| Suppress error messages if the provided dataset does not exist |
8
8
9
9
??? example "Example: delete the `test` dataset"
@@ -16,7 +16,7 @@ The `destroy` tag deletes a dataset. Here are parameters of the `destroy` tag:
16
16
{% destroy "test" %}
17
17
```
18
18
19
-
The `.geistdata/test.pkl` file will be removed after this operation. By default, you will get an error message if the provided dataset (in this case, it is the `test` dataset) does not exist. To suppress this error message, you can add the `quiet` parameter:
19
+
The dataset file (e.g., `.geistdata/rdflib/test.pkl`) will be removed after this operation. By default, you will get an error message if the provided dataset (in this case, it is the `test` dataset) does not exist. To suppress this error message, you can add the `quiet` parameter:
|`dataset`| Name of RDF dataset to be removed (default `kb`) |
6
-
|`datastore`| Data backend. `duckdb`and `rdflib` are available for now. (by default, `rdflib`) |
6
+
|`datastore`| Data backend. `duckdb`, `rdflib`, and `clingo` are available. (by default, `rdflib`) |
7
7
|`inputformat`| Format of the file to be loaded as triples (default `json-ld`) |
8
8
|`isfilepath`| A bool value to denote if the given data is a file path or not (default `True`, which denotes the given data is a file path) |
9
9
|`table`| Table name to be loaded. Available for `duckdb` data backend only. |
10
10
|`colnames`| Column names of triples with the format of `[[subject1, predicate1, object1], [subject2, predicate2, object2], ...]` when the input format is csv. Available for `rdflib` data backend only. |
11
+
|`predicate`|`'isfirstcol'` for using the first column as the predicate name; strings other than `'isfirstcol'` are used as the predicate name directly (default `'isfirstcol'`). Available for `clingo` data backend only. |
12
+
|`programname`| Name of the program (default `'base'`). Available for `clingo` data backend only. |
11
13
12
-
??? example "Example: load a file into the `test` dataset"
14
+
??? example "Example 1: load a file into the `test` RDF dataset"
0 commit comments