1
我想使用SPARQL INSERT语句将新实例插入到本体中。 样本实例:如何使用SPARQL将新实例插入到OWL本体中
<owl:NamedIndividual rdf:about="http://www.test123.com/test123-ontology.owl#cap_123">
<rdf:type rdf:resource="http://www.test123.com/test123-ontology.owl#HealthBeauty"/>
<description>Test test test</description>
<hasPrice rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">49</hasPrice>
<id rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">123</id>
</owl:NamedIndividual>
应插入具有以下属性的新实例:
id: 456
hasPrice: 15
description: "Test2 test2 test2"
我不知道如何完成查询的INSERT部分:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.test123.com/test123-ontology.owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX oo: <http://www.w3.org/2002/07/owl#>
INSERT "
{
//...
}
这在W3C规范中有详细记载:https://www.w3.org/TR/sparql11-update/#insertData – AKSW
@AKSW:我不明白如何指定这个部分'rdf:type rdf:resource =“http://www.test123.com/test123-ontology.owl#HealthBeauty”/>' – Dinosaurius
我不明白。一切都是三重的,因此,它只是 rdf:type .' –
AKSW