From: Tomasz P. <tom...@gm...> - 2014-07-01 09:14:13
|
On Tue, Jul 1, 2014 at 7:44 AM, son...@gm... <son...@gm...> wrote: > 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> > ------------------------------------------------------- > First of all this document is not a valid RDF/XML. > 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); > ------------------------------------------------------- > Secondly, the rdf:about is just a RDF/XML syntax feature and not a predicate. It denotes that part of an RDF/XML document is grouped with a common subject. Please read [1]. You should think in terms of triples, which define a relation (predicate) between two objects (subjects and objects). That is much like in natural language. > > 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"? > You probably mean kb:DemoRootImagineID001 as you subject, that is the thing you want to describe in your document. Is that right? Please describe what kind of data you want your document to contain. > > Any suggestion will be appreciated! > > ________________________________ > son...@gm... > Regards, Tom [1] http://stackoverflow.com/questions/7118326/differences-between-rdfresource-rdfabout-and-rdfid |