Step-by-step guide to converting CSV data to RDF and importing it into the end-user dataspace

A CSV import has three components:

CSV file
The file containing the tabular data
Mapping query
SPARQL CONSTRUCT query that maps CSV rows to an RDF representation
CSV import
Combines the file with the corresponding query

All the import components can be created from a single dialog, but the steps below create them one at a time:

  1. First, create a container for the data to be imported. This will be the import's target container.
  2. Upload a CSV file. Click on the Create dropdown at the bottom of the page and select File. This will open a new form.
  3. Fill out the Item fields — the document's Title (required) and optional Description, the same fields used when creating a document.
  4. Fill out the mandatory File fields:
    Filename
    Click on Choose file and select a CSV file from your computer
    Title
    File title
  5. Once all the fields have been filled in, click Save.
  6. The browser will open your imported file.
  7. Create a mapping query that will transform the uploaded CSV to RDF — the tutorial's Data stage walks through a complete example, categories.rq. Click on the Create dropdown at the bottom of the page and select CONSTRUCT. This will open a new form.
  8. Fill out the Item fields.
  9. Fill out the mandatory Query fields:
    Text
    SPARQL CONSTRUCT query string
    You will not be able to save the query if its syntax is not valid SPARQL 1.1.
    Title
    Query title
  10. Once all the fields have been filled in, click Save. You can find it saved in the Queries container, which you can open from the document tree in the left sidebar.
  11. Click on the Create dropdown button at the bottom of the page and select CSV Import. This will open a new form.
  12. Fill out the Item fields.
  13. Fill out the mandatory CSV Import fields:
    File
    Start typing the name of your CSV file and select it from the typeahead
    Query
    Select the mapping query using the typeahead
    Title
    Import title
  14. Click Save and you will be redirected to the newly created import document.
  15. Reload the document after a few moments to see the import progress. On success, the amount of data imported is displayed; on failure, the constraint violations or other import errors.
  16. Go back to the target container to see the newly imported data items.

Read more about how CSV imports work.