Virtuoso 7.2

时间:2015-10-16 16:00:57

标签: sparql virtuoso

我有a question regarding deletion of triples and their related subproperties with SPARQL that has been answered successfully here

带有通配符路径的解决方案非常好,完全符合我的要求,但它不能用于我的Virtuoso 7.2安装(它什么都不删除)。我有一个Jena / Fuseki的额外测试安装,其中查询成功执行。现在我的问题:是否有人知道Virtuoso是否不支持带有通配符路径的查询,如果是这种情况,是否有其他替代解决方案?

在最后一个答案中,还有另一个链接示例来检查两个实体之间是否存在路径。这也与Jena / Fuseki合作,但即使绝对没有关系,Virtuoso总是会返回true。

由于我没有找到关于Virtuosos功能的任何信息,我不允许在官方论坛上发帖,我希望找到能够回答我问题的人。

编辑:

@prefix xy: <http://purl.oclc.org/NET/xy/xy#> .
@prefix ssn: <http://purl.oclc.org/NET/ssnx/ssn#> .
@prefix tl: <http://purl.org/NET/c4dm/timeline.owl#> .

<http://test.eu/Obs_94456715-6a9c-4c0d-9af0-fe289602e7c9> a xy:Point ;
    xy:value "10" ;
    ssn:observationResultTime <http://test.eu/Rs_94456715-6a9c-4c0d-9af0-fe289602e7c9> ;
    ssn:observationSamplingTime <http://test.eu/St_94456715-6a9c-4c0d-9af0-fe289602e7c9> ;
    ssn:observedBy <http://test.eu/SensorID-94456715-6a9c-4c0d-9af0-fe289602e7c9> .

<http://test.eu/Rs_94456715-6a9c-4c0d-9af0-fe289602e7c9> a tl:Instant ;
    tl:at "2014-08-01T10:05:00" .

<http://test.eu/SensorID-94456715-6a9c-4c0d-9af0-fe289602e7c9> a ssn:Sensor .

<http://test.eu/St_94456715-6a9c-4c0d-9af0-fe289602e7c9> a tl:Instant ;
    tl:at "2014-08-01T10:05:00" .


@prefix xy: <http://purl.oclc.org/NET/xy/xy#> .
@prefix ssn: <http://purl.oclc.org/NET/ssnx/ssn#> .
@prefix tl: <http://purl.org/NET/c4dm/timeline.owl#> .

<http://test.eu/Obs_3c2cd1d4-c277-4663-a281-b2ea4917bd49> a xy:Point ;
    xy:value "10" ;
    ssn:observationResultTime <http://test.eu/Rs_3c2cd1d4-c277-4663-a281-b2ea4917bd49> ;
    ssn:observationSamplingTime <http://test.eu/St_3c2cd1d4-c277-4663-a281-b2ea4917bd49> ;
    ssn:observedBy <http://test.eu/SensorID-3c2cd1d4-c277-4663-a281-b2ea4917bd49> .

<http://test.eu/Rs_3c2cd1d4-c277-4663-a281-b2ea4917bd49> a tl:Instant ;
    tl:at "2014-08-01T10:10:00" .

<http://test.eu/SensorID-3c2cd1d4-c277-4663-a281-b2ea4917bd49> a ssn:Sensor .

<http://test.eu/St_3c2cd1d4-c277-4663-a281-b2ea4917bd49> a tl:Instant ;
    tl:at "2014-08-01T10:10:00" .

这是我的测试图。在Virtuoso(Version: 07.20.3212, Build: Feb 23 2015)和Apache Jena Fuseki(Version 2.3.0)中也是如此。

首先查询:

ASK {GRAPH <http://ict-citypulse.eu/store/testGraph2>{
  <http://test.eu/Obs_94456715-6a9c-4c0d-9af0-fe289602e7c9> ((<>|!<>)|^(<>|!<>))* <http://test.eu/St_94456715-6a9c-4c0d-9af0-fe289602e7c9> . 
}}

在Virtuoso中,即使我将其中一个名称更改为不存在的名称,此查询也会每次返回“true”。在Fuseki中,它按预期工作,如果我更改名称,则返回“true / false”。

第二个查询,它完全符合我的需要(如果我将其更改为删除):

select *
where {
  GRAPH <http://ict-citypulse.eu/store/testGraph2> {
    <http://test.eu/Obs_94456715-6a9c-4c0d-9af0-fe289602e7c9> (<>|!<>)* ?s . 
    ?s ?p ?o .
  }
}

在Virtuoso上,此查询不返回任何内容。在Fuseki中,它只返回10个三元组,这是一个提交的图形。

我希望这有助于解释我的问题。谢谢你的帮助!

编辑: 我现在尝试使用最新的Virtuoso版本(Version: 07.20.3214, Build: Oct 20 2015)进行查询。我试过两个,稳定版和开发版。两者都具有与上述相同的行为。以下是插入测试数据的查询,如果这有助于您重播问题:

INSERT DATA INTO GRAPH <http://ict-citypulse.eu/store/testGraph2> {<http://test.eu/Obs_94456715-6a9c-4c0d-9af0-fe289602e7c9> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.oclc.org/NET/xy/xy#Point> . <http://test.eu/Obs_94456715-6a9c-4c0d-9af0-fe289602e7c9> <http://purl.oclc.org/NET/ssnx/ssn#observationResultTime> <http://test.eu/Rs_94456715-6a9c-4c0d-9af0-fe289602e7c9> . <http://test.eu/Obs_94456715-6a9c-4c0d-9af0-fe289602e7c9> <http://purl.oclc.org/NET/xy/xy#value> "10" . <http://test.eu/Obs_94456715-6a9c-4c0d-9af0-fe289602e7c9> <http://purl.oclc.org/NET/ssnx/ssn#observedBy> <http://test.eu/SensorID-94456715-6a9c-4c0d-9af0-fe289602e7c9> . <http://test.eu/Obs_94456715-6a9c-4c0d-9af0-fe289602e7c9> <http://purl.oclc.org/NET/ssnx/ssn#observationSamplingTime> <http://test.eu/St_94456715-6a9c-4c0d-9af0-fe289602e7c9> . <http://test.eu/Rs_94456715-6a9c-4c0d-9af0-fe289602e7c9> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.org/NET/c4dm/timeline.owl#Instant> . <http://test.eu/Rs_94456715-6a9c-4c0d-9af0-fe289602e7c9> <http://purl.org/NET/c4dm/timeline.owl#at> "2014-08-01T10:05:00" . <http://test.eu/St_94456715-6a9c-4c0d-9af0-fe289602e7c9> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.org/NET/c4dm/timeline.owl#Instant> . <http://test.eu/St_94456715-6a9c-4c0d-9af0-fe289602e7c9> <http://purl.org/NET/c4dm/timeline.owl#at> "2014-08-01T10:05:00" . <http://test.eu/SensorID-94456715-6a9c-4c0d-9af0-fe289602e7c9> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.oclc.org/NET/ssnx/ssn#Sensor> .   <http://test.eu/SensorID-3c2cd1d4-c277-4663-a281-b2ea4917bd49> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.oclc.org/NET/ssnx/ssn#Sensor> . <http://test.eu/Rs_3c2cd1d4-c277-4663-a281-b2ea4917bd49> <http://purl.org/NET/c4dm/timeline.owl#at> "2014-08-01T10:10:00" . <http://test.eu/Rs_3c2cd1d4-c277-4663-a281-b2ea4917bd49> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.org/NET/c4dm/timeline.owl#Instant> . <http://test.eu/St_3c2cd1d4-c277-4663-a281-b2ea4917bd49> <http://purl.org/NET/c4dm/timeline.owl#at> "2014-08-01T10:10:00" . <http://test.eu/St_3c2cd1d4-c277-4663-a281-b2ea4917bd49> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.org/NET/c4dm/timeline.owl#Instant> . <http://test.eu/Obs_3c2cd1d4-c277-4663-a281-b2ea4917bd49> <http://purl.oclc.org/NET/xy/xy#value> "10" . <http://test.eu/Obs_3c2cd1d4-c277-4663-a281-b2ea4917bd49> <http://purl.oclc.org/NET/ssnx/ssn#observationSamplingTime> <http://test.eu/St_3c2cd1d4-c277-4663-a281-b2ea4917bd49> . <http://test.eu/Obs_3c2cd1d4-c277-4663-a281-b2ea4917bd49> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.oclc.org/NET/xy/xy#Point> . <http://test.eu/Obs_3c2cd1d4-c277-4663-a281-b2ea4917bd49> <http://purl.oclc.org/NET/ssnx/ssn#observationResultTime> <http://test.eu/Rs_3c2cd1d4-c277-4663-a281-b2ea4917bd49> . <http://test.eu/Obs_3c2cd1d4-c277-4663-a281-b2ea4917bd49> <http://purl.oclc.org/NET/ssnx/ssn#observedBy> <http://test.eu/SensorID-3c2cd1d4-c277-4663-a281-b2ea4917bd49> .  }

我已经在上面的查询中交换了URI以匹配插入查询。

1 个答案:

答案 0 :(得分:0)

我们的研究团队成员发现了一个正在运行的Virtuoso特定解决方案:

prefix : <http://test.com/>

select *
where {
  {
    <http://test.eu/Obs_94456715-6a9c-4c0d-9af0-fe289602e7c9> (!:)* ?s .
    ?s ?p ?o .
  }
}

也许这可能有助于其他人。