我正在尝试使用Python和rdflib 4.2.2将三元组添加到远程SPARQL存储库。
添加声明作品:
var list = [{
one: [{key: 1, value: 'eng1'}, {key: 2, value: 'eng2'}],
two: [{key: 1, value: 'esp1'}, {key: 2, value: 'esp2'}]
}];
var grouped = [];
list.forEach(function(e) {
Object.keys(e).forEach(function(k) {
var that = this;
e[k].forEach(function(a) {
if(!that[a.key]) grouped.push(that[a.key] = {key: a.key, group: {}})
Object.assign(that[a.key].group, {[k]: {value: a.value}})
})
}, {})
})
console.log(grouped)
但我认为添加图形更有效,即
gsu = rdflib.plugins.stores.sparqlstore.SPARQLUpdateStore(sparql_endpoint, update_endpoint, bNodeAsURI=False, sparql11=True, context_aware=False)
for stmt in subGraph:
gsu.add( stmt )
Unfortunatley在错误中重新开始:ValueError:解压缩的值太多
是否有人成功将图表添加到远程仓库?