我想在我的本体中添加动态信息。我成功地添加了这样的东西
<myOntology:Diseases rdf:about="&myOntology;Cough">
<rdf:type rdf:resource="&myOntology;Diseases" />
</myOntology:Diseases>
带
INSERT DATA {
GRAPH <http://www.semanticweb.org/alexandrina/ontologies/2013/3/myOntology>
{
<http://www.semanticweb.org/alexandrina/ontologies/2013/3/myOntology#Cough>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://www.semanticweb.org/alexandrina/ontologies/2013/3/myOntology#Diseases>
}
}
但现在我想添加标签或评论属性。例如,获取
<rdfs:comment xml:lang="en">Cough</rdfs:comment>
<rdfs:comment xml:lang="ro">Tusea</rdfs:comment>
我尝试了很多查询,但没有成功。这样的查询应该是什么?
答案 0 :(得分:3)
使用前缀,并使用a
的{{1}}简写,可以更简洁地编写插入查询:
rdf:type
要添加其他数据,您只需在图表模式中添加更多三元组:
PREFIX : <http://www.semanticweb.org/alexandrina/ontologies/2013/3/myOntology#>
INSERT DATA {
GRAPH <http://www.semanticweb.org/alexandrina/ontologies/2013/3/myOntology>
{
:Cough a :Diseases
}
}
请注意图表模式
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX : <http://www.semanticweb.org/alexandrina/ontologies/2013/3/myOntology#>
INSERT DATA {
GRAPH <http://www.semanticweb.org/alexandrina/ontologies/2013/3/myOntology>
{
:Cough a :Diseases ;
rdfs:label "Cough"@en , "Tusea"@ro .
}
}
相当于更详细的模式
:Cough a :Diseases ;
rdfs:label "Cough"@en , "Tusea"@ro .