Ich möchte mit der SPARQL INSERT-Anweisung eine neue Instanz in meine Ontologie einfügen. Ein Probe Beispiel:So fügen Sie eine neue Instanz in die OWL-Ontologie mit SPARQL ein
<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>
eine neue Instanz, die folgenden Attribute eingefügt werden soll hat:
id: 456
hasPrice: 15
description: "Test2 test2 test2"
Ich weiß nicht, wie der INSERT-Teil der Abfrage vervollständigen:
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 "
{
//...
}
Dies ist ziemlich klar in den W3C-Spezifikationen dokumentiert: https://www.w3.org/TR/sparql11-update/#insertData – AKSW
@AKSW: Ich verstehe nicht, wie Sie diesen Teil angeben 'rdf: type rdf: resource = "http://www.test123.com/test123-ontology.owl#HealthBeauty" /> ' – Dinosaurius
Ich verstehe nicht. Alles ist ein Tripel, also ist es einfach ' rdf: type .' –
AKSW