[InterMine Dev] Running a script to create an xml file causes an error

Jayaraman, Pushkala pjayaraman at mcw.edu
Thu Mar 14 12:30:15 GMT 2013

Thanks Julie, 
This is what I was trying to do..
I guess I could simplify that somehow too.. 

Thanks again!


-----Original Message-----
From: Julie Sullivan [mailto:julie at flymine.org] 
Sent: Thursday, March 14, 2013 4:35 AM
To: Jayaraman, Pushkala
Cc: dev at intermine.org
Subject: Re: [InterMine Dev] Running a script to create an xml file causes an error

Hi Pushkala

I think this error message will make more sense to you once you understand how the model works:

 > tried to set field 'submissions' in class '[implements: Project]' to  > something other than type: InterMine::Model::Reference

`Project.submissions` is being set to something other than a reference. 
`Project.submissions` should be pointing to a single `Submission` object.

If you remember -

	`The "<reference>" tag defines a field in the class for storing
	a reference to another object in the database`

It should not be a collection of Submission objects or a simple value, e.g. a String.

Just guessing from the name, but I think Project.submissions might need to be a collection as the relationship between Project and Submission is one-to-many.

That would look something like:

<class name="Submission" is-interface="true">
	<reference name="project" referenced-type="Project" 
<class name="Project" is-interface="true">
	<collection name="submissions" referenced-type="Submission" 

Which would look like:

	Project.submissions (A project has a set of submissions)
	Submission.project (Each submission has a single project)

With Items XML like:

<item id="1_1" class="Project">
	<collection name="submissions">
		<reference ref_id="2_1"/>
		<reference ref_id="2_2"/>
<item id="2_1" class="Submission">
	<reference name="project" ref_id="1_1"/>
<item id="2_2" class="Submission">
	<reference name="project" ref_id="1_1"/>

But I could be misunderstanding what you're trying to do!


On 13/03/13 22:34, Jayaraman, Pushkala wrote:
> Hello,
> While we have some time, decided to try and run the script to load the data as well and this is what I found:
> The script breaks after a while and this is what it gives out:
> tried to set field 'submissions' in class '[implements: Project]' to 
> something other than type: InterMine::Model::Reference
> ive tried to set my additions.xml to look like this:
> <?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="Submission" is-interface="true">
>                  <collection name="dataPoints" referenced-type="DataPoint" reverse-reference="submission"/>
>                  <attribute name="experimentDate" type="java.util.Date"/>
>                  <reference name="publication" referenced-type="Publication"/>
>                  <attribute name="title" type="java.lang.String"/>
>          </class>
>          <class name="DataPoint" is-interface="true">
>                  <reference name="submission" referenced-type="Submission" reverse-reference="dataPoints"/>
>          </class>
>          <class name="eQTL" extends="DataPoint" is-interface="true">
>                  <attribute name="reaperPValue" type="java.lang.Float"/>
>                  <reference name="submission" referenced-type="Submission" reverse-reference="dataPoints"/>
>                  <reference name="sslv" referenced-type="SimpleSequenceLengthVariation"/>
>                  <reference name="probeSet" referenced-type="ProbeSet"/>
>                  <collection name="tissueExpressions" referenced-type="Expression"/>
>                  <reference name="organism" referenced-type="Organism"/>
>          </class>
>          <class name="Expression" is-interface="true">
>                  <attribute name="tissue" type="java.lang.String"/>
>                  <attribute name="foldChange" type="java.lang.Float"/>
>                  <attribute name="pval" type="java.lang.Float"/>
>                  <reference name="eqtl" referenced-type="eQTL" reverse-reference="tissueExpressions"/>
>          </class>
>          <class name="ProbeSet" extends="SequenceCollection" is-interface="true">
>                  <collection name="eqtls" referenced-type="eQTL" reverse-reference="probeSet"/>
>          </class>
>          <class name="SimpleSequenceLengthVariation" is-interface="true">
>                  <collection name="eqtls" referenced-type="eQTL" reverse-reference="sslv"/>
>          </class>
>          <class name="Project" is-interface="true">
>                  <attribute name="name" type="java.lang.String"/>
>                  <reference name="submissions" referenced-type="DataPoint"/>
>          </class>
> </classes>
> Do let me know where I can begin debugging this..
> Thanks,
> Pushkala Jayaraman
> Programmer/Analyst - Rat Genome Database Human and Molecular Genetics 
> Center Medical College of Wisconsin
> 414-955-2229
> http://rgd.mcw.edu
> _______________________________________________
> dev mailing list
> dev at intermine.org
> http://mail.intermine.org/cgi-bin/mailman/listinfo/dev

More information about the dev mailing list