From: Rob V. <rv...@do...> - 2012-06-01 16:29:01
|
Hi Jerin There is a key difference between GetUriNode() and CreateUriNode() which I guess is not as clearly explained as it might be in the documentation. It is mentioned in [1] under the Selecting Nodes section but not explicitly called out in the intellisense documentation The difference is that GetUriNode() retrieves a Node only if it appears in the Graph and returns null otherwise. Whereas CreateUriNode() creates a new node associated with that Graph and always gives a value (or in the case of a malformed Qname used to create a URI an exception) We'll adjust the documentation appropriately to make this clearer Thanks, Rob Vesse From: 堆烟・雷云纹(Jerin Lee) <jer...@ya...> Reply-To: 堆烟・雷云纹(Jerin Lee) <jer...@ya...>, dotNetRDF User Help and Support <dot...@li...> Date: Thursday, May 31, 2012 11:01 PM To: "dot...@li..." <dot...@li...> Subject: [dotNetRDF-Support] A question about Graph.GetUriNode > Hi, Guys. > I love the framework very much! But now I'm confused about the method: > Graph.GetUriNode. > The turtle content is at the bottom of this letter. > In my code: > INode nodeConcept = g.GetUriNode( new Uri( > "http://www.chuci.info/schema/synonymset#Concept") ); > INode nodeUri = g.GetUriNode( new Uri( > "http://www.chuci.info/schema/synonymset#uri" ) ); > > The first variable nodeConcept is right, but nodeUri is always null :( > I add the following code, I don't know why, but it works well finally. > if(nodeUri == null) > nodeUri = g.CreateUriNode( new Uri( > "http://www.chuci.info/schema/synonymset#uri") ); > > In normal sense GetUriNode should work, but instead CreateUriNode works > correctly. > I tried but found nothing helpful at dotnetrdf.org, so I write this letter. > > [Turtle Content] > > @base <http://www.chuci.info/schema/synonymset#>. > @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. > @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. > @prefix xsd: <http://www.w3.org/2001/XMLSchema#>. > @prefix ss: <http://www.chuci.info/schema/synonymset#>. > > ss:Concept ss:id "e31c44b7f8994d399865d8c315b77daa"; > ss:name "gender"@en-us, > "性别"@zh-cn; > ss:uri <http://schema.org/gender>, > <http://xmlns.com/foaf/0.1/gender>. > > > Waiting your answer! > Thank you very much! > Jerin > 2012-6-1 > > |我的脚步在落日里 > |我的影子在冬风里 > |我的梦在旷野里 > |在月亮升起的时候 > |我会遥望 > |我看到 > |我长出了翅膀 > ------------------------------------------------------------------------------ > Live Security Virtual Conference Exclusive live event will cover all the ways > today's security and threat landscape has changed and how IT managers can > respond. Discussions will include endpoint security, mobile security and the > latest in malware threats. > http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_____________________ > __________________________ dotNetRDF-Support mailing list > dot...@li... > https://lists.sourceforge.net/lists/listinfo/dotnetrdf-support |