Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
AllegroGraph SPARQL:从默认图和命名图中删除_Sparql_Allegrograph_Named Graphs - Fatal编程技术网

AllegroGraph SPARQL:从默认图和命名图中删除

AllegroGraph SPARQL:从默认图和命名图中删除,sparql,allegrograph,named-graphs,Sparql,Allegrograph,Named Graphs,使用AllegroGraph 6.4.6 我正在尝试生成一个SPARQL DELETE查询,其中包含定义的四边形: //用于生成SPARQL的数据集示例 常量四边形=[ ['','','',//图形:默认值 ['','','','',//图形: ['','','','',//图形: ] /*查询三元组的示例 S P O G --- --- --- --- 如果我们删除,我们不会删除 FROM DEFAULT表示默认图形不是标准的SPARQL功能,因此其行为将取决于您使用的三元组存储库(许多SPA

使用AllegroGraph 6.4.6

我正在尝试生成一个SPARQL DELETE查询,其中包含定义的四边形:

//用于生成SPARQL的数据集示例
常量四边形=[
['','','',//图形:默认值
['','','','',//图形:
['','','','',//图形:
]
/*查询三元组的示例
S P O G
--- --- --- ---
如果我们删除,我们不会删除

FROM DEFAULT
表示默认图形不是标准的SPARQL功能,因此其行为将取决于您使用的三元组存储库(许多SPARQL引擎只会给出语法错误)

要从两个命名图中删除,您可以这样做(注意,我已经删除了
命名
位,并删除了graph参数):


否则,您最好使用一系列更新,而不是尝试在一次大删除中完成所有操作。

您的四元存储(名称和版本)是什么?这很重要。。。不仅仅是因为
DEFAULT
并不存在于每个商店中,如果确实存在于任何商店中(尽管它存在的话)。我只使用AllegroGraph 6.4.6 AllegroGraph文档。它确实说明了“未命名的”
DEFAULT
命名图不能与其他命名图同时处理,因此我认为您对该删除的单个查询的要求无法满足,而且您可能无法从
DEFAULT
中删除
{}
,而不删除
{}
。将
前缀franzOption\u defaultDatasetBehavior:
前缀franzOption\u defaultDatasetBehavior:
添加到查询中并重复实验。
# Returns all specified quads that exist

SELECT ?s ?p ?o ?g
FROM DEFAULT 
FROM NAMED <d>
FROM NAMED <z>
WHERE {
  {
    ?s ?p ?o.
    VALUES (?s ?p ?o) {
      ( <1> <2> <3> )
    }
  }
  UNION
  {
    GRAPH ?g {?s ?p ?o.}
    VALUES (?s ?p ?o ?g) {
      ( <a> <b> <c> <d> )
      ( <w> <x> <y> <z> )
    }
  }
}
# Should delete all quads specified in VALUES

DELETE { 
  GRAPH ?g {?s ?p ?o.} 
  ?sD ?pD ?oD. 
}
# USING DEFAULT     # Option 1
# USING NAMED <d>   # Option 2
# USING NAMED <z>   # Option 2
WHERE {
  {
    ?sD ?pD ?oD.
    VALUES (?sD ?pD ?oD) {
      ( <1> <2> <3> )
    }
  }
  UNION
  {
    GRAPH ?g {?s ?p ?o.}
    VALUES (?s ?p ?o ?g) {
      ( <a> <b> <c> <d> )
      ( <w> <x> <y> <z> )
    }
  }
}
Found DEFAULT. Was expecting one of: NAMED, Q_IRI_REF, QNAME, QNAME_NS.
DELETED:

 S   P   O   G
--- --- --- ---
<a> <b> <c> <d>
<w> <x> <y> <z>
DELETED:

 S   P   O   G
--- --- --- ---
<1> <2> <3>
<a> <b> <c> <d>
<w> <x> <y> <z>
<1> <2> <3> <4>
  DELETE {?s ?p ?o}
  USING <d>
  USING <z>
  {
    ?s ?p ?o.
    VALUES (?s ?p ?o) {
      ( <a> <b> <c> )
      ( <w> <x> <y> )
    }
  }
  DELETE {?s ?p ?o}
  USING DEFAULT
  USING <d>
  USING <z>
  {
    ?s ?p ?o.
    VALUES (?s ?p ?o) {
     ( <1> <2> <3> )
     ( <a> <b> <c> )
     ( <w> <x> <y> )
    }
  }