CSVW RDF Convertor - Documentation
    Preparing search index...

    Module @csvw-rdf-convertor/vscode

    CSVW RDF Converter - VS Code Extension

    A VS Code extension for converting between CSV on the Web (CSVW) and RDF formats. This extension provides an intuitive interface for bidirectional conversion between tabular data and RDF, following W3C CSVW specifications.

    • Bidirectional Conversion: Convert between CSVW and RDF formats seamlessly
    • Visual Tree Interface: Manage multiple conversions through an organized tree view
    • Auto-conversion: Automatic conversion on file saves for rapid development
    • CSVW Specification Compliance: Full support for W3C CSVW metadata specifications
    • Multiple Input Support: Handle multiple CSV files within a single conversion
    • Template IRI Support: Toggle template IRI generation for RDF output
    • Minimal Mode: Streamlined output options for cleaner results
    • Workspace Integration: Seamless integration with VS Code workspace folders
    1. Open VS Code
    2. Go to Extensions (Ctrl+Shift+X)
    3. Search for "CSVW RDF Converter"
    4. Click Install
    5. Reload VS Code if prompted

    After installation, you'll see a new activity bar icon (๐Ÿ“„) on the left side of VS Code. Click it to open the CSVW RDF Converter panel.

    1. Open a CSV or RDF file in VS Code
    2. Click the Convert Current Window button in the editor toolbar or on the gear button at the top right
    3. Enter a name for your conversion
    4. The extension will automatically set up the conversion structure
    1. Click the Add Conversion button (โž•) in the extension panel
    2. Enter a name for your conversion
    3. Default rdf and csv inputs files are created

    Each conversion creates a folder structure in your workspace:

    csvw-rdf-conversions/
    โ””โ”€โ”€ YourConversionName/
    โ”œโ”€โ”€ descriptor.jsonld # CSVW metadata descriptor
    โ”œโ”€โ”€ inputs/
    โ”‚ โ”œโ”€โ”€ csvInput.csv # Primary CSV data
    โ”‚ โ”œโ”€โ”€ rdfInput.ttl # RDF input for reverse conversion
    โ”‚ โ””โ”€โ”€ [additional].csv # Additional CSV files
    โ””โ”€โ”€ outputs/
    โ”œโ”€โ”€ output.ttl # Generated RDF output
    โ””โ”€โ”€ error.txt # Error details (if any)
    1. Open Conversion Fields: Click the folder icon next to your conversion
    2. Edit Input Files: Modify your CSV data and descriptor metadata
    3. Save Files: The extension automatically converts on saving the input files
    4. View Results: RDF output appears in the outputs folder
    1. Open Conversion Fields: Access your conversion workspace
    2. Edit RDF Input: Modify the rdfInput.ttl file
    3. Configure Descriptor: Set up CSVW metadata for desired CSV structure
    4. Save and Convert: Automatic conversion generates CSV files
    • Use Add Another Input to include multiple CSV files in one conversion
    • Each file is processed according to the descriptor configuration
    • Toggle Template IRIs to control IRI generation patterns
    • Useful for creating consistent URI schemes across datasets
    • Enable Minimal Mode for cleaner, more compact RDF output
    • Reduces verbosity while maintaining semantic accuracy
    Command Icon Description
    Add Conversion โž• Create a new conversion workspace
    Open Conversion Fields ๐Ÿ“ Open all files related to a conversion
    Close Conversion Fields โœ–๏ธ Close all conversion-related tabs
    Delete Conversion ๐Ÿ—‘๏ธ Permanently remove a conversion and its files
    Command Icon Description
    Convert CSVW to RDF โžก๏ธ Manual trigger for CSVโ†’RDF conversion
    Convert RDF to CSVW โฌ…๏ธ Manual trigger for RDFโ†’CSV conversion
    Validate Specific โœ… Validate current conversion setup
    Command Icon Description
    Convert Current Window โš™๏ธ Create conversion from active file
    Add Another Input โž• Add additional CSV input file
    Toggle Template IRIs ๐Ÿ”— Enable/disable template IRI generation
    Toggle Minimal Mode ๐ŸŒฒ Enable/disable minimal output mode
    Clear Red Underlines ๐Ÿงน Clear validation error indicators

    Due to the nature of vscode extensions, sometimes not all windows are closed correctly. For example when you rename your csv table in the descriptor, new file with this name is created, but sometimes the old one doesn't close.

    The descriptor.jsonld file is the heart of CSVW conversion. Read about it here: https://www.w3.org/ns/csvw

    When enabled, generates consistent URI patterns:

    # Template IRI enabled
    <http://example.org/person/1>

    # Template IRI disabled
    <http://example.org/person#1>

    Reduces RDF verbosity by:

    • Omitting optional metadata
    • Using more compact representations
    • Focusing on core data relationships
    • Errors appear in error.txt files within the outputs folder
    • Red underline on the first line indicates validation issues in your files

    The extension automatically converts when you save:

    File Type Triggers Result
    CSV Input Save CSV file CSV โ†’ RDF conversion
    RDF Input Save RDF file RDF โ†’ CSV conversion
    Descriptor Save descriptor Input files updated, no conversion
    • All conversions stored in csvw-rdf-conversions/ folder
    • Each conversion has its own subdirectory
    • Files automatically created and managed
    • Extension works with the first workspace folder
    • Ensure your main project is the first folder in multi-root setups

    Full API documentation is available online: https://s0ft1.github.io/CSVW-RDF-convertor/


    Extension Version: 1.0.0


    Happy converting! ๐ŸŽ‰

    Modules

    extension
    lib/command-handlers
    lib/commands
    lib/commands/add-another-input
    lib/commands/add-new-conversion
    lib/commands/clear-red-underlines
    lib/commands/close-conversion-fields
    lib/commands/convert-csvw-to-rdf
    lib/commands/convert-current-window
    lib/commands/convert-rdf-to-csvw
    lib/commands/delete-conversion
    lib/commands/open-conversion-fields
    lib/commands/save-listener
    lib/commands/toggle-minimal-mode
    lib/commands/toggle-template-iris
    lib/commands/validate-specific
    lib/conversion-file-utils
    lib/conversion-logic
    lib/conversion-utils
    lib/editor-utils
    lib/file-utils
    lib/tree-data-provider
    lib/types
    lib/vscode
    lib/vscode.spec