首页 > 解决方案 > sparql 查询插入数据未保存在 owl

问题描述

我尝试使用来自用户寄存器的 sparql 插入数据向 owl 添加一个新用户。当我检查单个实例是否显示在浏览器中,但是当我签入 protege 时,数据没有添加,或者当我重新启动程序时,数据丢失了。

graph2 = graph.get_context(onto)
graph2.update("""
    PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
    PREFIX owl: <http://www.w3.org/2002/07/owl#>
    PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX gr: <http://www.semanticweb.org/bentofuascarvalho/ontologies/OntoBase#>

   INSERT {
         gr:""" + username + """ rdf:type gr:Person.
     } WHERE {}""")

如何保存新数据以在 Protege 和 python 中同步?

谢谢...!

标签: sparqlowl

解决方案


推荐阅读