CSVW RDF Convertor - Documentation
    Preparing search index...

    Class responsible for converting from CSVW to RDF. This class should not be used in parallel.

    Index

    Constructors

    Properties

    issueTracker: IssueTracker = ...
    location: CsvLocationTracker = ...
    numberParser: NumberParser = ...
    options: Required<Csvw2RdfOptions>
    outputStream: Readable = ...
    used: boolean = false
    defaultWKs: Template[] = ...
    normalizeWsTypes: Set<string> = ...

    Methods

    • Converts a cell of the current row to RDF.

      Parameters

      • defaultSubj: BlankNode

        Default subject

      • rowNode: BlankNode

        The row node

      • colNum: number

        The column number.

      • rowsOffset: number

        The offset of the rows.

      • colsOffset: number

        The offset of the columns.

      • ctx: TableContext

      Returns void

    • Converts table row to RDF by row number.

      Parameters

      • rowNum: number

        The row number.

      • rowsOffset: number

        The offset of the rows.

      • ctx: TableContext

      Returns BlankNode

    • Converts the values of a table row to RDF.

      Parameters

      • rowNode: BlankNode
      • rowsOffset: number
      • ctx: TableContext

      Returns void

    • Creates a named node or a blank node based on the input.

      Parameters

      • input: { "@id"?: string }

        Input object

      Returns NamedNode<string> | BlankNode

    • Convert string value to RDF literal based on the datatype URI.

      Parameters

      • value: string

        string value to be converted

      • dtUri: string

        datatype URI

      • Optionallang: string

        language tag

      Returns Literal

      RDF literal

    • Parameters

      • object: { notes?: unknown }
      • node: NamedNode<string> | BlankNode

      Returns void

    • Emits a triple to the output stream.

      Parameters

      • first: NamedNode<string> | BlankNode
      • second: NamedNode
      • third: NamedNode<string> | BlankNode | Literal

      Returns void

    • Retrieves URI templates from well-known URI file.

      Parameters

      • url: string

        /.well-known/csvm is resolved relative to this url

      Returns Promise<Template[]>

      URI templates of metadata locations

    • Parameters

      • vals: string[]
      • defaultLang: string
      • firstRow: boolean
      • ctx: TableContext

      Returns void

    • Inteprets the datatype of a value based on the current column description.

      Parameters

      • value: string

        string value to be interpreted

      • dtUri: string
      • dt: CsvwDatatype
      • ctx: TableContext

      Returns null | string | string[]

      Correctly built RDF literal

    • Check if value should be considered null based on the current column description.

      Parameters

      • value: string

        string value to be checked

      • ctx: TableContext

      Returns boolean

      true if the value is null, false otherwise

    • Handle whitespace normalization for the given value and datatype.

      Parameters

      • value: string

        string value to be normalized

      • dtype: string

        datatype URI

      • ctx: TableContext

      Returns null | string | string[]

      normalized value

    • Processes the header of a CSV file and its embedded metadata.

      Parameters

      • stream: AsyncIterator<string[]>

        Input stream

      • ctx: TableContext

      Returns Promise<undefined | string[]>

      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.

    • Processes the microsyntax of the CSV file. This currently includes only column titles.

      Parameters

      • defaultLang: string

        default language of the csv file

      • headerRowCount: number

        number of header rows

      • physicalColCount: undefined | number

        number of nonvirtual columns defined in the table schema or undefined if the table schema has no columns defined

      • stream: AsyncIterator<string[]>

        CSV stream

      • ctx: TableContext

      Returns Promise<undefined | string[]>

    • Reformat string value into a valid string representation of the datatype.

      Parameters

      • value: string

        string value to be converted

      • dtUri: string

        datatype URI

      • dt: CsvwDatatype

        datatype description

      • ctx: TableContext

      Returns null | string

      the reformatted value

    • Verify that the metadata URL is valid and contains a table description that matches the CSV file.

      Parameters

      • url: string

        url to the descriptor

      • csvUrl: string

        url to the CSV file

      Returns Promise<null | [DescriptorWrapper, string]>

      either descriptor and url or null if the descriptor is not valid