【发布时间】:2022-05-12 00:14:50
【问题描述】:
有什么方法可以检查SPARQL 中Virtuoso 的版本,而不是通过以管理员身份访问服务器?有点像在 Postgres 中,你会做select version()。
【问题讨论】:
有什么方法可以检查SPARQL 中Virtuoso 的版本,而不是通过以管理员身份访问服务器?有点像在 Postgres 中,你会做select version()。
【问题讨论】:
作为documented on OpenLink's website --
您可以利用 Virtuoso 的内置函数(例如 sys_stat 和关联的 bif: SPARQL 前缀)使用 SPARQL 向服务器询问各种详细信息,例如 --
SELECT
( bif:sys_stat('st_dbms_name') AS ?name )
( bif:sys_stat('st_dbms_ver') AS ?version )
( bif:sys_stat('st_build_thread_model') AS ?thread )
( bif:sys_stat('st_build_opsys_id') AS ?opsys )
( bif:sys_stat('st_build_date') AS ?date )
( bif:sys_stat('git_head') AS ?git_head )
# ( bif:sys_stat('st_lic_owner') AS ?owner )
# ( bif:sys_stat('st_lic_serial_number') AS ?serial )
WHERE
{ ?s ?p ?o }
LIMIT 1
st_lic_owner 和 st_lic_serial_number 参数仅在商业版上有效,在开源版上会产生 SPARQL 错误;因此,它们在此处被注释掉。
git_head 参数对于确定构建二进制文件的特定代码库版本是必要的。如果二进制文件是从从 GitHub 下载的 ZIP 或 TGZ 存档构建的,则它不可用;必须使用git clone 或类似名称。
上述 SPARQL 查询也可以通过 SQL 接口(iSQL、ODBC、JDBC 等)运行,方法是在前面加上 SPARQL 关键字,并附加 ; SQL 查询终止符,如下所示 --
SPARQL
SELECT
( bif:sys_stat('st_dbms_name') AS ?name )
( bif:sys_stat('st_dbms_ver') AS ?version )
( bif:sys_stat('st_build_thread_model') AS ?thread )
( bif:sys_stat('st_build_opsys_id') AS ?opsys )
( bif:sys_stat('st_build_date') AS ?date )
( bif:sys_stat('git_head') AS ?git_head )
# ( bif:sys_stat('st_lic_owner') AS ?owner )
# ( bif:sys_stat('st_lic_serial_number') AS ?serial )
WHERE
{ ?s ?p ?o }
LIMIT 1 ;
【讨论】: