<https://docs.linkeddatahub.com/reference/imports/csv/>
        a       <https://www.w3.org/ns/ldt/document-hierarchy#Item>;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1>
                <https://docs.linkeddatahub.com/reference/imports/csv/#content>;
        <http://purl.org/dc/terms/created>
                "2026-06-16T20:33:57.327Z"^^<http://www.w3.org/2001/XMLSchema#dateTime>;
        <http://purl.org/dc/terms/creator>
                <https://admin.linkeddatahub.com/acl/agents/0ab4a0f7-1ab0-4d0c-8efc-63a79a2e9a10/#this>;
        <http://purl.org/dc/terms/description>
                "CSV imports and mapping to RDF using SPARQL CONSTRUCT";
        <http://purl.org/dc/terms/title>
                "CSV imports";
        <http://rdfs.org/sioc/ns#has_container>
                <https://docs.linkeddatahub.com/reference/imports/>;
        <http://www.w3.org/ns/auth/acl#owner>
                <https://admin.linkeddatahub.com/acl/agents/0ab4a0f7-1ab0-4d0c-8efc-63a79a2e9a10/#this> .

<https://www.w3.org/TR/2015/REC-csv2rdf-20151217/>
        <http://purl.org/dc/terms/title>
                "Generating RDF from Tabular Data on the Web" .

<https://docs.linkeddatahub.com/reference/imports/csv/#content>
        a       <https://w3id.org/atomgraph/linkeddatahub#XHTML>;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#value>
                "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n    <p class=\"lead\">CSV imports and mapping to RDF using SPARQL CONSTRUCT</p>\n    <p><a href=\"https://en.wikipedia.org/wiki/Comma-separated_values\" target=\"_blank\">CSV</a> is a plain-text format for\n      tabular data.</p>\n    <p>A CSV import is a combination of multiple resources:</p>\n    <dl>\n        <dt>File</dt>\n        <dd>The CSV file to be mapped to RDF and imported</dd>\n        <dt>Mapping query</dt>\n        <dd>A user-defined <code>CONSTRUCT</code> query that produces RDF</dd>\n    </dl>\n    <p>CSV import in LinkedDataHub consists of 2 steps:</p>\n    <ol>\n        <li>\n            <a href=\"#generic-conversion\">generic conversion</a> creates an intermediary, generic CSV/RDF representation for each CSV row\n        </li>\n        <li>\n            <a href=\"#vocabulary-conversion\">vocabulary conversion</a> maps the CSV/RDF to the final RDF representation using the mapping query\n        </li>\n    </ol>\n    <p>The import process runs in the background, i.e. the import item is created before the process completes.\n        Currently the only way to determine when it completes is to refresh the import item and check the import\n        status (completed/failed). Upon successful report, metadata such as the number of imported RDF triples is attached\n        to the import.</p>\n    <p>The mapping is done <em>one row at a time</em>, with each row resulting in a new created document, which should attach to the <a href=\"../../dataset/#structure\">document hierarchy</a>. The documents have to be URI resources. The server will automatically assign URIs for the documents constructed in the default graph. Alternatively, it is possible to explicitly specify the document graph using a <code>GRAPH</code> block in the <code>CONSTRUCT</code> template (which is a\n    <a href=\"https://jena.apache.org/documentation/query/construct-quad.html\" target=\"_blank\">Jena-specific extension</a> of SPARQL 1.1).</p>\n    <p>The resulting RDF data is validated against <a href=\"../../administration/ontologies/#constraints\">constraints</a> in the process. Constraint violations, if any, are attached to the import item.</p>\n    <p>We provide an running example of CSV data that will be shown as RDF conversion in the following\n        sections:</p>\n    <pre>countryCode,latitude,longitude,name\nAD,42.5,1.6,Andorra\nAE,23.4,53.8,\"United Arab Emirates\"\nAF,33.9,67.7,Afghanistan</pre>\n    <div>\n        <h3 id=\"generic-conversion\">Generic conversion</h3>\n        <p>The data table is converted to a graph by treating rows as resources, columns as predicates, and\n          cells as <code>xsd:string</code> literals. The approach is the same as CSV on the Web\n          <a href=\"https://www.w3.org/TR/2015/REC-csv2rdf-20151217/#dfn-minimal-mode\" target=\"_blank\">minimal mode</a>.</p>\n          <pre>@base &lt;https://localhost:4443/&gt; .\n\n_:8228a149-8efe-448d-b15f-8abf92e7bd17\n&lt;#countryCode&gt; \"AD\" ;\n&lt;#latitude&gt; \"42.5\" ;\n&lt;#longitude&gt; \"1.6\" ;\n&lt;#name&gt; \"Andorra\" .\n\n_:ec59dcfc-872a-4144-822b-9ad5e2c6149c\n&lt;#countryCode&gt; \"AE\" ;\n&lt;#latitude&gt; \"23.4\" ;\n&lt;#longitude&gt; \"53.8\" ;\n&lt;#name&gt; \"United Arab Emirates\" .\n\n_:e8f2e8e9-3d02-4bf5-b4f1-4794ba5b52c9\n&lt;#countryCode&gt; \"AF\" ;\n&lt;#latitude&gt; \"33.9\" ;\n&lt;#longitude&gt; \"67.7\" ;\n&lt;#name&gt; \"Afghanistan\" .</pre>\n    </div>\n    <div>\n        <h3 id=\"vocabulary-conversion\">Vocabulary conversion</h3>\n        <p>This step provides a semantic \"lift\" for the generic RDF output of the previous step by mapping it\n            to classes and properties from specific vocabularies. It also connects instances in the imported data to the documents in LinkedDataHub's <a href=\"../../dataset/\" target=\"_blank\">dataset</a>.</p>\n        <p>These are the rules that hold for mapping queries:</p>\n        <ul>\n            <li><code>BASE</code> value is automatically set to the imported file's URI. Do not add an explicit <code>BASE</code> to the query.</li>\n            <li><code>$base</code> binding is set to the value of the application's baseURI</li>\n            <li>use<code>OPTIONAL</code> for optional cell values</li>\n            <li>use <code>BIND()</code> to introduce new values and/or cast literals to the appropriate result datatype or URI</li>\n            <li>when building document URIs, use natural IDs from the input data (or UUIDs if there are no IDs) and remember to URI-encode them using <code>encode_for_uri</code></li>\n            <li>use a <code>GRAPH</code> block in the constructor template to construct triples for a specific document</li>\n            <li>construct <dfn>dh:Container</dfn> instances to create new container documents or <dfn>dh:Item</dfn> instances to create new item documents. <code>dct:title</code> values are mandatory for documents.</li>\n            <li>if you're constructing non-information resource (e.g. thing, concept) descriptions, assign them URIs with fragment identified (e.g. <samp>#this</samp>) and pair them with item documents using the <code>foaf:primaryTopic</code> property</li>\n        </ul>\n        <p>We are planning to provide a UI-based mapping tool in the future.</p>\n        <div>\n            <h4 id=\"vocabulary-conversion-example\">Example</h4>\n            <p>In this example we produce a SKOS concept paired with its item (document) for each country:</p>\n            <pre><code>PREFIX  geo:  &lt;http://www.w3.org/2003/01/geo/wgs84_pos#&gt;\nPREFIX  dh:   &lt;https://www.w3.org/ns/ldt/document-hierarchy#&gt;\nPREFIX  dct:  &lt;http://purl.org/dc/terms/&gt;\nPREFIX  rdf:  &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt;\nPREFIX  xsd:  &lt;http://www.w3.org/2001/XMLSchema#&gt;\nPREFIX  foaf: &lt;http://xmlns.com/foaf/0.1/&gt;\nPREFIX  sioc: &lt;http://rdfs.org/sioc/ns#&gt;\n\nCONSTRUCT\n  {\n    ?item a dh:Item ;\n        sioc:has_container ?container ;\n        dct:title ?name ;\n        dh:slug ?countryCode ;\n        foaf:primaryTopic ?country .\n    ?country a &lt;http://dbpedia.org/ontology/Country&gt; ;\n        dct:identifier ?countryCode ;\n        geo:lat ?lat ;\n        geo:long ?long ;\n        dct:title ?name .\n  }\nWHERE\n  { \n    BIND(bnode() AS ?item)\n    BIND (uri(concat(str($base), \"countries/\")) AS ?container)\n\n    ?country  &lt;#countryCode&gt;  ?countryCode ;\n              &lt;#latitude&gt;     ?latString ;\n              &lt;#longitude&gt;    ?longString ;\n              &lt;#name&gt;         ?name .\n\n    BIND(xsd:float(?latString) AS ?lat)\n    BIND(xsd:float(?longString) AS ?long)\n  }</code></pre>\n             <p>When the import is complete, you should be able to see the imported documents as children of the <samp>${base}countries/</samp> container.</p>\n            <p>The result of our mapping:</p>\n            <pre>PREFIX  geo:  &lt;http://www.w3.org/2003/01/geo/wgs84_pos#&gt;\nPREFIX  dh:   &lt;https://www.w3.org/ns/ldt/document-hierarchy#&gt;\nPREFIX  dct:  &lt;http://purl.org/dc/terms/&gt;\nPREFIX  rdf:  &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt;\nPREFIX  xsd:  &lt;http://www.w3.org/2001/XMLSchema#&gt;\nPREFIX  foaf: &lt;http://xmlns.com/foaf/0.1/&gt;\nPREFIX  sioc: &lt;http://rdfs.org/sioc/ns#&gt;\n\n&lt;https://localhost:4443/countries/AD/&gt; a dh:Item ;\n    sioc:has_container &lt;https://localhost:4443/countries/&gt; ;\n    dct:title \"Andorra\" ;\n    dh:slug \"AD\" ;\n    foaf:primaryTopic &lt;https://localhost:4443/countries/AD/#id459bdd90-a309-49f9-92b2-1b9b5d110471&gt; .\n\n&lt;https://localhost:4443/countries/AD/#id459bdd90-a309-49f9-92b2-1b9b5d110471&gt; a &lt;http://dbpedia.org/ontology/Country&gt; ;\n    dct:identifier \"AD\" ;\n    geo:lat 42.5 ;\n    geo:long 1.6 ;\n    dct:title \"Andorra\" .\n\n&lt;https://localhost:4443/countries/AE/&gt; a dh:Item ;\n    sioc:has_container &lt;https://localhost:4443/countries/&gt; ;\n    dct:title \"United Arab Emirates\" ;\n    dh:slug \"AE\" ;\n    foaf:primaryTopic &lt;https://localhost:4443/countries/AE/#id7ad9b80b-8fbf-4696-92fa-61facf6c2066&gt; .\n\n&lt;https://localhost:4443/countries/AE/#id7ad9b80b-8fbf-4696-92fa-61facf6c2066&gt; a &lt;http://dbpedia.org/ontology/Country&gt; ;\n    dct:identifier \"AE\" ;\n    geo:lat 23.4 ;\n    geo:long 53.8 ;\n    dct:title \"United Arab Emirates\" .\n\n&lt;https://localhost:4443/countries/AF/&gt; a dh:Item ;\n    sioc:has_container &lt;https://localhost:4443/countries/&gt; ;\n    dct:title \"Afghanistan\" ;\n    dh:slug \"AF\" ;\n    foaf:primaryTopic &lt;https://localhost:4443/countries/AF/#id5de2fd91-158a-47d8-a302-d1af205fe59f&gt; .\n\n&lt;https://localhost:4443/countries/AF/#id5de2fd91-158a-47d8-a302-d1af205fe59f&gt; a &lt;http://dbpedia.org/ontology/Country&gt; ;\n    dct:identifier \"AF\" ;\n    geo:lat 33.9 ;\n    geo:long 67.7 ;\n    dct:title \"Afghanistan\" .</pre>\n        </div>\n    </div>\n    <p class=\"lead\">If you are ready to import some CSV, see our step-by-step tutorial on <a href=\"../../../user-guide/import-data/import-csv-data/\">creating an CSV import</a>.</p>\n</div>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>;
        <http://www.w3.org/2000/01/rdf-schema#seeAlso>
                <https://www.w3.org/TR/sparql11-query/#construct> , <https://www.w3.org/TR/2015/REC-csv2rdf-20151217/> .

<https://www.w3.org/TR/sparql11-query/#construct>
        <http://purl.org/dc/terms/title>
                "SPARQL 1.1 Query Language: CONSTRUCT" .
