Search Shortcut cmd + k | ctrl + k
rdf

A DuckDB extension to read and write RDF

Maintainer(s): nonodename

Installing and Loading

INSTALL rdf FROM community;
LOAD rdf;

Example

-- 0. Assuming the extension is already installed and loaded

-- 1. Get number of ntriples in a directory
SELECT COUNT(*) FROM read_rdf('data/shards/*.nt');

-- 2. Get subjects and predicates of a turtle file
select subject, predicate from read_rdf('test/rdf/tests.ttl');

-- 3. Write a query to turtle RDF, using R2RML mapping
COPY (SELECT empno, ename, deptno FROM emp)
TO 'output.nt'
(FORMAT r2rml, mapping 'mapping.ttl');

-- 4. Execute a full R2RML mapping (with embedded queries) to write RDF
COPY (SELECT 1) TO 'output.nt' (FORMAT r2rml, mapping 'mapping.ttl');

-- 5. Check if an R2RML mapping is valid
SELECT is_valid_r2rml('mapping.ttl');

Added Functions

function_name function_type description comment examples
can_call_inside_out scalar NULL NULL  
is_valid_r2rml scalar NULL NULL  
read_rdf table NULL NULL  

Overloaded Functions

| function_name | function_type | description | comment | examples | |—————|—————|————-|———|———-|

Added Types

| type_name | type_size | logical_type | type_category | internal | |———–|———-:|————–|—————|———-|

Added Settings

| name | description | input_type | scope | aliases | |——|————-|————|——-|———|