sparql查询插入objectproperty不工作

q3qa4bjr  于 2021-07-06  发布在  Java
关注(0)|答案(0)|浏览(177)

我正在尝试通过fuseki服务器插入tdb。它确实添加了dataproperty,但没有添加objectproperty,我也不知道原因是什么。
owl文件示例:

<owl:NamedIndividual rdf:about="http://www.semanticweb.org/hightech/ontologies/2019/8/untitled-ontology-4#BCA">
        <rdf:type rdf:resource="http://www.semanticweb.org/hightech/ontologies/2019/8/untitled-ontology-4#Concept"/>
        <before rdf:resource="http://www.semanticweb.org/hightech/ontologies/2019/8/untitled-ontology-4#CA"/>
        <part_of rdf:resource="http://www.semanticweb.org/hightech/ontologies/2019/8/untitled-ontology-4#ADT"/>
        <depth_level rdf:datatype="http://www.w3.org/2001/XMLSchema#string">1</depth_level>
        <description rdf:datatype="http://www.w3.org/2001/XMLSchema#string"></description>
        <id rdf:datatype="http://www.w3.org/2001/XMLSchema#string">BCA</id>
        <name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Basic Concept of ADT</name>
    </owl:NamedIndividual>

java代码:

String queryString =
                    "PREFIX ns:<http://www.semanticweb.org/hightech/ontologies/2019/unit#>"
                    + "PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>" 
                    + "INSERT DATA{" 
                    + "<http://www.semanticweb.org/hightech/ontologies/2019/unit#" + conceptcostmizeCode + "> ns:name \""+ newConcept.getName() + "\";" 
                    + "ns:id \"" + conceptcostmizeCode + "\";" 
                    + "rdf:type ns:Concept;" 
                    + "ns:description \""+ newConcept.getDescription() + "\";" 
                    + "ns:depth_level \"" + newConcept.getDepth() + "\";"
                    + "ns:part_of \"" + newConcept.getPart_of() + "\";"
                    + "ns:belongs_to \"" + newConcept.getOntologID() + "\";" 
                    + "ns:require \""+ newConcept.getRequire() + "\"." + "}";

    UpdateRequest request = UpdateFactory.create(queryString);
            UpdateProcessor qe = UpdateExecutionFactory.createRemote(request,
                    "http://localhost:3030/myDataSet/update");
            qe.execute();

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题