There is no warning when referencing to a wrong type

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

There is no warning when referencing to a wrong type

Chen, Yian
Hi,

Not sure if this issue has been raised before.

When doing the integration, if we set a reference or add to a collection
with a wrong reference type, there is no complain from the program.
For example, I can set a Publication instance to an attribute which is
supposed to be a Gene class.
Of course the wrong data will not be displayed in the report page (or else).

I believe this mistake may worth to get a runtime exception when doing
the integration.
What do you think?

--
Yi-An Chen
Laboratory of Bioinformatics,
National Institutes of Biomedical Innovation, Health and Nutrition,
Osaka, Japan

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

Re: There is no warning when referencing to a wrong type

sergio contrino-2
dear Chen Yi-An,
thank you for your message and suggestion. an error in the model (e.g.
reference to non existing class) should be detected when building your
mine. if this did not happen please let us know (with some info
regarding your model additions not triggering the error).
please note that we are not putting constraints on how you want to model
your data though.
please let me know if i misunderstood your question
thank you!
sergio

On 2020-07-29 04:14, Chen, Yi-An wrote:

> Hi,
>
> Not sure if this issue has been raised before.
>
> When doing the integration, if we set a reference or add to a
> collection with a wrong reference type, there is no complain from the
> program.
> For example, I can set a Publication instance to an attribute which is
> supposed to be a Gene class.
> Of course the wrong data will not be displayed in the report page (or
> else).
>
> I believe this mistake may worth to get a runtime exception when doing
> the integration.
> What do you think?

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

Re: There is no warning when referencing to a wrong type

Chen, Yian
Hi Sergio,

Thanks for your reply.
I am afraid I didn't explain my question clearly.

Suppose the additions settings is as following:
     <class name="Pathway" is-interface="true" >
         <attribute name="identifier" type="java.lang.String"/>
         <attribute name="name" type="java.lang.String"/>
         <reference name="organism" referenced-type="Organism"/>
         <collection name="genes" referenced-type="Gene"
reverse-reference="pathways"/>
         <collection name="dataSets" referenced-type="DataSet"/>
     </class>

In the data converter, of I do this:
             Item publication = createItem("Publication");
publication.setAttribute("pubMedId", pubmedId);
             store(publication);

             Item pathway = createItem("Pathway");
             pathway.setAttribute("identifier", pathwayId);
pathway.addToCollection("genes", publication);
             store(pathway);

I won't get any problem when building my mine.
As you can see, I add a Publication item to a collection which should be
a Gene class.
I hope I can get errors during the building process.

Do let me know if anything is still unclear.


Chen


On 2020/07/29 17:32, [hidden email] wrote:

> dear Chen Yi-An,
> thank you for your message and suggestion. an error in the model (e.g.
> reference to non existing class) should be detected when building your
> mine. if this did not happen please let us know (with some info
> regarding your model additions not triggering the error).
> please note that we are not putting constraints on how you want to
> model your data though.
> please let me know if i misunderstood your question
> thank you!
> sergio
>
> On 2020-07-29 04:14, Chen, Yi-An wrote:
>> Hi,
>>
>> Not sure if this issue has been raised before.
>>
>> When doing the integration, if we set a reference or add to a
>> collection with a wrong reference type, there is no complain from the
>> program.
>> For example, I can set a Publication instance to an attribute which is
>> supposed to be a Gene class.
>> Of course the wrong data will not be displayed in the report page (or
>> else).
>>
>> I believe this mistake may worth to get a runtime exception when doing
>> the integration.
>> What do you think?
>

--
Laboratory of Bioinformatics,
National Institutes of Biomedical Innovation, Health and Nutrition,
Osaka, Japan

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

Re: There is no warning when referencing to a wrong type

sergio contrino-2
dear Chen,
thank you, i get it now. it is a bit a funny error to make, but i see
your point. i'll test and make a ticket. if you have already added a fix
to your code please make a pull request.
thank you!
sergio

On 2020-07-29 10:00, Chen, Yi-An wrote:

> Hi Sergio,
>
> Thanks for your reply.
> I am afraid I didn't explain my question clearly.
>
> Suppose the additions settings is as following:
>     <class name="Pathway" is-interface="true" >
>         <attribute name="identifier" type="java.lang.String"/>
>         <attribute name="name" type="java.lang.String"/>
>         <reference name="organism" referenced-type="Organism"/>
>         <collection name="genes" referenced-type="Gene"
> reverse-reference="pathways"/>
>         <collection name="dataSets" referenced-type="DataSet"/>
>     </class>
>
> In the data converter, of I do this:
>             Item publication = createItem("Publication");
> publication.setAttribute("pubMedId", pubmedId);
>             store(publication);
>
>             Item pathway = createItem("Pathway");
>             pathway.setAttribute("identifier", pathwayId);
> pathway.addToCollection("genes", publication);
>             store(pathway);
>
> I won't get any problem when building my mine.
> As you can see, I add a Publication item to a collection which should
> be a Gene class.
> I hope I can get errors during the building process.
>
> Do let me know if anything is still unclear.
>
>
> Chen
>
>
> On 2020/07/29 17:32, [hidden email] wrote:
>> dear Chen Yi-An,
>> thank you for your message and suggestion. an error in the model (e.g.
>> reference to non existing class) should be detected when building your
>> mine. if this did not happen please let us know (with some info
>> regarding your model additions not triggering the error).
>> please note that we are not putting constraints on how you want to
>> model your data though.
>> please let me know if i misunderstood your question
>> thank you!
>> sergio
>>
>> On 2020-07-29 04:14, Chen, Yi-An wrote:
>>> Hi,
>>>
>>> Not sure if this issue has been raised before.
>>>
>>> When doing the integration, if we set a reference or add to a
>>> collection with a wrong reference type, there is no complain from the
>>> program.
>>> For example, I can set a Publication instance to an attribute which
>>> is
>>> supposed to be a Gene class.
>>> Of course the wrong data will not be displayed in the report page (or
>>> else).
>>>
>>> I believe this mistake may worth to get a runtime exception when
>>> doing
>>> the integration.
>>> What do you think?
>>

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

Re: There is no warning when referencing to a wrong type

Chen, Yian
Dear Sergio,

I didn't do any fix about it.
Looking forward to see the update.

Best,

Chen



On 2020/07/29 18:17, [hidden email] wrote:

> dear Chen,
> thank you, i get it now. it is a bit a funny error to make, but i see
> your point. i'll test and make a ticket. if you have already added a
> fix to your code please make a pull request.
> thank you!
> sergio
>
> On 2020-07-29 10:00, Chen, Yi-An wrote:
>> Hi Sergio,
>>
>> Thanks for your reply.
>> I am afraid I didn't explain my question clearly.
>>
>> Suppose the additions settings is as following:
>>     <class name="Pathway" is-interface="true" >
>>         <attribute name="identifier" type="java.lang.String"/>
>>         <attribute name="name" type="java.lang.String"/>
>>         <reference name="organism" referenced-type="Organism"/>
>>         <collection name="genes" referenced-type="Gene"
>> reverse-reference="pathways"/>
>>         <collection name="dataSets" referenced-type="DataSet"/>
>>     </class>
>>
>> In the data converter, of I do this:
>>             Item publication = createItem("Publication");
>> publication.setAttribute("pubMedId", pubmedId);
>>             store(publication);
>>
>>             Item pathway = createItem("Pathway");
>>             pathway.setAttribute("identifier", pathwayId);
>> pathway.addToCollection("genes", publication);
>>             store(pathway);
>>
>> I won't get any problem when building my mine.
>> As you can see, I add a Publication item to a collection which should
>> be a Gene class.
>> I hope I can get errors during the building process.
>>
>> Do let me know if anything is still unclear.
>>
>>
>> Chen
>>
>>
>> On 2020/07/29 17:32, [hidden email] wrote:
>>> dear Chen Yi-An,
>>> thank you for your message and suggestion. an error in the model
>>> (e.g. reference to non existing class) should be detected when
>>> building your mine. if this did not happen please let us know (with
>>> some info regarding your model additions not triggering the error).
>>> please note that we are not putting constraints on how you want to
>>> model your data though.
>>> please let me know if i misunderstood your question
>>> thank you!
>>> sergio
>>>
>>> On 2020-07-29 04:14, Chen, Yi-An wrote:
>>>> Hi,
>>>>
>>>> Not sure if this issue has been raised before.
>>>>
>>>> When doing the integration, if we set a reference or add to a
>>>> collection with a wrong reference type, there is no complain from the
>>>> program.
>>>> For example, I can set a Publication instance to an attribute which is
>>>> supposed to be a Gene class.
>>>> Of course the wrong data will not be displayed in the report page
>>>> (or else).
>>>>
>>>> I believe this mistake may worth to get a runtime exception when doing
>>>> the integration.
>>>> What do you think?
>>>
>
_______________________________________________
dev mailing list
[hidden email]
https://lists.intermine.org/mailman/listinfo/dev