3 Replies Latest reply: Feb 11, 2014 8:07 PM by Frank.Hampshire-Oracle RSS

    Reasoning across entity instances

    Rajan.Panchal

      Hi,

      Consider a below scenario:

      global entity

      -      the person entity

                - the person's incomes (will have enity instances like jan, feb, mar, apr, etc..)

       

      Now I have an attribute at global entity level - "highest income of the eldest person"

      To prove this above attribute I created a relationship between the global ->the person's incomes (one to many)

      and then used the InstanceValueIf() to retrieve the value. however this didn't worked.

      Then I had to change the relationship to many to many (inferred relationship) and using the "is member of" operator i had to prove this inferred relationship. I was able to retrieve value correctly.

       

      Can someone please help me understand why the first approach didn't worked?

      Thanks,

      Rajan

        • 1. Re: Reasoning across entity instances
          Frank.Hampshire-Oracle

          Rajan,

           

          The non-inferred relationship between global and income doesn't seem like a very good approach as you would have to explicitly define the relationship in order to get results. Perhaps this is why it didn't work.

           

           

          My approach would be to get the highest income for each person, the oldest person in this way.

           

          the person's highest income = InstanceMaximum(the person's incomes, the income value)


           

          the person is a member of the oldest persons if

             The person’s age = InstanceMaximum(all instances of the person, the person’s age)

           

          highest income of the eldest person = InstanceMaximum(the oldest persons, the person’s highest income)

           

           

          This result will give you the highest income of the oldest persons, so if there is more than one oldest person, the highest of their incomes is still chosen.

           

          Cheers

          Frank

          • 2. Re: Reasoning across entity instances
            Rajan.Panchal

            Hi  Frank,

            But  say if  I want  to  get  an  attribute value  from  the person's income entity  into  an  attribute at person level then I  can  directly retreive  value  without  using  the inferred relationship. So  why  these difference? I want  to understand why it doesn't  work? What I need  to do to make it  work. Although it is not a  good  approach still I want  to know..

            Thanks,

            Rajan

            • 3. Re: Reasoning across entity instances
              Frank.Hampshire-Oracle

              Rajan,

               

              I'd have to see the exact rules and properties to understand why your approach didn't work, technically it can, but introducing a non-inferred relationship between global and person's incomes essentially means more possibilities for unknown to creep into your reasoning.

               

              You can also do these sorts of things by lifting the data one level up at a time. In this case, reasoning the highest income for each person and then reasoning which of the person's highest income to choose. Taking this approach also helps to breakdown the problem into manageable chunks so you can see where there might be problems in your reasoning.

               

              Cheers

              Frank