|
1 | | - |
2 | 1 | export interface Type { |
3 | | - description: string |
| 2 | + description: string; |
4 | 3 | } |
5 | 4 |
|
6 | 5 | export interface Parameter { |
7 | | - name: string, |
8 | | - types: Type[], |
9 | | - description: string, |
10 | | - example?: string, |
| 6 | + name: string; |
| 7 | + types: Type[]; |
| 8 | + description: string; |
| 9 | + example?: string; |
| 10 | + default?: string; |
11 | 11 | } |
12 | | -const IRI: Type = {description: 'IRI'}; |
13 | | -const String: Type = {description: 'String'}; |
14 | | -const Integer: Type = {description: 'Unsigned integer'}; |
15 | | -const Boolean: Type = {description: 'Boolean'}; |
16 | | -const Char: Type = {description: 'Character'}; |
17 | | -const Tuple: Type = {description: 'Tuple of Nemo type names'}; |
18 | | -const Value: Type = {description: 'Nemo type name'}; |
19 | | -const HeaderMap: Type = {description: 'Map with key-value pairs that can be of type: String, Constant or Number'}; |
20 | | -const ParamMap: Type = {description: 'Map where each key is of type String, Constant or Number and each value is a (possibly unary) tuple containing Strings, Numbers and Constants.'}; |
| 12 | +const IRI: Type = { description: "IRI" }; |
| 13 | +const String: Type = { description: "String" }; |
| 14 | +const Integer: Type = { description: "Unsigned integer" }; |
| 15 | +const Boolean: Type = { description: "Boolean" }; |
| 16 | +const Char: Type = { description: "Character" }; |
| 17 | +const Tuple: Type = { description: "Tuple of Nemo type names" }; |
| 18 | +const Value: Type = { description: "Nemo type name" }; |
| 19 | +const HeaderMap: Type = { |
| 20 | + description: |
| 21 | + "Map with key-value pairs that can be of type: String, Constant or Number", |
| 22 | +}; |
| 23 | +const ParamMap: Type = { |
| 24 | + description: |
| 25 | + "Map where each key is of type String, Constant or Number and each value is a (possibly unary) tuple containing Strings, Numbers and Constants.", |
| 26 | +}; |
21 | 27 |
|
22 | | -export const resource: Parameter = { |
23 | | - name: 'resource', |
24 | | - types: [IRI, String], |
25 | | - description: `The file name to write to. |
| 28 | +export const resource: Parameter = { |
| 29 | + name: "resource", |
| 30 | + types: [IRI, String], |
| 31 | + description: `The file name to write to. |
26 | 32 | If it contains an extension, this is used to automatically set the <code>compression</code> parameter. |
27 | 33 | If set to the empty string <code>\"\"</code>, the tuples are read from <code>stdin</code>. |
28 | 34 | This is restricted to one <code>stdin</code> resource per program. If omitted, this is set based on the predicate name, |
29 | | - file format and compression type <code><predicate-name>.<format>.<compression></code>.` |
| 35 | + file format and compression type <code><predicate-name>.<format>.<compression></code>.`, |
30 | 36 | }; |
31 | 37 |
|
32 | | -export const format: Parameter = { |
33 | | - name: 'format', |
34 | | - types: [Tuple, Value], |
35 | | - description: `The input-format of the imported data. |
36 | | - Might be <code>int</code>, <code>double</code>, <code>string</code>, <code>rdf</code> or <code>skip</code>.` |
| 38 | +export const format: Parameter = { |
| 39 | + name: "format", |
| 40 | + types: [Tuple, Value], |
| 41 | + description: `The input-format of the imported data. |
| 42 | + Can be <code>int</code>, <code>double</code>, <code>string</code>, <code>rdf</code> or <code>skip</code>.`, |
37 | 43 | }; |
38 | 44 |
|
39 | | -export const compression: Parameter = { |
40 | | - name: 'compression', |
41 | | - types: [String], |
| 45 | +export const compression: Parameter = { |
| 46 | + name: "compression", |
| 47 | + types: [String], |
42 | 48 | description: `The compression to use. Currently only <code>gzip</code> or <code>none</code> is supported. ' |
43 | 49 | This will normally be guessed correctly from the file extension, |
44 | | - but can be useful for non-standard file names or URLs.` |
45 | | - }; |
46 | | - |
47 | | -export const limit: Parameter = { |
48 | | - name: 'limit', |
49 | | - types: [Integer], |
50 | | - description: 'The maximum number of tuples to import. (great for testing when working with large files) ' |
| 50 | + but can be useful for non-standard file names or URLs.`, |
| 51 | +}; |
| 52 | + |
| 53 | +export const limit: Parameter = { |
| 54 | + name: "limit", |
| 55 | + types: [Integer], |
| 56 | + description: |
| 57 | + "The maximum number of tuples to import (great for testing when working with large files).", |
| 58 | +}; |
| 59 | + |
| 60 | +export const delimiter: Parameter = { |
| 61 | + name: "delimiter", |
| 62 | + types: [Char], |
| 63 | + description: "The delimiter to use.", |
51 | 64 | }; |
52 | 65 |
|
53 | | -export const delimiter: Parameter = { |
54 | | - name: 'delimiter', |
55 | | - types: [Char], |
56 | | - description: 'The delimiter to use. ' |
| 66 | +export const ignore_headers: Parameter = { |
| 67 | + name: "ignore_headers", |
| 68 | + types: [Boolean], |
| 69 | + description: |
| 70 | + "if <code>true</code>, the first record (containing the column headers) is ignored.", |
| 71 | + default: "false", |
57 | 72 | }; |
58 | 73 |
|
59 | | -export const ignore_headers: Parameter = { |
60 | | - name: 'ignore_headers', |
61 | | - types: [Boolean], |
62 | | - description: 'if <code>true</code>, the first record (containing the column headers) is ignored ' |
| 74 | +export const quoting: Parameter = { |
| 75 | + name: "quoting", |
| 76 | + types: [Boolean], |
| 77 | + description: |
| 78 | + 'if <code>true</code> (the default), quotation marks <code>"</code> in the input are interpreted. This allows, e.g., reading values containing the delimiter. Cannot currently be disabled for writing.', |
| 79 | + default: "true", |
63 | 80 | }; |
64 | 81 |
|
65 | 82 | export const http_headers: Parameter = { |
66 | | - name: 'http_headers', |
67 | | - types: [HeaderMap], |
68 | | - description: 'Each pair is added as HTTP headers when making an HTTP request ', |
69 | | - example: 'http_headers=(\"Accept-Language\"=\"en-US\",\"Accept-Charset\=\"utf-8\")' |
| 83 | + name: "http_headers", |
| 84 | + types: [HeaderMap], |
| 85 | + description: "Each pair is added as HTTP headers when making an HTTP request", |
| 86 | + example: 'http_headers=("Accept-Language"="en-US","Accept-Charset="utf-8")', |
70 | 87 | }; |
71 | 88 |
|
72 | 89 | export const http_get_parameters: Parameter = { |
73 | | - name: 'http_get_parameters', |
74 | | - types: [ParamMap], |
75 | | - description: 'The map will be flattened into pairs that are appended to the IRI before making an HTTP request ', |
76 | | - example: 'http_get_parameters={name=\"John Doe\", age=42, parent=(\"Johanna Doe\", \"Josh Doe\")}' |
| 90 | + name: "http_get_parameters", |
| 91 | + types: [ParamMap], |
| 92 | + description: |
| 93 | + "The map will be flattened into pairs that are appended to the IRI before making an HTTP request", |
| 94 | + example: |
| 95 | + 'http_get_parameters={name="John Doe", age=42, parent=("Johanna Doe", "Josh Doe")}', |
77 | 96 | }; |
78 | 97 |
|
79 | 98 | export const http_post_parameters: Parameter = { |
80 | | - name: 'http_post_parameters', |
81 | | - types: [ParamMap], |
82 | | - description: 'The map will be flattened into pairs that are sent as the body of an HTTP POST request ', |
83 | | - example: 'http_post_parameters={name=\"John Doe\", age=42, parent=(\"Johanna Doe\", \"Josh Doe\")}' |
84 | | - |
| 99 | + name: "http_post_parameters", |
| 100 | + types: [ParamMap], |
| 101 | + description: |
| 102 | + "The map will be flattened into pairs that are sent as the body of an HTTP POST request", |
| 103 | + example: |
| 104 | + 'http_post_parameters={name="John Doe", age=42, parent=("Johanna Doe", "Josh Doe")}', |
85 | 105 | }; |
86 | 106 |
|
87 | 107 | export const iri_fragment: Parameter = { |
88 | | - name: 'iri_fragment', |
89 | | - types: [String], |
90 | | - description: 'A fragment that is appended to a <code>resource</code> or <code>endpoint</code> IRI' |
| 108 | + name: "iri_fragment", |
| 109 | + types: [String], |
| 110 | + description: |
| 111 | + "A fragment that is appended to a <code>resource</code> or <code>endpoint</code> IRI", |
91 | 112 | }; |
92 | 113 |
|
93 | 114 | export const base: Parameter = { |
94 | | - name: 'base', |
95 | | - types: [String], |
96 | | - description: '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' |
| 115 | + name: "base", |
| 116 | + types: [String], |
| 117 | + description: |
| 118 | + "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", |
97 | 119 | }; |
98 | 120 |
|
99 | 121 | export const endpoint: Parameter = { |
100 | | - name: 'endpoint', |
101 | | - types: [IRI, String], |
102 | | - description: 'Any endpoint that supports SPARQL queries.' |
| 122 | + name: "endpoint", |
| 123 | + types: [IRI, String], |
| 124 | + description: "Any endpoint that supports SPARQL queries.", |
103 | 125 | }; |
104 | 126 |
|
105 | 127 | export const query: Parameter = { |
106 | | - name: 'query', |
107 | | - types: [String], |
108 | | - description: 'The SPARQL query sent to the endpoint. The query will be validated before sending. Make sure to include all necessary prefixes. ' |
| 128 | + name: "query", |
| 129 | + types: [String], |
| 130 | + description: |
| 131 | + "The SPARQL query sent to the endpoint. The query will be validated before sending. Make sure to include all necessary prefixes.", |
109 | 132 | }; |
0 commit comments