Help:CSV format
From semantic-mediawiki.org
| CSV format |
|---|
| What: |
| Outputs semantic data in Windows-style Comma Separated Value format |
| Provided by: |
| Semantic MediaWiki |
| Added in version: |
| 1.2.1 |
| Removed in version: |
| still supported |
| Further Requirements: |
| none |
| Format name: |
| csv |
| Authors: |
| Nathan Yergler, Markus Krötzsch |
| Categories: |
| export, plaintext |
The result format csv is used to produce links to CSV files.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| limit | Whole number | 20 | The maximum number of results to return |
| offset | Whole number | 0 | The offset of the first result |
| headers | Text | show | Display the headers/property names |
| mainlabel | Text | no | The label to give to the main page name |
| link | Text | all | Show values as links |
| searchlabel | Text | no | The text for the link to results |
| sep | Text | , | The separator to use |
- sep: the character to be used to separate values. Default - comma («,»). Note that if space (« ») is specified as the separator, the underscore («_») character will be used instead.
- headers: setting this parameter to 'hide' removes the header row that is displayed in versions 1.4.3 and greater of SMW. The default value is 'show'.
Examples
{{#ask: [[Category:City]] [[located in::Germany]]
| ?population
| format=csv
}}
Result: CSV
The same query, but this time, we're using tilde («~») as the separator.
{{#ask: [[Category:City]] [[located in::Germany]]
| ?population
| format=csv
| sep=~
}}
Result: CSV
Remarks
On most platforms, CSV files will be automatically opened by the default spreadsheet program.
This documentation page applies to all SMW versions from 1.2.1 to the most current version.