【发布时间】:2015-10-09 13:06:38
【问题描述】:
我正在使用 virtuoso 7.2.1,我正在尝试在 3 个图形之间运行 sparql 查询。
G1 包含:
@prefix : <http://test#> .
:bob :hasAddress :add1 .
G2 包含:
@prefix : <http://test#> .
:bob :hasAddress :add2 .
而 G3 包含:
@prefix : <http://test#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
:add1 owl:sameAs :add2 .
我试图在 virtuoso 中运行的 sparql 是:
DEFINE input:same-as "yes"
Select *
from <http://G1>
from <http://G3>
Where{
<http://test#bob> <http://test#hasAddress> ?z .
}
结果:
<http://test#add1>
预期结果:
<http://test#add1>
<http://test#add2>
注意:如果我使用 单个图(G1、G2、G3 合并到 G 图)我会得到预期的结果。为什么这不适用于多个图表。 谢谢。
-----------------------------------编辑----------- ---
分别是这个查询:
DEFINE input:same-as "yes"
Select *
from <http://G2>
from <http://G3>
Where{
<http://test#bob> <http://test#hasAddress> ?z .
}
或者这个查询:
DEFINE input:same-as "yes"
Select ?z
from named <http://G2>
from named <http://G3>
Where{
graph ?g {<http://test#bob> <http://test#hasAddress> ?z .}
}
只有这个结果:
<http://test#add2>
【问题讨论】:
-
From 子句中的图表似乎没有正确合并?或者我错过了什么。
标签: rdf sparql semantic-web owl virtuoso