What would be the best way to integrate WDQS with the tabular data, as well as other CSV sources? For example, if a large dataset provider publishes CSV or TSV files, and WDQS wants to federate with it, we could do something like this (this example should be modified as we flash out the exact interface)
SELECT * WHERE { # This is a well known public data source for stock quotes - Tesla daily, first lines: # Date Open High Low Close Volume Ex-Dividend Split Ratio Adj. Open Adj. High Adj. Low Adj. Close Adj. Volume # 2017-11-24 313.79 316.41 311 315.55 3242220 0 1 313.79 316.41 311 315.55 3242220 SERVICE wikibase:tabular { # Data location bd:serviceParam wikibase:url <https://www.quandl.com/api/v3/datasets/WIKI/TSLA.csv> . # CSVFormat constant, e.g. EXCEL, MYSQL, RFC4180, TDF. Default = 'DEFAULT' bd:serviceParam wikibase:csvFormat 'DEFAULT' . # If true, treat the first row as header. Default - depends on csvFormat bd:serviceParam wikibase:firstRowIsHeader true . # If true, use tabular:<column_name>, otherwise use tabular:<column_number> (1-based) # By default, this value is the same as firstRowIsHeader bd:serviceParam wikibase:csvColumnByName true . # Parse columns into variables by their name ?date tabular:Date 'date:yyyy-mm-dd' . # parse as date ?dateStr tabular:Close 'string' . # unparsed date value ?close tabular:Close 'double' . # parse as double } # Extract a single date/close value FILTER ( ?date = "2017-11-24T00:00:00Z"^^xsd:dateTime ) }
Expected result:
?date | ?dateStr | ?close |
2017-11-24 | 2017-11-24 | 315.55 |