|
From: <son...@gm...> - 2014-07-01 10:23:55
|
Thank you Tom!
You are right, basically what I am trying to do is converting following class:
-------------------------------------
class MyClass01 {
public string Property01 {get; set;}
public MyClass02 myClass02 {get; set;}
}
//the instance of class has its own unique id
-------------------------------------
to this kind of text
-------------------------------------
<rdf:RDF xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns# xmlns:KB="http://protege.stanford.edu/kb#">
<KB:MyClass01 rdf:about="that unique id">
<hasProperty01 >the value of this property</hasProperty01>
<MyClass02 rdf:about="the unique id">
//MyClass02's content
</MyClass02>
</KB:EndToEndBlueprintRoot>
</rdf:RDF>
-------------------------------------
Also I have to use this kind of format because it is the input of another system I have to use...
Thank you again!
son...@gm...
From: Tomasz Pluskiewicz
Date: 2014-07-01 10:13
To: dotNetRDF Developer Discussion and Feature Request
Subject: Re: [dotNetRDF-Develop] Writing <rdf:about> as RDF/XML format
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
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
dotNetRDF-develop mailing list
dot...@li...
https://lists.sourceforge.net/lists/listinfo/dotnetrdf-develop |