[InterMine Dev] Perl Item API error: tried to set field ... to something other than

Pengcheng Yang pengchy at gmail.com
Tue Jul 21 09:41:53 BST 2015


Hi InterMiners,

I want to load customized data source. I have prepared the additions.xml 
file [1] and build successfully with command "ant clean build-db". 
However, when I produce the Item xml file, the following error [2] were 
encountered. I have searched the mail archive and got the thread 
http://gmod.827538.n3.nabble.com/Running-a-script-to-create-an-xml-file-causes-an-error-td4030315.html, 
which is very similar to my problem. I want to set the Samples.species 
as "reference" and Organism.OrgSamples as "collection", because one 
Sample only belong to one species, but one species can have many 
samples.  Different to the problem asked ago, what ever I set the 
Samples.species, "reference" or "collection", the error remain the same. 
Is there any details I missed? Look forward to your suggestions.

Thanks a lot!

Best,
Pengcheng Yang

[1] addtions.xml
<?xml version="1.0"?>
<!-- This file details any extensions needed to the data model to store 
data from this source, everything else is automatically generated from 
the model description so this is all we need to do to add to the model. -->

<classes>
         <class name="Expression" is-interface="true">
                 <attribute name="Expr" type="java.lang.Float"/>
                 <reference name="sample" referenced-type="Samples"/>
                 <reference name="gene" referenced-type="Gene" 
reverse-reference="Exprs"/>
         </class>

         <class name="Samples" is-interface="true">
                 <attribute name="primaryIdentifier" 
type="java.lang.String"/>
                 <attribute name="DevStag" type="java.lang.String"/>
                 <attribute name="Tissue" type="java.lang.String"/>
                 <attribute name="Treatment" type="java.lang.String"/>
                 <attribute name="year" type="java.lang.Integer"/>
                 <attribute name="phase" type="java.lang.String"/>
           <reference name="species" referenced-type="Organism" 
reverse-reference="OrgSamples"/>
         </class>

         <class name="Gene" is-interface="true">
                 <collection name="Exprs" referenced-type="Expression" 
reverse-reference="gene"/>
         </class>

         <class name="Organism" is-interface="true">
                 <collection name="OrgSamples" referenced-type="Samples" 
reverse-reference="species"/>
         </class>

</classes>

[2] error message:
tried to set field 'species' in class '[classname: Samples implements: 
]' to something other than type: Organism
  at /usr/lib64/perl5/lib/perl5//InterMine/Item.pm line 224, <I> line 1.
         InterMine::Item::set('InterMine::Item=HASH(0x1d14638)', 
'species', 7004) called at 
/usr/lib64/perl5/lib/perl5//InterMine/Item/Document.pm line 269

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.intermine.org/pipermail/dev/attachments/20150721/4be2776f/attachment-0001.html>


More information about the dev mailing list