Class self referencing collection

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Class self referencing collection

Paulo Nuin
Hi

I am trying to implement a class based on a XML input file that have items with multiple entries. My initial approach was to setup a collection with a reference to its class

    <class name="SOterm" is-interface="true">
        <collection name=“synonym” reference=“SOterm" />
   </class>

And notice that after loading I get an infinite “recursion” of the same item in the web app model browser. I noticed that the same thing happens in some places on FlyMine.  

Is this the ideal approach for these types of collections or something else is preferred?

Thanks a lot

Paulo
_______________________________________________
dev mailing list
[hidden email]
https://lists.intermine.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Class self referencing collection

sergio contrino-2
hi paulo,
sorry for the slow reply...
i think this is the approach used for the parents in the ontologyTerm.
an alternative is, i suppose, something like what is done for the
ontology term synonyms, i.e. create a new class for the synonyms (see
below), maybe more user friendly.
thanks
sergio


   <class name="OntologyTerm" is-interface="true">
     <attribute name="identifier" type="java.lang.String"/>
     <attribute name="name" type="java.lang.String"/>
....
     <collection name="synonyms" referenced-type="OntologyTermSynonym" />
...
   </class>

  <class name="OntologyTermSynonym" is-interface="true">
     <attribute name="name" type="java.lang.String"/>
     <attribute name="type" type="java.lang.String"/>
   </class>



On 2020-07-22 18:12, Paulo Nuin wrote:

> Hi
>
> I am trying to implement a class based on a XML input file that have
> items with multiple entries. My initial approach was to setup a
> collection with a reference to its class
>
>     <class name="SOterm" is-interface="true">
>         <collection name=“synonym” reference=“SOterm" />
>    </class>
>
> And notice that after loading I get an infinite “recursion” of the
> same item in the web app model browser. I noticed that the same thing
> happens in some places on FlyMine.
>
> Is this the ideal approach for these types of collections or something
> else is preferred?
>
> Thanks a lot
>
> Paulo
> _______________________________________________
> dev mailing list
> [hidden email]
> https://lists.intermine.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
[hidden email]
https://lists.intermine.org/mailman/listinfo/dev