locked
How to update a BlankNode? RRS feed

  • Question

  • Hi. I am not able to Update blanknodes. So could anyone help me in this regard?

    Suppose I have the following structure and I want to update Street and City , then How can I do that? I am able to update UserName and FirstName but getting error while updating Street and City.

    Following is the error.

    "Microsoft.ConnectedServices.Sdk.Messaging.SoapFaultException: No valid data found to be updated."

    <?xml version="1.0" encoding="utf-8" ?>
    <rdf:RDF xmlns:csf="http://schemas.microsoft.com/connectedservices/pm#/"
    xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
      <rdf:Description rdf:about=http://schemas.microsoft.com/connectedservices/pm#/TestUser@hotmail.com>
      <csf:UserName>TestUser@hotmail.com</csf:UserName>
      <csf:FirstName>TestUser</csf:FirstName>
      <csf:Address>
        <rdf:Description>
          <csf:Street>Pine</csf:Street>
          <csf:City>Seattle</csf:City>
        </rdf:Description>
      </csf:Address>
     </rdf:Description>
    </rdf:RDF>

    I am using the same code for BlankNode updation that I am using for updating general node. So I believe, I am doing the mistake here. However, I am not able to write the code that should update the blanknode.

    Also I would like to know one more thing. Suppose I want to update UserName,FirstName,Street and City.While updaing the above rdf, how will we know in advance that a node is a blanknode or a general node?

    Please help me with some code snippet that would update the blanknode.

    Thank you.

     

     

     

     

    Monday, November 6, 2006 4:33 AM

Answers

  • Hello - I am currently writing a blog for this issue as lots of people are facing this issue. Once I post that I'll update this thread with the post URL. 

    However regarding your question on how to determine whether a node is BlankNode or Regular node, you could use the idea I have explained in the code snippet below.

    // Let us say YourMethodToGetTheTriple returns the triple you are interested in.

    RdfTriple AddressInfoTriple = YourMethodToGetTheTriple();

    // Ensure we got a triple with the blank node in its value

    Debug.Assert(AddressInfoTriple.Value is RdfBlankNode);

    if (AddressInfoTriple.Value is RdfBlankNode){

    // Your logic to handle the BlankNode could go here

    }

    else{

    // Your logic to handle the regular node could go here

    }

    Thanks

     

    Wednesday, December 6, 2006 6:34 AM