You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Don S <do...@gmail.com> on 2012/05/31 03:49:12 UTC
Ontology Literal property changing
HI,
I developed a small ontology using protege. Initially I inserted two
tuples from the Protege editor. After that I used Jena API for inserting
the tuple based on SPARQL1.1 INSERT DATA command.
The XML code generated by the Protege for a single tuple was
<Person rdf:about="http://localhost:3030/per1.owl#Person_6">
<hasFirstname rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>Samuel</hasFirstname>
</Person>
where as the XML code generated for the new tuple inserted using Jena
starts with "rdf:Description"
<rdf:Description rdf:about="http://localhost:3030/per1.owl#name">
<hasFirstname rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>Robin</hasFirstname>
</rdf:Description>
Instead of "Person rdf" it wrote like "rdf:Description" Because of this I
cannot see the data when I open it in protege editor. The individuals
hierarchy come like this
owl:Thing
Person(3)
protege:External Resource(1) -> here when I open the tuple shows
"<HTML><BODY><H3>Cannot Find This Webpage</H3></HTML>"
Can any one give solution for this.Why the Jena generate the code with *
rdf:Description.* I want to insert the tuples inside the *Person class* ie
Person rdf.
I can query and get all the result including the inserted data using jena
API program.
Sample query code is below.
String queryString ="PREFIX xmlns: <http://localhost:3030/per1.owl#>\r\n" +
"PREFIX base: <http://localhost:3030/per1.owl
>\r"+
"PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\r"+
"INSERT DATA" +
"{"+
"<http://localhost:3030/per1.owl#name>\n" +
"xmlns:hasFirstname \"Robin\" ^^ xsd:string;" +
"}";
writing file command
*model.write(fileour,"RDF/XML-ABBREV");*
Regards
Don