Creates a new instance of the convertor.
Optional
options: Csvw2RdfOptionsOptions for the convertor.
Private
inputPrivate
locationPrivate
numberPrivate
optionsPrivate
outputPrivate
tgPrivate
usedPrivate
Static
defaultPrivate
Static
normalizePrivate
columnMain method for converting a CSVW to RDF, see https://w3c.github.io/csvw/csv2rdf/#json-ld-to-rdf for more information.
descriptor either as parsed or stringified JSON
Optional
originalUrl: stringoriginal URL of the descriptor
RDF stream
Convert CSVW to RDF from a CSV file URL. The descriptor will be resolved according to https://www.w3.org/TR/2015/REC-tabular-data-model-20151217/#locating-metadata. see https://w3c.github.io/csvw/csv2rdf/#json-ld-to-rdf for more information.
url of the CSV file
RDF stream
Private
convertPrivate
convertConverts a cell of the current row to RDF.
Default subject
The row node
The column number.
The offset of the rows.
The offset of the columns.
Private
convertConverts a table to RDF.
Private
convertConverts table row to RDF by row number.
The row number.
The offset of the rows.
Private
convertConverts the values of a table row to RDF.
Private
createCreates a named node or a blank node based on the input.
Input object
Private
createPrivate
createCreates an RDF list https://ontola.io/blog/ordered-data-in-rdf based on rules provided at https://w3c.github.io/csvw/csv2rdf/#json-ld-to-rdf.
Values of the list
The head of the rdf list
Private
datatypeConvert string value to RDF literal based on the datatype URI. Quadstore cannot store NaN as a literal, so we use a temporary prefix for numeric types. This is later replaced in the Csvw2RdfConvertor#replacerStream method.
string value to be converted
datatype URI
Optional
lang: stringlanguage tag
RDF literal
Private
emitPrivate
emitEmits a triple to the output stream.
Private
expandExpands an IRI based on the common prefixes.
IRI to be expanded
Expanded IRI
Private
getPrivate
getPrivate
getRetrieves URI templates from well-known URI file.
/.well-known/csvm is resolved relative to this url
URI templates of metadata locations
Private
headerPrivate
inheritget value of inherited property
most specific object to consider
Private
interpretInteprets the datatype of a value based on the current column description.
string value to be interpreted
Correctly built RDF literal
Private
isCheck if value should be considered null based on the current column description.
string value to be checked
true if the value is null, false otherwise
Private
normalizeGet expanded datatype URI and description for the current column.
[datatype URI, datatype description]
Private
normalizeHandle whitespace normalization for the given value and datatype.
string value to be normalized
datatype URI
normalized value
Private
preparePrepares URI templates for the conversion.
Private
processProcesses the header of a CSV file and its embedded metadata.
Input stream
The first row of the current table if there is no header and there are no columns defined in the table schema. This row is used to determine the column count and must be passed to the Csvw2RdfConvertor#convertTableRow method.
Private
processProcesses the microsyntax of the CSV file. This currently includes only column titles.
default language of the csv file
number of header rows
number of nonvirtual columns defined in the table schema or undefined if the table schema has no columns defined
CSV stream
Private
reformatPrivate
reformatPrivate
reformatReformat string value into a valid string representation of the datatype.
string value to be converted
datatype URI
datatype description
the reformatted value
Private
resolveLocates metadata for tabular data, see https://www.w3.org/TR/2015/REC-tabular-data-model-20151217/#locating-metadata for more information.
CSV file url
URL of metadata file for the given CSV file
Private
setSets default values to options if no value is provided.
Optional
options: Csvw2RdfOptionsCorrected options
Private
templateExpands a template URI.
Template to be expanded
Source column number (Csvw2RdfConvertor#location column + CsvwDialectDescription#skipColumns)
Source row number (Csvw2RdfConvertor#location row + CsvwDialectDescription#headerRowCount + CsvwDialectDescription#skipRows)
Base IRI
Expanded URI node
Private
validatePrivate
validatePrivate
validatePrivate
verifyVerify that the metadata URL is valid and contains a table description that matches the CSV file.
url to the descriptor
url to the CSV file
either descriptor and url or null if the descriptor is not valid
Class responsible for converting from CSVW to RDF. This class should not be used in parallel.