4 Replies Latest reply on Dec 7, 2017 2:31 PM by bmccamant

    Can someone confirm - what changes the Web ID for an attribute?

    bmccamant

      I cannot seem to find this definitely in the documentation. 

      Example is an AF element with attributes(s) which are PI point references.  If querying via the PI Web API - please confirm that

      • a change to the attribute name will cause the WebID to change
      • a change to the tagname in the PI point reference will not cause the WebID to change

      I presently don't have access to a PI system but need to get this answered.  Thanks

        • Re: Can someone confirm - what changes the Web ID for an attribute?
          dmalysheva

          Hello Bruce!

           

          You can find information on WebID here in following section of the user guide: https://livelibrary.osisoft.com/LiveLibrary/content/en/web-api-v1/GUID-0857C3F0-8A4F-4EE7-8E24-ECE4F4DEDD3A From there you can see that "PI Web API decodes the WebID and finds the object's unique ID along with the object's path"

          In terms of AF attribute with the PI Point Data Reference:

          • a change to the attribute name will cause the WebID to change - Yes, this is correct, WebID of the attribute will be changed in this case. Element name change will also affect attribute WebID. Renaming attribute will not change Element WebID.
          • a change to the tagname in the PI point reference will not cause the WebID to change - Attribute configuration does not affect WebID. If you change the tag in the PI Point Data Reference or rename it it will not affect AF Attribute WebID. In short - this is correct

           

          Please let me know if it answers your question.

          1 of 1 people found this helpful
            • Re: Can someone confirm - what changes the Web ID for an attribute?
              bmccamant

              This is what I needed confirmed - Thanks.

               

              Bruce C. McCamant

              TSI Group, Inc.

              817-253-2549

              Sent from my iPhone

                • Re: Can someone confirm - what changes the Web ID for an attribute?
                  gregor

                  Hello Bruce,

                   

                  Please see WebID for the relevant place in the documentation.

                  I have tested the behavior, please see the relevant pieces below:

                   

                  Attribute before name change

                  "WebId": "A0EH9QFrh_tfUGH6diPQZzdCgN6qpyMHO5xGCywAVXQJ8BQaIqy_8a9rUuaYJc39QTMtgQUZTRVJWRVJcSUJFUkRST0xBXFNPTUVXSEVSRUlOU1BBSU58VEVTVA",

                  "Id": "ffb28a68-bdc6-4bad-9a60-9737f504ccb6",

                  "Name": "test",

                   

                  Attribute after name change

                  "WebId": "A0EH9QFrh_tfUGH6diPQZzdCgN6qpyMHO5xGCywAVXQJ8BQaIqy_8a9rUuaYJc39QTMtgQUZTRVJWRVJcSUJFUkRST0xBXFNPTUVXSEVSRUlOU1BBSU58VEVTVFJFTkFNRQ",

                  "Id": "ffb28a68-bdc6-4bad-9a60-9737f504ccb6",

                  "Name": "testRename",

                   

                  Please note that the Attribute ID remains the same. The name change results into a path change which causes the changed WebID.

                  .. but you can still use the "old" WebID to find the Attribute!! This is because the WebID has an objects unique ID and the Path information. PI Web API first attempts to resolve by ID and if this fails by Path. For your use case, the ID doesn't change and hence, even the WebID has changed, the Attribute will be resolved by ID with the first attempt.

                   

                  If you delete and re-create an Attribute and the re-created Attribute has the exact same name, the ID will be a new one but the Path remains the same and on second attempt, PI Web API will find your Attribute. Only if you delete an Attribute and chose a different name for the re-created Attribute, PI Web API will not be able to find it by the "old" WebID.

                   

                  The next PI Web API release will introduce WebID version 2.0. I don't know any details yet but the new algorithm is supposed to generate shorter WebID's. The current WebID 1.0, if you like, will remain intact a few versions down the road.

              • Re: Can someone confirm - what changes the Web ID for an attribute?
                bmccamant

                Thanks to both of you for your timely responses.