Import RDF data

Step by step guide to importing RDF data

This guide is for importing larger amounts of data (e.g. more than a few thousands of RDF triples) asynchronously. For smaller data, it is simpler to add data synchronously.

Read more on how RDF imports work.

There are 3 main components that comprise a CSV import:

RDF file
The file containing the RDF data (can be in any RDF syntax)
Transformation query (optional)
SPARQL CONSTRUCT query that maps RDF to another RDF represenation
Graph (optional)
The document that the import results will be stored in, if no mapping query is specified
RDF import
Combines the file with the corresponding query

Either query or graph have to be specified, not both.

Without transformation

This method asynchronously appends RDF data to a document (see how to create a document).

LinkedDataHub allows all the import components be created from a single dialogue, but we will go through the process in separate steps:

  1. First, create a container for the data to be imported. This will be the import's target container
  2. Upload a RDF file. Click on the Create dropdown in the top left-hand corner and select File. This will open a new form.
  3. Fill out Item fields
  4. Fill in the mandatory File fields:
    Filename
    Click on Choose file and select a RDF file from your computer
    Title
    File title
  5. Once all the fields have been filled in, click Save
  6. Click on the Create dropdown button at the top left-hand corner and select RDF Import. This will open a new form.
  7. Fill out Item fields
  8. Fill out the mandatory RDF Import fields:
    File
    Start typing the name of your RDF file and select it from the typeahead.
    Name
    Select the target graph (document) using the typeahead.
    Title
    Import title
  9. Click Save and you will be redirected the newly created import document.
  10. Refresh the document after a couple of moments to see the import progress. In case of success, the amount of data imported will be displayed. In case of failure, constraint violation(s) or other import issues will be displayed.
  11. Go back to the target document to see the newly imported data items.

Checkout the Command line interface (CLI) scripts into a folder on your machine. Provide a list of arguments to the import-rdf script and execute it. For example:

./import-rdf.sh \
    -b https://localhost:4443/ \
    -f "$cert_pem_file" \
    -p "$cert_password" \
    --title "Concepts" \
    --file concepts.ttl \
    --file-content-type "text/turtle" \
    --graph "${base}skos/"

With transformation

LinkedDataHub allows all the import components be created from a single dialogue, but we will go through the process in separate steps:

  1. First, create a container for the data to be imported. This will be the import's target container
  2. Upload a RDF file. Click on the Create dropdown in the top left-hand corner and select File. This will open a new form.
  3. Fill out Item fields
  4. Fill in the mandatory File fields:
    Filename
    Click on Choose file and select a RDF 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 transformation query that will transform the uploaded RDF to a new RDF structure. Click on the Create dropdown in the top left-hand corner and select CONSTRUCT. This will open a new form.
  8. Fill out Item fields
  9. Fill out the mandatory CONSTRUCT 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 this saved under Queries container in left navigation.
  11. Click on the Create dropdown button at the top left-hand corner and select RDF Import. This will open a new form.
  12. Fill out Item fields
  13. Fill out the mandatory RDF Import fields:
    File
    Start typing the name of your RDF file and select it from the typeahead.
    Query
    Select the transformation query using the typeahead.
    Title
    Import title
  14. Click Save and you will be redirected the newly created import document.
  15. Refresh the document after a couple of moments to see the import progress. In case of success, the amount of data imported will be displayed. In case of failure, constraint violation(s) or other import issues will be displayed.

Checkout the Command line interface (CLI) scripts into a folder on your machine. Provide a list of arguments to the import-rdf script and execute it. For example:

./import-rdf.sh \
    -b https://localhost:4443/ \
    -f "$cert_pem_file" \
    -p "$cert_password" \
    --title "Concepts" \
    --file concepts.ttl \
    --file-content-type "text/turtle" \
    --query-file concepts.rq