From: <son...@gm...> - 2014-07-01 05:44:36
|
Hi, all I am trying to write a RDF/XML like follows: ------------------------------------------------------- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:KB="http://protege.stanford.edu/kb#"> <KB:EndToEndBlueprintRoot rdf:about="http://protege.stanford.edu/kb#DemoRootImagineID001"> xxxxx </KB:EndToEndBlueprintRoot> </rdf:RDF> ------------------------------------------------------- Here is my code ------------------------------------------------------- INode s = g.CreateUriNode("kb:"+"EndToEndBlueprintRoot"); INode p = g.CreateUriNode("rdf:about"); INode o = g.CreateUriNode("kb:"+"DemoRootImagineID001"); g.Assert(new Triple(s,p,o)); RdfXmlWriter rxw = new RdfXmlWriter(); string res = VDS.RDF.Writing.StringWriter.Write(g, rxw); ------------------------------------------------------- But only got this ------------------------------------------------------- <rdf:RDF xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns="http://example.org/" xmlns:a="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:kb="http://protege.stanford.edu/kb#" xmlns:ns0="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="&kb;EndToEndBlueprintRoot"> xxx <ns3:about xmlns:ns3="http://protege.stanford.edu/system#" rdf:resource="&kb;DemoRootImagineID001" /> </rdf:Description> </rdf:RDF> ------------------------------------------------------- Is my usage correct? or how can I output the format that I want? What is the appropriate writing of "rdf:about"? Any suggestion will be appreciated! son...@gm... |