CSVW RDF Convertor - Documentation
    Preparing search index...

    Module @csvw-rdf-convertor/vscode

    CSVW-RDF Convertor - 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 Convertor"
    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 Convertor 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.json # 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.json file is the heart of CSVW conversion. Read about it here: https://www.w3.org/ns/csvw

    When enabled, non-ASCII characters will not be escaped:

    # Template IRI enabled
    https://slovnΓ­k.cz/čeΕ‘tina/pΕ™Γ­stroj

    # Template IRI disabled
    https://xn--slovnk-7va.cz/%C4%8De%C5%A1tina/p%C5%99%C3%ADstroj

    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/


    Happy converting! πŸŽ‰

    Modules

    extension
    lib/command-handlers
    lib/commands
    lib/commands/add-another-input
    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/create-conversion
    lib/commands/delete-conversion
    lib/commands/open-conversion-fields
    lib/commands/save-listener
    lib/commands/select-rdf-serialization
    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/resolvers
    lib/tree-data-provider
    lib/types