rdf_fdw
通过 SPARQL 端点访问 RDF 三元组存储的 FDW
概览
| 扩展包名 | 版本 | 分类 | 许可证 | 语言 |
|---|---|---|---|---|
rdf_fdw | 2.4.0 | FDW | MIT | C |
| ID | 扩展名 | Bin | Lib | Load | Create | Trust | Reloc | 模式 |
|---|---|---|---|---|---|---|---|---|
| 8760 | rdf_fdw | 否 | 是 | 否 | 是 | 否 | 是 | - |
| 相关扩展 | wrappers multicorn postgres_fdw sparql |
|---|
版本
| 类型 | 仓库 | 版本 | PG 大版本 | 包名 | 依赖 |
|---|---|---|---|---|---|
| EXT | PIGSTY | 2.4.0 | 1817161514 | rdf_fdw | - |
| RPM | PIGSTY | 2.4.0 | 1817161514 | rdf_fdw_$v | - |
| DEB | PIGSTY | 2.4.0 | 1817161514 | postgresql-$v-rdf-fdw | - |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
| el8.aarch64 | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS | PIGSTY MISS |
| el9.x86_64 | PIGSTY 2.4.0 el9.x86_64.pg18 : rdf_fdw_18 rdf_fdw_18-2.4.0-1PIGSTY.el9.x86_64.rpm
| PIGSTY 2.4.0 el9.x86_64.pg17 : rdf_fdw_17 rdf_fdw_17-2.4.0-1PIGSTY.el9.x86_64.rpm
| PIGSTY 2.4.0 el9.x86_64.pg16 : rdf_fdw_16 rdf_fdw_16-2.4.0-1PIGSTY.el9.x86_64.rpm
| PIGSTY 2.4.0 el9.x86_64.pg15 : rdf_fdw_15 rdf_fdw_15-2.4.0-1PIGSTY.el9.x86_64.rpm
| PIGSTY 2.4.0 el9.x86_64.pg14 : rdf_fdw_14 rdf_fdw_14-2.4.0-1PIGSTY.el9.x86_64.rpm
|
| el9.aarch64 | PIGSTY 2.4.0 el9.aarch64.pg18 : rdf_fdw_18 rdf_fdw_18-2.4.0-1PIGSTY.el9.aarch64.rpm
| PIGSTY 2.4.0 el9.aarch64.pg17 : rdf_fdw_17 rdf_fdw_17-2.4.0-1PIGSTY.el9.aarch64.rpm
| PIGSTY 2.4.0 el9.aarch64.pg16 : rdf_fdw_16 rdf_fdw_16-2.4.0-1PIGSTY.el9.aarch64.rpm
| PIGSTY 2.4.0 el9.aarch64.pg15 : rdf_fdw_15 rdf_fdw_15-2.4.0-1PIGSTY.el9.aarch64.rpm
| PIGSTY 2.4.0 el9.aarch64.pg14 : rdf_fdw_14 rdf_fdw_14-2.4.0-1PIGSTY.el9.aarch64.rpm
|
| el10.x86_64 | PIGSTY 2.4.0 el10.x86_64.pg18 : rdf_fdw_18 rdf_fdw_18-2.4.0-1PIGSTY.el10.x86_64.rpm
| PIGSTY 2.4.0 el10.x86_64.pg17 : rdf_fdw_17 rdf_fdw_17-2.4.0-1PIGSTY.el10.x86_64.rpm
| PIGSTY 2.4.0 el10.x86_64.pg16 : rdf_fdw_16 rdf_fdw_16-2.4.0-1PIGSTY.el10.x86_64.rpm
| PIGSTY 2.4.0 el10.x86_64.pg15 : rdf_fdw_15 rdf_fdw_15-2.4.0-1PIGSTY.el10.x86_64.rpm
| PIGSTY 2.4.0 el10.x86_64.pg14 : rdf_fdw_14 rdf_fdw_14-2.4.0-1PIGSTY.el10.x86_64.rpm
|
| el10.aarch64 | PIGSTY 2.4.0 el10.aarch64.pg18 : rdf_fdw_18 rdf_fdw_18-2.4.0-1PIGSTY.el10.aarch64.rpm
| PIGSTY 2.4.0 el10.aarch64.pg17 : rdf_fdw_17 rdf_fdw_17-2.4.0-1PIGSTY.el10.aarch64.rpm
| PIGSTY 2.4.0 el10.aarch64.pg16 : rdf_fdw_16 rdf_fdw_16-2.4.0-1PIGSTY.el10.aarch64.rpm
| PIGSTY 2.4.0 el10.aarch64.pg15 : rdf_fdw_15 rdf_fdw_15-2.4.0-1PIGSTY.el10.aarch64.rpm
| PIGSTY 2.4.0 el10.aarch64.pg14 : rdf_fdw_14 rdf_fdw_14-2.4.0-1PIGSTY.el10.aarch64.rpm
|
| d12.x86_64 | PIGSTY 2.4.0 d12.x86_64.pg18 : postgresql-18-rdf-fdw postgresql-18-rdf-fdw_2.4.0-1PIGSTY~bookworm_amd64.deb
| PIGSTY 2.4.0 d12.x86_64.pg17 : postgresql-17-rdf-fdw postgresql-17-rdf-fdw_2.4.0-1PIGSTY~bookworm_amd64.deb
| PIGSTY 2.4.0 d12.x86_64.pg16 : postgresql-16-rdf-fdw postgresql-16-rdf-fdw_2.4.0-1PIGSTY~bookworm_amd64.deb
| PIGSTY 2.4.0 d12.x86_64.pg15 : postgresql-15-rdf-fdw postgresql-15-rdf-fdw_2.4.0-1PIGSTY~bookworm_amd64.deb
| PIGSTY 2.4.0 d12.x86_64.pg14 : postgresql-14-rdf-fdw postgresql-14-rdf-fdw_2.4.0-1PIGSTY~bookworm_amd64.deb
|
| d12.aarch64 | PIGSTY 2.4.0 d12.aarch64.pg18 : postgresql-18-rdf-fdw postgresql-18-rdf-fdw_2.4.0-1PIGSTY~bookworm_arm64.deb
| PIGSTY 2.4.0 d12.aarch64.pg17 : postgresql-17-rdf-fdw postgresql-17-rdf-fdw_2.4.0-1PIGSTY~bookworm_arm64.deb
| PIGSTY 2.4.0 d12.aarch64.pg16 : postgresql-16-rdf-fdw postgresql-16-rdf-fdw_2.4.0-1PIGSTY~bookworm_arm64.deb
| PIGSTY 2.4.0 d12.aarch64.pg15 : postgresql-15-rdf-fdw postgresql-15-rdf-fdw_2.4.0-1PIGSTY~bookworm_arm64.deb
| PIGSTY 2.4.0 d12.aarch64.pg14 : postgresql-14-rdf-fdw postgresql-14-rdf-fdw_2.4.0-1PIGSTY~bookworm_arm64.deb
|
| d13.x86_64 | PIGSTY 2.4.0 d13.x86_64.pg18 : postgresql-18-rdf-fdw postgresql-18-rdf-fdw_2.4.0-1PIGSTY~trixie_amd64.deb
| PIGSTY 2.4.0 d13.x86_64.pg17 : postgresql-17-rdf-fdw postgresql-17-rdf-fdw_2.4.0-1PIGSTY~trixie_amd64.deb
| PIGSTY 2.4.0 d13.x86_64.pg16 : postgresql-16-rdf-fdw postgresql-16-rdf-fdw_2.4.0-1PIGSTY~trixie_amd64.deb
| PIGSTY 2.4.0 d13.x86_64.pg15 : postgresql-15-rdf-fdw postgresql-15-rdf-fdw_2.4.0-1PIGSTY~trixie_amd64.deb
| PIGSTY 2.4.0 d13.x86_64.pg14 : postgresql-14-rdf-fdw postgresql-14-rdf-fdw_2.4.0-1PIGSTY~trixie_amd64.deb
|
| d13.aarch64 | PIGSTY 2.4.0 d13.aarch64.pg18 : postgresql-18-rdf-fdw postgresql-18-rdf-fdw_2.4.0-1PIGSTY~trixie_arm64.deb
| PIGSTY 2.4.0 d13.aarch64.pg17 : postgresql-17-rdf-fdw postgresql-17-rdf-fdw_2.4.0-1PIGSTY~trixie_arm64.deb
| PIGSTY 2.4.0 d13.aarch64.pg16 : postgresql-16-rdf-fdw postgresql-16-rdf-fdw_2.4.0-1PIGSTY~trixie_arm64.deb
| PIGSTY 2.4.0 d13.aarch64.pg15 : postgresql-15-rdf-fdw postgresql-15-rdf-fdw_2.4.0-1PIGSTY~trixie_arm64.deb
| PIGSTY 2.4.0 d13.aarch64.pg14 : postgresql-14-rdf-fdw postgresql-14-rdf-fdw_2.4.0-1PIGSTY~trixie_arm64.deb
|
| u22.x86_64 | PIGSTY 2.4.0 u22.x86_64.pg18 : postgresql-18-rdf-fdw postgresql-18-rdf-fdw_2.4.0-1PIGSTY~jammy_amd64.deb
| PIGSTY 2.4.0 u22.x86_64.pg17 : postgresql-17-rdf-fdw postgresql-17-rdf-fdw_2.4.0-1PIGSTY~jammy_amd64.deb
| PIGSTY 2.4.0 u22.x86_64.pg16 : postgresql-16-rdf-fdw postgresql-16-rdf-fdw_2.4.0-1PIGSTY~jammy_amd64.deb
| PIGSTY 2.4.0 u22.x86_64.pg15 : postgresql-15-rdf-fdw postgresql-15-rdf-fdw_2.4.0-1PIGSTY~jammy_amd64.deb
| PIGSTY 2.4.0 u22.x86_64.pg14 : postgresql-14-rdf-fdw postgresql-14-rdf-fdw_2.4.0-1PIGSTY~jammy_amd64.deb
|
| u22.aarch64 | PIGSTY 2.4.0 u22.aarch64.pg18 : postgresql-18-rdf-fdw postgresql-18-rdf-fdw_2.4.0-1PIGSTY~jammy_arm64.deb
| PIGSTY 2.4.0 u22.aarch64.pg17 : postgresql-17-rdf-fdw postgresql-17-rdf-fdw_2.4.0-1PIGSTY~jammy_arm64.deb
| PIGSTY 2.4.0 u22.aarch64.pg16 : postgresql-16-rdf-fdw postgresql-16-rdf-fdw_2.4.0-1PIGSTY~jammy_arm64.deb
| PIGSTY 2.4.0 u22.aarch64.pg15 : postgresql-15-rdf-fdw postgresql-15-rdf-fdw_2.4.0-1PIGSTY~jammy_arm64.deb
| PIGSTY 2.4.0 u22.aarch64.pg14 : postgresql-14-rdf-fdw postgresql-14-rdf-fdw_2.4.0-1PIGSTY~jammy_arm64.deb
|
| u24.x86_64 | PIGSTY 2.4.0 u24.x86_64.pg18 : postgresql-18-rdf-fdw postgresql-18-rdf-fdw_2.4.0-1PIGSTY~noble_amd64.deb
| PIGSTY 2.4.0 u24.x86_64.pg17 : postgresql-17-rdf-fdw postgresql-17-rdf-fdw_2.4.0-1PIGSTY~noble_amd64.deb
| PIGSTY 2.4.0 u24.x86_64.pg16 : postgresql-16-rdf-fdw postgresql-16-rdf-fdw_2.4.0-1PIGSTY~noble_amd64.deb
| PIGSTY 2.4.0 u24.x86_64.pg15 : postgresql-15-rdf-fdw postgresql-15-rdf-fdw_2.4.0-1PIGSTY~noble_amd64.deb
| PIGSTY 2.4.0 u24.x86_64.pg14 : postgresql-14-rdf-fdw postgresql-14-rdf-fdw_2.4.0-1PIGSTY~noble_amd64.deb
|
| u24.aarch64 | PIGSTY 2.4.0 u24.aarch64.pg18 : postgresql-18-rdf-fdw postgresql-18-rdf-fdw_2.4.0-1PIGSTY~noble_arm64.deb
| PIGSTY 2.4.0 u24.aarch64.pg17 : postgresql-17-rdf-fdw postgresql-17-rdf-fdw_2.4.0-1PIGSTY~noble_arm64.deb
| PIGSTY 2.4.0 u24.aarch64.pg16 : postgresql-16-rdf-fdw postgresql-16-rdf-fdw_2.4.0-1PIGSTY~noble_arm64.deb
| PIGSTY 2.4.0 u24.aarch64.pg15 : postgresql-15-rdf-fdw postgresql-15-rdf-fdw_2.4.0-1PIGSTY~noble_arm64.deb
| PIGSTY 2.4.0 u24.aarch64.pg14 : postgresql-14-rdf-fdw postgresql-14-rdf-fdw_2.4.0-1PIGSTY~noble_arm64.deb
|
构建
您可以使用 pig build 命令构建 rdf_fdw 扩展的 RPM / DEB 包:
pig build pkg rdf_fdw # 构建 RPM / DEB 包
安装
您可以直接安装 rdf_fdw 扩展包的预置二进制包,首先确保 PGDG 和 PIGSTY 仓库已经添加并启用:
pig repo add pgsql -u # 添加仓库并更新缓存
使用 pig 或者是 apt/yum/dnf 安装扩展:
pig install rdf_fdw; # 当前活跃 PG 版本安装
pig ext install -y rdf_fdw -v 18 # PG 18
pig ext install -y rdf_fdw -v 17 # PG 17
pig ext install -y rdf_fdw -v 16 # PG 16
pig ext install -y rdf_fdw -v 15 # PG 15
pig ext install -y rdf_fdw -v 14 # PG 14
dnf install -y rdf_fdw_18 # PG 18
dnf install -y rdf_fdw_17 # PG 17
dnf install -y rdf_fdw_16 # PG 16
dnf install -y rdf_fdw_15 # PG 15
dnf install -y rdf_fdw_14 # PG 14
apt install -y postgresql-18-rdf-fdw # PG 18
apt install -y postgresql-17-rdf-fdw # PG 17
apt install -y postgresql-16-rdf-fdw # PG 16
apt install -y postgresql-15-rdf-fdw # PG 15
apt install -y postgresql-14-rdf-fdw # PG 14
创建扩展:
CREATE EXTENSION rdf_fdw;
用法
语法:
CREATE EXTENSION rdf_fdw; CREATE SERVER dbpedia FOREIGN DATA WRAPPER rdf_fdw OPTIONS (endpoint 'https://dbpedia.org/sparql');来源:README
rdf_fdw 是面向 RDF 三元组存储的外部数据包装器,通过 SPARQL endpoint 与 PostgreSQL 集成。它允许用 SQL 查询 RDF 数据,支持 SQL 子句下推,增加了用于 RDF term 的 rdfnode 类型,并提供 SPARQL 1.1 函数支持。
服务器配置
使用 CREATE SERVER 注册 SPARQL endpoint:
CREATE SERVER dbpedia
FOREIGN DATA WRAPPER rdf_fdw
OPTIONS (endpoint 'https://dbpedia.org/sparql');
README 记录的服务器参数包括:
endpoint(必需)batch_sizeenable_pushdownformathttp_proxyconnect_timeout
代理凭据应放在 user mapping 中。
外部表
rdf_fdw 通过声明外部表来嵌入 SPARQL 查询,并将结果变量映射到 PostgreSQL 列。README 还强调了通过自定义 rdfnode 类型对 RDF 节点的原生处理。
下推与 DML
上游文档明确指出支持以下下推:
WHERELIMITORDER BYDISTINCT
它也记录了数据修改能力:
INSERTUPDATEDELETE
SPARQL UPDATE 的批处理粒度由 batch_size 控制。
辅助函数
README 列出了以下工具函数:
rdf_fdw_version()rdf_fdw_settings()rdf_fdw_clone_table()
同时它还记录了更广泛的 SPARQL 函数支持,包括聚合、字符串函数、数值函数、日期时间函数、哈希函数和自定义函数。
说明
当前 README 提示:检索到的 RDF 数据在转换为 PostgreSQL 之前会先加载到内存,因此大结果集需要足够的 PostgreSQL 内存。文档还说明支持的最低 PostgreSQL 版本为 9.5+。