Topic
6 replies Latest Post - ‏2013-03-13T10:50:19Z by SystemAdmin
ToddWilliams
ToddWilliams
10 Posts
ACCEPTED ANSWER

Pinned topic After adding new relationship, GSR0018E now occurs on existing objects

‏2011-05-09T15:49:44Z |
I have created a new relationship into my business model. The new relationship, "isProvidedBy", is an optional link from an ServiceLevelDefinition (SLD) to the Application Version (AV).

The following elements were added to the OWL file:


<owl:Class rdf:about=
"&NW;ServiceLevelDefinition"> ... <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource=
"&NW;isProvidedBy"/> <owl:minCardinality>0</owl:minCardinality> </owl:Restriction> </rdfs:subClassOf>   ...   <owl:ObjectProperty rdf:about=
"&NW;isProvidedBy"> <rdfs:domain rdf:resource=
"&NW;ServiceLevelDefinition"/> <rdfs:range rdf:resource=
"&NW;ApplicationVersion"/> <rdfs:label>Is Provided By</rdfs:label> </owl:ObjectProperty>


The relationship works correctly for any newly created SLD objects, however not for existing objects. One problem is the relationship definition is not present in existing objects and thus cannot be added through Edit Relationships (this is unfortunate, but understandable).

The bigger problem is that I now cannot edit any properties or relationships on existing SLDs. Any attempt to do so yields this error:


There was a problem updating the properties on the entity with name Place Services_Version_SLD1 and type concept. GSR0018E: Object 
"Place Services_Version_SLD1" is missing the required business model property 
"NW_isProvidedBy" of type 
"http://net.nwie.serviceregistry#ApplicationVersion".


As shown in the OWL code above, the minCardinality is 0, so I don't know why its assumed to be 'required'.

This only occurs on existing SLDs, not on new SLDs that were created after the business model change, thus it seems to be an issue of the pre-existing objects now needing to be 'updated' with to the new business model definition. But how can this be done, short of deleting them all and recreating them (which is not feasible)?

Thanks,
Todd
Updated on 2013-03-13T10:50:19Z at 2013-03-13T10:50:19Z by SystemAdmin
  • ToddWilliams
    ToddWilliams
    10 Posts
    ACCEPTED ANSWER

    Re: After adding new relationship, GSR0018E now occurs on existing objects

    ‏2011-05-09T15:51:48Z  in response to ToddWilliams
    BTW, I am using 7.0.0.3
  • cltnc28269
    cltnc28269
    24 Posts
    ACCEPTED ANSWER

    Re: After adding new relationship, GSR0018E now occurs on existing objects

    ‏2011-05-10T01:30:31Z  in response to ToddWilliams
    WSRR complains that a property by name "NW_isProvidedBy" is missing in the object. Though the cardinality is zero, the property itself should be added to the object. You can resolve this by adding the missing property explicitly, using generic Add Property under Additional Properties section of the existing object.

    As a side note, you can add properties _or relationships in one iteration but not both. If you add both types, the WSRR UI doesn't let you update the existing object because if you go to add properties, it will ask about relationships and if you go to relationships it will throw error about properties. This may change in future version but that is what I found out in 7.0.0 fixpack 3.
  • ToddWilliams
    ToddWilliams
    10 Posts
    ACCEPTED ANSWER

    Re: After adding new relationship, GSR0018E now occurs on existing objects

    ‏2011-05-10T14:40:04Z  in response to ToddWilliams
    Actually, it's a relationship, not a property, but you're right -- I was able to manually add the custom relationship through the Edit Relationships section and that worked. It seems to have even linked up with my original definition, because it even shows the label that I originally defined for isDefinedBy ("Is Defined By"). Thank you for that suggestion.

    Now the problem is, how do I do that for every SLD in my WSRR repository? That will be a massive undertaking unless I can do it an automated way. I suppose I might be able to write something using the Java API. So, is this really what I will need to do going forward anytime we need to add a new property or relationship to the business model? It seems like there should be a better solution for this.
    • cltnc28269
      cltnc28269
      24 Posts
      ACCEPTED ANSWER

      Re: After adding new relationship, GSR0018E now occurs on existing objects

      ‏2011-05-10T20:36:52Z  in response to ToddWilliams
      Yes - I meant relationship. Good to know it worked.

      I have ran into the same situation when I renamed relationship. All the old relationships showed up as zombies. And I had to add new relationship manually for each of the objects created with previous model.
  • ToddWilliams
    ToddWilliams
    10 Posts
    ACCEPTED ANSWER

    Re: After adding new relationship, GSR0018E now occurs on existing objects

    ‏2011-05-11T18:52:23Z  in response to ToddWilliams
    I found another solution. I created a new class in my business model called SLD2 and made it a subclass of SLD (generalization relationship to SLD). I then moved my new 'isProvidedBy' relationship to the subclass. This way, the original definition of SLD has not changed, but a new subclass has been added. Now I can update existing SLDs without getting that error. I then modified my UI code so that any actions that created new SLDs now create SLD2s instead. Any code that queries SLD was left alone (since SLD is the parent class of SLD2, a query on SLD objects would return both types).

    So now any new SLD that is created will actually be of type SLD2 and will contain the new relationship, while all existing SLDs remain of type SLD and do not have the relationship. As cltnc suggested, if I need to add the relationship to an existing object, I can just add a user relationship with the same name. Fortunately, this is no longer required for updating the object -- only if I need to add that new relationship to the object.

    This seems to work well and is probably the best solution I'm going to find. Although if anyone thinks of something else, I'd be interested.
  • SystemAdmin
    SystemAdmin
    141 Posts
    ACCEPTED ANSWER

    Re: After adding new relationship, GSR0018E now occurs on existing objects

    ‏2013-03-13T10:50:19Z  in response to ToddWilliams
    There is another approach: you can set optional=True in the Advanced panel for the relationship in WSRR Studio. (The default is optional=False). After this you will be able to edit entities created with the previous model which do not have this relationship.