简体   繁体   English

删除aws neptune中的所有数据

[英]Delete all data in aws neptune

I have an aws neptune cluster and which I inserted many ntriples and nquads data using sparql http api.我有一个 aws 海王星集群,我使用 sparql http api 插入了许多 ntriples 和 nquads 数据。

curl -X POST --data-binary 'update=INSERT DATA { http://test.com/s http://test.com/p http://test.com/o . curl -X POST --data-binary 'update=INSERT DATA { http://test.com/s http://test.com/p http://test.com/o }' http://your-neptune-endpoint:8182/sparql }' http://your-neptune-endpoint:8182/sparql

I would like to clean all the data I inserted(not the instance)我想清除我插入的所有数据(不是实例)

How can I do that?我怎样才能做到这一点?

You can do a SPARQL DROP ALL to delete all your data. 您可以执行SPARQL DROP ALL来删除所有数据。

If you want a truly empty database (no data, no metrics in cloudwatch, no audit history etc), then I would highly recommend creating a new cluster up fresh. 如果您想要一个真正空的数据库(没有数据,cloudwatch中没有指标,没有审核历史记录等),那么我强烈建议您重新创建一个新集群。 It takes only a few minutes. 只需要几分钟。

If you want to want to remove only the data you inserted, one strategy is to use named graphs.如果只想删除插入的数据,一种策略是使用命名图。 When you insert the data, insert it into a named graph.插入数据时,将其插入到命名图形中。 When you delete, delete the graph.删除时,删除图形。

To insert, one way is to use a call similar to the insert you gave.要插入,一种方法是使用类似于您提供的插入的调用。 Except you insert into a named graph:除非您插入命名图形:

curl -X POST --data-binary 'update=INSERT DATA { GRAPH http://www.example.com/named/graph { http://test.com/s http://test.com/p http://test.com/o . curl -X POST --data-binary 'update=INSERT DATA { GRAPH http://www.example.com/named/graph { http://test.com/s http://test.com/p http: //test.com/o } }' } }'
https://endpoint:8182/sparql https://endpoint:8182/sparql

Alternative is to insert using Graph Store Protocol:另一种方法是使用 Graph Store Protocol 插入:

curl --request POST -H "Content-Type: text/turtle" curl --request POST -H "Content-Type: text/turtle"
--data-raw " http://test.com/s http://test.com/p http://test.com/o . " --data-raw “ http://test.com/s http://test.com/p http://test.com/o 。”
'https://endpoint:8182/sparql/gsp/?graph=http%3A//www.example.com/named/graph' 'https://endpoint:8182/sparql/gsp/?graph=http%3A//www.example.com/named/graph'

Another is to use the bulk loader, which has namedGraphUri option ( https://docs.aws.amazon.com/neptune/latest/userguide/load-api-reference-load.html ).另一种方法是使用批量加载程序,它具有 namedGraphUri 选项 ( https://docs.aws.amazon.com/neptune/latest/userguide/load-api-reference-load.html )。

Here is a delete that removes the named graph:这是删除命名图的删除:

curl --request DELETE 'https://endpoint:8182/sparql/gsp/?graph=http%3A//www.example.com/named/graph' curl --request DELETE 'https://endpoint:8182/sparql/gsp/?graph=http%3A//www.example.com/named/graph'

See https://docs.aws.amazon.com/neptune/latest/userguide/sparql-graph-store-protocol.html for details on the Graph Store Protocol in Neptune.有关 Neptune 中图形存储协议的详细信息,请参阅https://docs.aws.amazon.com/neptune/latest/userguide/sparql-graph-store-protocol.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM