How the heck do I update an intermineobject record from the corresponding object table?

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How the heck do I update an intermineobject record from the corresponding object table?

Sam Hokin-3
I think Joe has been through all this, and perhaps I'm trying to reinvent his wheel here, but I'm completely mystified as to how to
"correctly" update the object store when I've got data I WANT in the object's table (say organism), but the intermineobject data is
hosed due to whatever reasons (in this case, I'm hacking a species with two varieties/genomes on one taxonId and the organisms got
hosed, I think, in intermineobject by entrez-organism).

So, for example, here's a GOOD record in the organism table:

chickpeamine=> select * from organism where taxonid =3885;
-[ RECORD 1 ]--------------------------------
variety    |
id         | 4000005
chadoid    |
comment    |
species    | vulgaris
genus      | Phaseolus
taxonid    | 3885
name       | Phaseolus vulgaris
commonname | string bean
shortname  | P. vulgaris
class      | org.intermine.model.bio.Organism

And here's the corresponding BAD record in intermineobject, which is what you see on the mine or get from a PathQuery:

chickpeamine=> select * from intermineobject where id=4000005;
-[ RECORD 1 ]-----------------------------------------------------------------
object | $_^org.intermine.model.bio.Organism$_^ataxonId$_^3885$_^aid$_^4000005
id     | 4000005
class  | org.intermine.model.bio.Organism

That's right, no species, no genus, no name, no commonname, no shortname.

So I'd like to write the Most Important Utility You Could Ever Want For Intermine, one that simply updates intermineobject records
from the data for the class of interest, in this case the organism table for org.intermine.model.bio.Organism.

I've attached my attempt, but when I try to store an attribute like:

Attribute [item=1112685, name="variety", value="desi"]

it throws the following:

Exception in thread "main" org.intermine.objectstore.ObjectStoreException: Object [class org.intermine.model.fulldata.Attribute]
does not map onto any database table.
at org.intermine.objectstore.intermine.ObjectStoreWriterInterMineImpl.storeWithConnection(ObjectStoreWriterInterMineImpl.java:748)
        at org.intermine.objectstore.intermine.ObjectStoreWriterInterMineImpl.store(ObjectStoreWriterInterMineImpl.java:581)
        at org.intermine.dataconversion.ObjectStoreItemWriter.store(ObjectStoreItemWriter.java:102)
        at org.ncgr.intermine.OSUpdater.main(Unknown Source)

even though my Attribute instance seems perfectly well formed. (There's very little docs on the org.intermine.model.fulldata
package, so part of my problem is I'm poring over the source code for those classes, but they're pretty simple.)

HELP?

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

OSUpdater.java (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How the heck do I update an intermineobject record from the corresponding object table?

joe carlson
I submitted a pull request to doing this.

https://github.com/intermine/intermine/pull/1526

Now, I clearly do not understand pull requests very well. The 3 files that you need are antlib-os.xml, BuildTriggerMaker.java and objectstore.xml. Some other files made it in here by mistake. (How can I remove them?) If you can grab them and put them in your proper directory tree, then go to your dbmodel directory and type

ant build-sql-triggers

connect to the db and

\i build/model/TriggerMaker.sql

<do your stuff>

\i build/model/TriggerRemover.sql

Look in the code for BuildTriggerMaker.java for more details. And the warnings.

In the meantime, make a backup of your mine. And let me know if things do not work.

joe


On 04/18/2017 05:44 PM, Sam Hokin wrote:
I think Joe has been through all this, and perhaps I'm trying to reinvent his wheel here, but I'm completely mystified as to how to "correctly" update the object store when I've got data I WANT in the object's table (say organism), but the intermineobject data is hosed due to whatever reasons (in this case, I'm hacking a species with two varieties/genomes on one taxonId and the organisms got hosed, I think, in intermineobject by entrez-organism).

So, for example, here's a GOOD record in the organism table:

chickpeamine=> select * from organism where taxonid =3885;
-[ RECORD 1 ]--------------------------------
variety    |
id         | 4000005
chadoid    |
comment    |
species    | vulgaris
genus      | Phaseolus
taxonid    | 3885
name       | Phaseolus vulgaris
commonname | string bean
shortname  | P. vulgaris
class      | org.intermine.model.bio.Organism

And here's the corresponding BAD record in intermineobject, which is what you see on the mine or get from a PathQuery:

chickpeamine=> select * from intermineobject where id=4000005;
-[ RECORD 1 ]-----------------------------------------------------------------
object | $_^org.intermine.model.bio.Organism$_^ataxonId$_^3885$_^aid$_^4000005
id     | 4000005
class  | org.intermine.model.bio.Organism

That's right, no species, no genus, no name, no commonname, no shortname.

So I'd like to write the Most Important Utility You Could Ever Want For Intermine, one that simply updates intermineobject records from the data for the class of interest, in this case the organism table for org.intermine.model.bio.Organism.

I've attached my attempt, but when I try to store an attribute like:

Attribute [item=1112685, name="variety", value="desi"]

it throws the following:

Exception in thread "main" org.intermine.objectstore.ObjectStoreException: Object [class org.intermine.model.fulldata.Attribute] does not map onto any database table.
at org.intermine.objectstore.intermine.ObjectStoreWriterInterMineImpl.storeWithConnection(ObjectStoreWriterInterMineImpl.java:748)
    at org.intermine.objectstore.intermine.ObjectStoreWriterInterMineImpl.store(ObjectStoreWriterInterMineImpl.java:581)
    at org.intermine.dataconversion.ObjectStoreItemWriter.store(ObjectStoreItemWriter.java:102)
    at org.ncgr.intermine.OSUpdater.main(Unknown Source)

even though my Attribute instance seems perfectly well formed. (There's very little docs on the org.intermine.model.fulldata package, so part of my problem is I'm poring over the source code for those classes, but they're pretty simple.)

HELP?


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


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

Re: How the heck do I update an intermineobject record from the corresponding object table?

Paulo Nuin
Hi Joe 


On Apr 18, 2017, at 7:13 PM, Joe Carlson <[hidden email]> wrote:

I submitted a pull request to doing this.

https://github.com/intermine/intermine/pull/1526

Now, I clearly do not understand pull requests very well. The 3 files that you need are antlib-os.xml, BuildTriggerMaker.java and objectstore.xml. Some other files made it in here by mistake. (How can I remove them?)


Did you

>git add .
>git commit -m ….
?

You can try just using 

>git revert HEAD~1 -m 1

to revert the commit and remove it from history. 

>git add <filename> …

to add specific file(s)

and then commit.

Cheers
Paulo



If you can grab them and put them in your proper directory tree, then go to your dbmodel directory and type

ant build-sql-triggers

connect to the db and

\i build/model/TriggerMaker.sql

<do your stuff>

\i build/model/TriggerRemover.sql

Look in the code for BuildTriggerMaker.java for more details. And the warnings.

In the meantime, make a backup of your mine. And let me know if things do not work.

joe


On 04/18/2017 05:44 PM, Sam Hokin wrote:
I think Joe has been through all this, and perhaps I'm trying to reinvent his wheel here, but I'm completely mystified as to how to "correctly" update the object store when I've got data I WANT in the object's table (say organism), but the intermineobject data is hosed due to whatever reasons (in this case, I'm hacking a species with two varieties/genomes on one taxonId and the organisms got hosed, I think, in intermineobject by entrez-organism).

So, for example, here's a GOOD record in the organism table:

chickpeamine=> select * from organism where taxonid =3885;
-[ RECORD 1 ]--------------------------------
variety    |
id         | 4000005
chadoid    |
comment    |
species    | vulgaris
genus      | Phaseolus
taxonid    | 3885
name       | Phaseolus vulgaris
commonname | string bean
shortname  | P. vulgaris
class      | org.intermine.model.bio.Organism

And here's the corresponding BAD record in intermineobject, which is what you see on the mine or get from a PathQuery:

chickpeamine=> select * from intermineobject where id=4000005;
-[ RECORD 1 ]-----------------------------------------------------------------
object | $_^org.intermine.model.bio.Organism$_^ataxonId$_^3885$_^aid$_^4000005
id     | 4000005
class  | org.intermine.model.bio.Organism

That's right, no species, no genus, no name, no commonname, no shortname.

So I'd like to write the Most Important Utility You Could Ever Want For Intermine, one that simply updates intermineobject records from the data for the class of interest, in this case the organism table for org.intermine.model.bio.Organism.

I've attached my attempt, but when I try to store an attribute like:

Attribute [item=1112685, name="variety", value="desi"]

it throws the following:

Exception in thread "main" org.intermine.objectstore.ObjectStoreException: Object [class org.intermine.model.fulldata.Attribute] does not map onto any database table.
at org.intermine.objectstore.intermine.ObjectStoreWriterInterMineImpl.storeWithConnection(ObjectStoreWriterInterMineImpl.java:748)
    at org.intermine.objectstore.intermine.ObjectStoreWriterInterMineImpl.store(ObjectStoreWriterInterMineImpl.java:581)
    at org.intermine.dataconversion.ObjectStoreItemWriter.store(ObjectStoreItemWriter.java:102)
    at org.ncgr.intermine.OSUpdater.main(Unknown Source)

even though my Attribute instance seems perfectly well formed. (There's very little docs on the org.intermine.model.fulldata package, so part of my problem is I'm poring over the source code for those classes, but they're pretty simple.)

HELP?


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

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


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

Re: How the heck do I update an intermineobject record from the corresponding object table?

joe carlson

On Apr 18, 2017, at 8:00 PM, Paulo Nuin <[hidden email]> wrote:

Hi Joe 


On Apr 18, 2017, at 7:13 PM, Joe Carlson <[hidden email]> wrote:

I submitted a pull request to doing this.

https://github.com/intermine/intermine/pull/1526

Now, I clearly do not understand pull requests very well. The 3 files that you need are antlib-os.xml, BuildTriggerMaker.java and objectstore.xml. Some other files made it in here by mistake. (How can I remove them?)


Did you

>git add .
>git commit -m ….
?



yeah. Did all that.


You can try just using 

>git revert HEAD~1 -m 1

to revert the commit and remove it from history. 

>git add <filename> …

to add specific file(s)

and then commit.

That should help with the extraneous files that got added.

Julie told me that my first version did not pass the checkstyle test. So I modified, got it to pass and committed the update. now what? does the pull request automatically update to the new file? or do I need to do something to update the pull request myself?

Joe


Cheers
Paulo



If you can grab them and put them in your proper directory tree, then go to your dbmodel directory and type 

ant build-sql-triggers

connect to the db and 

\i build/model/TriggerMaker.sql

<do your stuff>

\i build/model/TriggerRemover.sql

Look in the code for BuildTriggerMaker.java for more details. And the warnings.

In the meantime, make a backup of your mine. And let me know if things do not work.

joe


On 04/18/2017 05:44 PM, Sam Hokin wrote:
I think Joe has been through all this, and perhaps I'm trying to reinvent his wheel here, but I'm completely mystified as to how to "correctly" update the object store when I've got data I WANT in the object's table (say organism), but the intermineobject data is hosed due to whatever reasons (in this case, I'm hacking a species with two varieties/genomes on one taxonId and the organisms got hosed, I think, in intermineobject by entrez-organism). 

So, for example, here's a GOOD record in the organism table: 

chickpeamine=> select * from organism where taxonid =3885; 
-[ RECORD 1 ]-------------------------------- 
variety    | 
id         | 4000005 
chadoid    | 
comment    | 
species    | vulgaris 
genus      | Phaseolus 
taxonid    | 3885 
name       | Phaseolus vulgaris 
commonname | string bean 
shortname  | P. vulgaris 
class      | org.intermine.model.bio.Organism 

And here's the corresponding BAD record in intermineobject, which is what you see on the mine or get from a PathQuery: 

chickpeamine=> select * from intermineobject where id=4000005; 
-[ RECORD 1 ]----------------------------------------------------------------- 
object | $_^org.intermine.model.bio.Organism$_^ataxonId$_^3885$_^aid$_^4000005 
id     | 4000005 
class  | org.intermine.model.bio.Organism 

That's right, no species, no genus, no name, no commonname, no shortname. 

So I'd like to write the Most Important Utility You Could Ever Want For Intermine, one that simply updates intermineobject records from the data for the class of interest, in this case the organism table for org.intermine.model.bio.Organism. 

I've attached my attempt, but when I try to store an attribute like: 

Attribute [item=1112685, name="variety", value="desi"] 

it throws the following: 

Exception in thread "main" org.intermine.objectstore.ObjectStoreException: Object [class org.intermine.model.fulldata.Attribute] does not map onto any database table. 
at org.intermine.objectstore.intermine.ObjectStoreWriterInterMineImpl.storeWithConnection(ObjectStoreWriterInterMineImpl.java:748)
    at org.intermine.objectstore.intermine.ObjectStoreWriterInterMineImpl.store(ObjectStoreWriterInterMineImpl.java:581)
    at org.intermine.dataconversion.ObjectStoreItemWriter.store(ObjectStoreItemWriter.java:102)
    at org.ncgr.intermine.OSUpdater.main(Unknown Source) 

even though my Attribute instance seems perfectly well formed. (There's very little docs on the org.intermine.model.fulldata package, so part of my problem is I'm poring over the source code for those classes, but they're pretty simple.) 

HELP? 


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

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


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

Re: How the heck do I update an intermineobject record from the corresponding object table?

Julie Sullivan-2
https://github.com/intermine/intermine/pull/1526

It looks like you used the "triggerPR" branch. If you commit your
changes to that branch and push to your github repo, Travis will rerun
the tests with your new code.

Try that?

If it still fails, you can click on the `X` and Travis will tell you the
error messages. All I see right now is checkstyle errors. Eclipse fixes
those automatically for me, so I can help with that if you want!


On 04/19/2017 06:25 AM, Joe Carlson wrote:

>
>> On Apr 18, 2017, at 8:00 PM, Paulo Nuin <[hidden email]
>> <mailto:[hidden email]>> wrote:
>>
>> Hi Joe
>>
>>
>>> On Apr 18, 2017, at 7:13 PM, Joe Carlson <[hidden email]
>>> <mailto:[hidden email]>> wrote:
>>>
>>> I submitted a pull request to doing this.
>>>
>>> https://github.com/intermine/intermine/pull/1526
>>>
>>> Now, I clearly do not understand pull requests very well. The 3 files
>>> that you need are antlib-os.xml, BuildTriggerMaker.java and
>>> objectstore.xml. Some other files made it in here by mistake. (How
>>> can I remove them?)
>>
>>
>> Did you
>>
>> >git add .
>> >git commit -m ….
>> ?
>>
>
>
> yeah. Did all that.
>
>
>> You can try just using
>>
>> >git revert HEAD~1 -m 1
>>
>> to revert the commit and remove it from history.
>>
>> >git add <filename> …
>>
>> to add specific file(s)
>>
>> and then commit.
>
> That should help with the extraneous files that got added.
>
> Julie told me that my first version did not pass the checkstyle test. So
> I modified, got it to pass and committed the update. now what? does the
> pull request automatically update to the new file? or do I need to do
> something to update the pull request myself?
>
> Joe
>
>>
>> Cheers
>> Paulo
>>
>>
>>
>>> If you can grab them and put them in your proper directory tree, then
>>> go to your dbmodel directory and type
>>>
>>> ant build-sql-triggers
>>>
>>> connect to the db and
>>>
>>> \i build/model/TriggerMaker.sql
>>>
>>> <do your stuff>
>>>
>>> \i build/model/TriggerRemover.sql
>>>
>>> Look in the code for BuildTriggerMaker.java for more details. And the
>>> warnings.
>>>
>>> In the meantime, make a backup of your mine. And let me know if
>>> things do not work.
>>>
>>> joe
>>>
>>>
>>> On 04/18/2017 05:44 PM, Sam Hokin wrote:
>>>> I think Joe has been through all this, and perhaps I'm trying to
>>>> reinvent his wheel here, but I'm completely mystified as to how to
>>>> "correctly" update the object store when I've got data I WANT in the
>>>> object's table (say organism), but the intermineobject data is hosed
>>>> due to whatever reasons (in this case, I'm hacking a species with
>>>> two varieties/genomes on one taxonId and the organisms got hosed, I
>>>> think, in intermineobject by entrez-organism).
>>>>
>>>> So, for example, here's a GOOD record in the organism table:
>>>>
>>>> chickpeamine=> select * from organism where taxonid =3885;
>>>> -[ RECORD 1 ]--------------------------------
>>>> variety    |
>>>> id         | 4000005
>>>> chadoid    |
>>>> comment    |
>>>> species    | vulgaris
>>>> genus      | Phaseolus
>>>> taxonid    | 3885
>>>> name       | Phaseolus vulgaris
>>>> commonname | string bean
>>>> shortname  | P. vulgaris
>>>> class      | org.intermine.model.bio.Organism
>>>>
>>>> And here's the corresponding BAD record in intermineobject, which is
>>>> what you see on the mine or get from a PathQuery:
>>>>
>>>> chickpeamine=> select * from intermineobject where id=4000005;
>>>> -[ RECORD 1
>>>> ]-----------------------------------------------------------------
>>>> object |
>>>> $_^org.intermine.model.bio.Organism$_^ataxonId$_^3885$_^aid$_^4000005
>>>> id     | 4000005
>>>> class  | org.intermine.model.bio.Organism
>>>>
>>>> That's right, no species, no genus, no name, no commonname, no
>>>> shortname.
>>>>
>>>> So I'd like to write the Most Important Utility You Could Ever Want
>>>> For Intermine, one that simply updates intermineobject records from
>>>> the data for the class of interest, in this case the organism table
>>>> for org.intermine.model.bio.Organism.
>>>>
>>>> I've attached my attempt, but when I try to store an attribute like:
>>>>
>>>> Attribute [item=1112685, name="variety", value="desi"]
>>>>
>>>> it throws the following:
>>>>
>>>> Exception in thread "main"
>>>> org.intermine.objectstore.ObjectStoreException: Object [class
>>>> org.intermine.model.fulldata.Attribute] does not map onto any
>>>> database table.
>>>> at
>>>> org.intermine.objectstore.intermine.ObjectStoreWriterInterMineImpl.storeWithConnection(ObjectStoreWriterInterMineImpl.java:748)
>>>>     at
>>>> org.intermine.objectstore.intermine.ObjectStoreWriterInterMineImpl.store(ObjectStoreWriterInterMineImpl.java:581)
>>>>     at
>>>> org.intermine.dataconversion.ObjectStoreItemWriter.store(ObjectStoreItemWriter.java:102)
>>>>     at org.ncgr.intermine.OSUpdater.main(Unknown Source)
>>>>
>>>> even though my Attribute instance seems perfectly well formed.
>>>> (There's very little docs on the org.intermine.model.fulldata
>>>> package, so part of my problem is I'm poring over the source code
>>>> for those classes, but they're pretty simple.)
>>>>
>>>> HELP?
>>>>
>>>>
>>>> _______________________________________________
>>>> dev mailing list
>>>> [hidden email]
>>>> https://lists.intermine.org/mailman/listinfo/dev
>>>
>>> _______________________________________________
>>> dev mailing list
>>> [hidden email] <mailto:[hidden email]>
>>> https://lists.intermine.org/mailman/listinfo/dev
>
>
>
> _______________________________________________
> dev mailing list
> [hidden email]
> https://lists.intermine.org/mailman/listinfo/dev
>
_______________________________________________
dev mailing list
[hidden email]
https://lists.intermine.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How the heck do I update an intermineobject record from the corresponding object table?

Justin Clark-Casey-2
In reply to this post by joe carlson
I would prefer not to fix pull requests through reverts and deletes since this leaves the mistakes and the fix unnecessarily in the commit history, and makes it
harder to assess the PR.

It is possible to fix things in your local history with 'git amend' and 'git rebase' before 'git push --force' -ing the branch.  But honestly, I would say that
unless you want to learn more about git immediately, it would be easier to capture the changes from the existing branch with "git diff", "git format-patch" or
manually and then reapplying those to a fresh branch before creating a new PR.

On 19/04/17 06:25, Joe Carlson wrote:

>
>> On Apr 18, 2017, at 8:00 PM, Paulo Nuin <[hidden email] <mailto:[hidden email]>> wrote:
>>
>> Hi Joe
>>
>>
>>> On Apr 18, 2017, at 7:13 PM, Joe Carlson <[hidden email] <mailto:[hidden email]>> wrote:
>>>
>>> I submitted a pull request to doing this.
>>>
>>> https://github.com/intermine/intermine/pull/1526
>>>
>>> Now, I clearly do not understand pull requests very well. The 3 files that you need are antlib-os.xml, BuildTriggerMaker.java and objectstore.xml. Some other
>>> files made it in here by mistake. (How can I remove them?)
>>
>>
>> Did you
>>
>> >git add .
>> >git commit -m ….
>> ?
>>
>
>
> yeah. Did all that.
>
>
>> You can try just using
>>
>> >git revert HEAD~1 -m 1
>>
>> to revert the commit and remove it from history.
>>
>> >git add <filename> …
>>
>> to add specific file(s)
>>
>> and then commit.
>
> That should help with the extraneous files that got added.
>
> Julie told me that my first version did not pass the checkstyle test. So I modified, got it to pass and committed the update. now what? does the pull request
> automatically update to the new file? or do I need to do something to update the pull request myself?
>
> Joe
>
>>
>> Cheers
>> Paulo
>>
>>
>>
>>> If you can grab them and put them in your proper directory tree, then go to your dbmodel directory and type
>>>
>>> ant build-sql-triggers
>>>
>>> connect to the db and
>>>
>>> \i build/model/TriggerMaker.sql
>>>
>>> <do your stuff>
>>>
>>> \i build/model/TriggerRemover.sql
>>>
>>> Look in the code for BuildTriggerMaker.java for more details. And the warnings.
>>>
>>> In the meantime, make a backup of your mine. And let me know if things do not work.
>>>
>>> joe
>>>
>>>
>>> On 04/18/2017 05:44 PM, Sam Hokin wrote:
>>>> I think Joe has been through all this, and perhaps I'm trying to reinvent his wheel here, but I'm completely mystified as to how to "correctly" update the
>>>> object store when I've got data I WANT in the object's table (say organism), but the intermineobject data is hosed due to whatever reasons (in this case,
>>>> I'm hacking a species with two varieties/genomes on one taxonId and the organisms got hosed, I think, in intermineobject by entrez-organism).
>>>>
>>>> So, for example, here's a GOOD record in the organism table:
>>>>
>>>> chickpeamine=> select * from organism where taxonid =3885;
>>>> -[ RECORD 1 ]--------------------------------
>>>> variety    |
>>>> id         | 4000005
>>>> chadoid    |
>>>> comment    |
>>>> species    | vulgaris
>>>> genus      | Phaseolus
>>>> taxonid    | 3885
>>>> name       | Phaseolus vulgaris
>>>> commonname | string bean
>>>> shortname  | P. vulgaris
>>>> class      | org.intermine.model.bio.Organism
>>>>
>>>> And here's the corresponding BAD record in intermineobject, which is what you see on the mine or get from a PathQuery:
>>>>
>>>> chickpeamine=> select * from intermineobject where id=4000005;
>>>> -[ RECORD 1 ]-----------------------------------------------------------------
>>>> object | $_^org.intermine.model.bio.Organism$_^ataxonId$_^3885$_^aid$_^4000005
>>>> id     | 4000005
>>>> class  | org.intermine.model.bio.Organism
>>>>
>>>> That's right, no species, no genus, no name, no commonname, no shortname.
>>>>
>>>> So I'd like to write the Most Important Utility You Could Ever Want For Intermine, one that simply updates intermineobject records from the data for the
>>>> class of interest, in this case the organism table for org.intermine.model.bio.Organism.
>>>>
>>>> I've attached my attempt, but when I try to store an attribute like:
>>>>
>>>> Attribute [item=1112685, name="variety", value="desi"]
>>>>
>>>> it throws the following:
>>>>
>>>> Exception in thread "main" org.intermine.objectstore.ObjectStoreException: Object [class org.intermine.model.fulldata.Attribute] does not map onto any
>>>> database table.
>>>> at org.intermine.objectstore.intermine.ObjectStoreWriterInterMineImpl.storeWithConnection(ObjectStoreWriterInterMineImpl.java:748)
>>>>     at org.intermine.objectstore.intermine.ObjectStoreWriterInterMineImpl.store(ObjectStoreWriterInterMineImpl.java:581)
>>>>     at org.intermine.dataconversion.ObjectStoreItemWriter.store(ObjectStoreItemWriter.java:102)
>>>>     at org.ncgr.intermine.OSUpdater.main(Unknown Source)
>>>>
>>>> even though my Attribute instance seems perfectly well formed. (There's very little docs on the org.intermine.model.fulldata package, so part of my problem
>>>> is I'm poring over the source code for those classes, but they're pretty simple.)
>>>>
>>>> HELP?
>>>>
>>>>
>>>> _______________________________________________
>>>> dev mailing list
>>>> [hidden email]
>>>> https://lists.intermine.org/mailman/listinfo/dev
>>>
>>> _______________________________________________
>>> dev mailing list
>>> [hidden email] <mailto:[hidden email]>
>>> https://lists.intermine.org/mailman/listinfo/dev
>
>
>
> _______________________________________________
> dev mailing list
> [hidden email]
> https://lists.intermine.org/mailman/listinfo/dev
>
_______________________________________________
dev mailing list
[hidden email]
https://lists.intermine.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How the heck do I update an intermineobject record from the corresponding object table?

Justin Clark-Casey-2
Sorry, I meant 'git commit --amend'

On 19/04/17 11:33, Justin Clark-Casey wrote:

> I would prefer not to fix pull requests through reverts and deletes since this leaves the mistakes and the fix unnecessarily in the commit history, and makes it
> harder to assess the PR.
>
> It is possible to fix things in your local history with 'git amend' and 'git rebase' before 'git push --force' -ing the branch.  But honestly, I would say that
> unless you want to learn more about git immediately, it would be easier to capture the changes from the existing branch with "git diff", "git format-patch" or
> manually and then reapplying those to a fresh branch before creating a new PR.
>
> On 19/04/17 06:25, Joe Carlson wrote:
>>
>>> On Apr 18, 2017, at 8:00 PM, Paulo Nuin <[hidden email] <mailto:[hidden email]>> wrote:
>>>
>>> Hi Joe
>>>
>>>
>>>> On Apr 18, 2017, at 7:13 PM, Joe Carlson <[hidden email] <mailto:[hidden email]>> wrote:
>>>>
>>>> I submitted a pull request to doing this.
>>>>
>>>> https://github.com/intermine/intermine/pull/1526
>>>>
>>>> Now, I clearly do not understand pull requests very well. The 3 files that you need are antlib-os.xml, BuildTriggerMaker.java and objectstore.xml. Some other
>>>> files made it in here by mistake. (How can I remove them?)
>>>
>>>
>>> Did you
>>>
>>> >git add .
>>> >git commit -m ….
>>> ?
>>>
>>
>>
>> yeah. Did all that.
>>
>>
>>> You can try just using
>>>
>>> >git revert HEAD~1 -m 1
>>>
>>> to revert the commit and remove it from history.
>>>
>>> >git add <filename> …
>>>
>>> to add specific file(s)
>>>
>>> and then commit.
>>
>> That should help with the extraneous files that got added.
>>
>> Julie told me that my first version did not pass the checkstyle test. So I modified, got it to pass and committed the update. now what? does the pull request
>> automatically update to the new file? or do I need to do something to update the pull request myself?
>>
>> Joe
>>
>>>
>>> Cheers
>>> Paulo
>>>
>>>
>>>
>>>> If you can grab them and put them in your proper directory tree, then go to your dbmodel directory and type
>>>>
>>>> ant build-sql-triggers
>>>>
>>>> connect to the db and
>>>>
>>>> \i build/model/TriggerMaker.sql
>>>>
>>>> <do your stuff>
>>>>
>>>> \i build/model/TriggerRemover.sql
>>>>
>>>> Look in the code for BuildTriggerMaker.java for more details. And the warnings.
>>>>
>>>> In the meantime, make a backup of your mine. And let me know if things do not work.
>>>>
>>>> joe
>>>>
>>>>
>>>> On 04/18/2017 05:44 PM, Sam Hokin wrote:
>>>>> I think Joe has been through all this, and perhaps I'm trying to reinvent his wheel here, but I'm completely mystified as to how to "correctly" update the
>>>>> object store when I've got data I WANT in the object's table (say organism), but the intermineobject data is hosed due to whatever reasons (in this case,
>>>>> I'm hacking a species with two varieties/genomes on one taxonId and the organisms got hosed, I think, in intermineobject by entrez-organism).
>>>>>
>>>>> So, for example, here's a GOOD record in the organism table:
>>>>>
>>>>> chickpeamine=> select * from organism where taxonid =3885;
>>>>> -[ RECORD 1 ]--------------------------------
>>>>> variety    |
>>>>> id         | 4000005
>>>>> chadoid    |
>>>>> comment    |
>>>>> species    | vulgaris
>>>>> genus      | Phaseolus
>>>>> taxonid    | 3885
>>>>> name       | Phaseolus vulgaris
>>>>> commonname | string bean
>>>>> shortname  | P. vulgaris
>>>>> class      | org.intermine.model.bio.Organism
>>>>>
>>>>> And here's the corresponding BAD record in intermineobject, which is what you see on the mine or get from a PathQuery:
>>>>>
>>>>> chickpeamine=> select * from intermineobject where id=4000005;
>>>>> -[ RECORD 1 ]-----------------------------------------------------------------
>>>>> object | $_^org.intermine.model.bio.Organism$_^ataxonId$_^3885$_^aid$_^4000005
>>>>> id     | 4000005
>>>>> class  | org.intermine.model.bio.Organism
>>>>>
>>>>> That's right, no species, no genus, no name, no commonname, no shortname.
>>>>>
>>>>> So I'd like to write the Most Important Utility You Could Ever Want For Intermine, one that simply updates intermineobject records from the data for the
>>>>> class of interest, in this case the organism table for org.intermine.model.bio.Organism.
>>>>>
>>>>> I've attached my attempt, but when I try to store an attribute like:
>>>>>
>>>>> Attribute [item=1112685, name="variety", value="desi"]
>>>>>
>>>>> it throws the following:
>>>>>
>>>>> Exception in thread "main" org.intermine.objectstore.ObjectStoreException: Object [class org.intermine.model.fulldata.Attribute] does not map onto any
>>>>> database table.
>>>>> at org.intermine.objectstore.intermine.ObjectStoreWriterInterMineImpl.storeWithConnection(ObjectStoreWriterInterMineImpl.java:748)
>>>>>     at org.intermine.objectstore.intermine.ObjectStoreWriterInterMineImpl.store(ObjectStoreWriterInterMineImpl.java:581)
>>>>>     at org.intermine.dataconversion.ObjectStoreItemWriter.store(ObjectStoreItemWriter.java:102)
>>>>>     at org.ncgr.intermine.OSUpdater.main(Unknown Source)
>>>>>
>>>>> even though my Attribute instance seems perfectly well formed. (There's very little docs on the org.intermine.model.fulldata package, so part of my problem
>>>>> is I'm poring over the source code for those classes, but they're pretty simple.)
>>>>>
>>>>> HELP?
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> dev mailing list
>>>>> [hidden email]
>>>>> https://lists.intermine.org/mailman/listinfo/dev
>>>>
>>>> _______________________________________________
>>>> dev mailing list
>>>> [hidden email] <mailto:[hidden email]>
>>>> https://lists.intermine.org/mailman/listinfo/dev
>>
>>
>>
>> _______________________________________________
>> dev mailing list
>> [hidden email]
>> https://lists.intermine.org/mailman/listinfo/dev
>>
> _______________________________________________
> dev mailing list
> [hidden email]
> https://lists.intermine.org/mailman/listinfo/dev
_______________________________________________
dev mailing list
[hidden email]
https://lists.intermine.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How the heck do I update an intermineobject record from the corresponding object table?

Paulo Nuin
I agree with you, usually it’s the best option, but for an one-off thing —force amend might work fine.



> On Apr 19, 2017, at 4:38 AM, Justin Clark-Casey <[hidden email]> wrote:
>
> Sorry, I meant 'git commit --amend'
>
> On 19/04/17 11:33, Justin Clark-Casey wrote:
>> I would prefer not to fix pull requests through reverts and deletes since this leaves the mistakes and the fix unnecessarily in the commit history, and makes it
>> harder to assess the PR.
>>
>> It is possible to fix things in your local history with 'git amend' and 'git rebase' before 'git push --force' -ing the branch.  But honestly, I would say that
>> unless you want to learn more about git immediately, it would be easier to capture the changes from the existing branch with "git diff", "git format-patch" or
>> manually and then reapplying those to a fresh branch before creating a new PR.
>>
>> On 19/04/17 06:25, Joe Carlson wrote:
>>>
>>>> On Apr 18, 2017, at 8:00 PM, Paulo Nuin <[hidden email] <mailto:[hidden email]>> wrote:
>>>>
>>>> Hi Joe
>>>>
>>>>
>>>>> On Apr 18, 2017, at 7:13 PM, Joe Carlson <[hidden email] <mailto:[hidden email]>> wrote:
>>>>>
>>>>> I submitted a pull request to doing this.
>>>>>
>>>>> https://github.com/intermine/intermine/pull/1526
>>>>>
>>>>> Now, I clearly do not understand pull requests very well. The 3 files that you need are antlib-os.xml, BuildTriggerMaker.java and objectstore.xml. Some other
>>>>> files made it in here by mistake. (How can I remove them?)
>>>>
>>>>
>>>> Did you
>>>>
>>>> >git add .
>>>> >git commit -m ….
>>>> ?
>>>>
>>>
>>>
>>> yeah. Did all that.
>>>
>>>
>>>> You can try just using
>>>>
>>>> >git revert HEAD~1 -m 1
>>>>
>>>> to revert the commit and remove it from history.
>>>>
>>>> >git add <filename> …
>>>>
>>>> to add specific file(s)
>>>>
>>>> and then commit.
>>>
>>> That should help with the extraneous files that got added.
>>>
>>> Julie told me that my first version did not pass the checkstyle test. So I modified, got it to pass and committed the update. now what? does the pull request
>>> automatically update to the new file? or do I need to do something to update the pull request myself?
>>>
>>> Joe
>>>
>>>>
>>>> Cheers
>>>> Paulo
>>>>
>>>>
>>>>
>>>>> If you can grab them and put them in your proper directory tree, then go to your dbmodel directory and type
>>>>>
>>>>> ant build-sql-triggers
>>>>>
>>>>> connect to the db and
>>>>>
>>>>> \i build/model/TriggerMaker.sql
>>>>>
>>>>> <do your stuff>
>>>>>
>>>>> \i build/model/TriggerRemover.sql
>>>>>
>>>>> Look in the code for BuildTriggerMaker.java for more details. And the warnings.
>>>>>
>>>>> In the meantime, make a backup of your mine. And let me know if things do not work.
>>>>>
>>>>> joe
>>>>>
>>>>>
>>>>> On 04/18/2017 05:44 PM, Sam Hokin wrote:
>>>>>> I think Joe has been through all this, and perhaps I'm trying to reinvent his wheel here, but I'm completely mystified as to how to "correctly" update the
>>>>>> object store when I've got data I WANT in the object's table (say organism), but the intermineobject data is hosed due to whatever reasons (in this case,
>>>>>> I'm hacking a species with two varieties/genomes on one taxonId and the organisms got hosed, I think, in intermineobject by entrez-organism).
>>>>>>
>>>>>> So, for example, here's a GOOD record in the organism table:
>>>>>>
>>>>>> chickpeamine=> select * from organism where taxonid =3885;
>>>>>> -[ RECORD 1 ]--------------------------------
>>>>>> variety    |
>>>>>> id         | 4000005
>>>>>> chadoid    |
>>>>>> comment    |
>>>>>> species    | vulgaris
>>>>>> genus      | Phaseolus
>>>>>> taxonid    | 3885
>>>>>> name       | Phaseolus vulgaris
>>>>>> commonname | string bean
>>>>>> shortname  | P. vulgaris
>>>>>> class      | org.intermine.model.bio.Organism
>>>>>>
>>>>>> And here's the corresponding BAD record in intermineobject, which is what you see on the mine or get from a PathQuery:
>>>>>>
>>>>>> chickpeamine=> select * from intermineobject where id=4000005;
>>>>>> -[ RECORD 1 ]-----------------------------------------------------------------
>>>>>> object | $_^org.intermine.model.bio.Organism$_^ataxonId$_^3885$_^aid$_^4000005
>>>>>> id     | 4000005
>>>>>> class  | org.intermine.model.bio.Organism
>>>>>>
>>>>>> That's right, no species, no genus, no name, no commonname, no shortname.
>>>>>>
>>>>>> So I'd like to write the Most Important Utility You Could Ever Want For Intermine, one that simply updates intermineobject records from the data for the
>>>>>> class of interest, in this case the organism table for org.intermine.model.bio.Organism.
>>>>>>
>>>>>> I've attached my attempt, but when I try to store an attribute like:
>>>>>>
>>>>>> Attribute [item=1112685, name="variety", value="desi"]
>>>>>>
>>>>>> it throws the following:
>>>>>>
>>>>>> Exception in thread "main" org.intermine.objectstore.ObjectStoreException: Object [class org.intermine.model.fulldata.Attribute] does not map onto any
>>>>>> database table.
>>>>>> at org.intermine.objectstore.intermine.ObjectStoreWriterInterMineImpl.storeWithConnection(ObjectStoreWriterInterMineImpl.java:748)
>>>>>>    at org.intermine.objectstore.intermine.ObjectStoreWriterInterMineImpl.store(ObjectStoreWriterInterMineImpl.java:581)
>>>>>>    at org.intermine.dataconversion.ObjectStoreItemWriter.store(ObjectStoreItemWriter.java:102)
>>>>>>    at org.ncgr.intermine.OSUpdater.main(Unknown Source)
>>>>>>
>>>>>> even though my Attribute instance seems perfectly well formed. (There's very little docs on the org.intermine.model.fulldata package, so part of my problem
>>>>>> is I'm poring over the source code for those classes, but they're pretty simple.)
>>>>>>
>>>>>> HELP?
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> dev mailing list
>>>>>> [hidden email]
>>>>>> https://lists.intermine.org/mailman/listinfo/dev
>>>>>
>>>>> _______________________________________________
>>>>> dev mailing list
>>>>> [hidden email] <mailto:[hidden email]>
>>>>> https://lists.intermine.org/mailman/listinfo/dev
>>>
>>>
>>>
>>> _______________________________________________
>>> dev mailing list
>>> [hidden email]
>>> https://lists.intermine.org/mailman/listinfo/dev
>>>
>> _______________________________________________
>> dev mailing list
>> [hidden email]
>> https://lists.intermine.org/mailman/listinfo/dev
> _______________________________________________
> dev mailing list
> [hidden email]
> https://lists.intermine.org/mailman/listinfo/dev

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

Re: How the heck do I update an intermineobject record from the corresponding object table?

Sam Hokin-3
In reply to this post by joe carlson
Worked like a charm, Joe! Magic! Although, I'm wondering, given your warning...

NOTICE:
Triggers and stored procedures are being used to propagate your operations. Be sure to backup your database prior to any operations
and to remove all triggers and stored procedures prior to standard InterMine processing. Using triggers with InterMine is not
supported. Use at your own risk!

...can I still use this code for use in on-line control of aircraft, air traffic, aircraft or navigation or aircraft communications;
or in the design, construction, operation or maintenance of any nuclear facility?

THANKS!

On 04/18/2017 07:13 PM, Joe Carlson wrote:
> I submitted a pull request to doing this.
>
> https://github.com/intermine/intermine/pull/1526
_______________________________________________
dev mailing list
[hidden email]
https://lists.intermine.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How the heck do I update an intermineobject record from the corresponding object table?

Justin Clark-Casey-2
Great to know, Sam.  I like the warnings - I think it's a good way to get experimental stuff into the codebase so that it can be further refined as necessary.

Joe, you'll be okay to discuss the code in Github? (I'll be reviewing).  Are you happy to clean it up in a new PR? (in which case I'll start code-specific
discussion on there).

--
Justin Clark-Casey, Synbiomine/InterMine Developer
http://synbiomine.org
http://twitter.com/justincc

On 19/04/17 17:28, Sam Hokin wrote:

> Worked like a charm, Joe! Magic! Although, I'm wondering, given your warning...
>
> NOTICE:
> Triggers and stored procedures are being used to propagate your operations. Be sure to backup your database prior to any operations and to remove all triggers
> and stored procedures prior to standard InterMine processing. Using triggers with InterMine is not supported. Use at your own risk!
>
> ...can I still use this code for use in on-line control of aircraft, air traffic, aircraft or navigation or aircraft communications; or in the design,
> construction, operation or maintenance of any nuclear facility?
>
> THANKS!
>
> On 04/18/2017 07:13 PM, Joe Carlson wrote:
>> I submitted a pull request to doing this.
>>
>> https://github.com/intermine/intermine/pull/1526
> _______________________________________________
> dev mailing list
> [hidden email]
> https://lists.intermine.org/mailman/listinfo/dev
_______________________________________________
dev mailing list
[hidden email]
https://lists.intermine.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How the heck do I update an intermineobject record from the corresponding object table?

joe carlson
In reply to this post by Sam Hokin-3
I’m happy to hear that it worked.

I also do not recommend it for any application for life safety, life support, life sustaining, surgical or human implantation.

Joe

> On Apr 19, 2017, at 9:28 AM, Sam Hokin <[hidden email]> wrote:
>
> Worked like a charm, Joe! Magic! Although, I'm wondering, given your warning...
>
> NOTICE:
> Triggers and stored procedures are being used to propagate your operations. Be sure to backup your database prior to any operations and to remove all triggers and stored procedures prior to standard InterMine processing. Using triggers with InterMine is not supported. Use at your own risk!
>
> ...can I still use this code for use in on-line control of aircraft, air traffic, aircraft or navigation or aircraft communications; or in the design, construction, operation or maintenance of any nuclear facility?
>
> THANKS!
>
> On 04/18/2017 07:13 PM, Joe Carlson wrote:
>> I submitted a pull request to doing this.
>>
>> https://github.com/intermine/intermine/pull/1526

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

Re: How the heck do I update an intermineobject record from the corresponding object table?

joe carlson
In reply to this post by Justin Clark-Casey-2
Hi Justin,

I’m just finishing up some other work and will get to it this (my) morning.

Joe

> On Apr 19, 2017, at 9:34 AM, Justin Clark-Casey <[hidden email]> wrote:
>
> Great to know, Sam.  I like the warnings - I think it's a good way to get experimental stuff into the codebase so that it can be further refined as necessary.
>
> Joe, you'll be okay to discuss the code in Github? (I'll be reviewing).  Are you happy to clean it up in a new PR? (in which case I'll start code-specific discussion on there).
>
> --
> Justin Clark-Casey, Synbiomine/InterMine Developer
> http://synbiomine.org
> http://twitter.com/justincc
>
> On 19/04/17 17:28, Sam Hokin wrote:
>> Worked like a charm, Joe! Magic! Although, I'm wondering, given your warning...
>>
>> NOTICE:
>> Triggers and stored procedures are being used to propagate your operations. Be sure to backup your database prior to any operations and to remove all triggers
>> and stored procedures prior to standard InterMine processing. Using triggers with InterMine is not supported. Use at your own risk!
>>
>> ...can I still use this code for use in on-line control of aircraft, air traffic, aircraft or navigation or aircraft communications; or in the design,
>> construction, operation or maintenance of any nuclear facility?
>>
>> THANKS!
>>
>> On 04/18/2017 07:13 PM, Joe Carlson wrote:
>>> I submitted a pull request to doing this.
>>>
>>> https://github.com/intermine/intermine/pull/1526
>> _______________________________________________
>> dev mailing list
>> [hidden email]
>> https://lists.intermine.org/mailman/listinfo/dev
> _______________________________________________
> dev mailing list
> [hidden email]
> https://lists.intermine.org/mailman/listinfo/dev

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