Help:CSV format

(Redirected from Help:CSV format)
CSV format
Outputs semantic data in Windows-style Comma Separated Value format
Further Information
Provided by: Semantic MediaWiki
Added: 1.2.1
Removed: still supported
Requirements: none
Format name: csv
Enabled? Indicates whether the result format is enabled by default upon installation of the respective extension. yes
Authors: User:Nathan Yergler , Markus Krötzsch , mwjames
Categories: export · plaintext
Table of Contents

The result format csv is used to produce links to CSV files which allow to export the result of a query.



Parameter Type Default Description
source text empty Alternative query source
limit whole number 50 The maximum number of results to return
offset whole number 0 The offset of the first result
link text all Show values as links
sort list of texts empty Property to sort the query by
order list of texts empty Order of the query sort
headers text show Display the headers/property names
mainlabel text no The label to give to the main page name
intro text empty The text to display before the query results, if there are any
outro text empty The text to display after the query results, if there are any
searchlabel text CSV Text for continuing the search
default text empty The text to display if there are no query results

Format specific[edit]

Parameter Type Default Description
sep text , Specifies a column separator
valuesep text , Specifies a value separator
showsep yes/no no Show separator in top of CSV file ("sep=<value>")
filename text result.csv The name for the output file
merge yes/no no Merge rows and column values with an identical subject identifier (aka first column)
bom yes/no no Add a BOM (character to signal endianness) at the top of the output file

Semantic MediaWiki 3.0.0Released on 11 October 2018 and compatible with MW 1.27.0 - 1.31.x. brought the "valuesep"1, "merge"23 and "bom"4 parameters.


All numeric or named entities in the generated output is decoded as UTF-8 string therefore the character set in your application has to be set accordingly (UTF-8).


 [[located in::Germany]] 

Result: CSV

The same query, but this time, we're using tilde («~») as the separator.

 [[located in::Germany]] 

Result: CSV


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.
      Other languages: defrruzh-hans

Help:CSV format en 1.2.1


  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:2826
  2. ^  Semantic MediaWiki: GitHub pull request gh:smw:2822
  3. ^  Semantic MediaWiki: Sandbox example sb:smw:2822
  4. ^  Semantic MediaWiki: GitHub pull request gh:smw:2824