Ticket #357 (closed defect: fixed)

Opened 2 years ago

Last modified 5 months ago

update Annotations, CommentAnnotations in database

Reported by: jsuttor Assigned to: alex
Priority: medium Milestone:
Component: topaz Version: 0.8
Keywords: annotations Cc:
Blocking: Blocked By:

Description (Last modified by pradeep)

There are two parts to this task:

* Data Migration task to be run post 0.7 release on the production database to convert annotations created by plosone-webapp versions prior to 0.7

* Make sure 0.7 uses the correct annotationType.

Dependency Graph

Change History

05/31/07 18:20:10 changed by pradeep

Ouch! PlosOne? prior to 0.7 has been creating annotations with a non-standard type value for Annotations. It was using "http://www.w3.org/2000/10/annotationType#Annotation". So this is in addition to the base annotation type "http://www.w3.org/2000/10/annotation-ns#Annotation" that the old annotation-ws service inserts by default. So the data-migration task on plosone production really is to replace the wrong type value with the correct one:

(Note: expand <ri> and <rdf:type> before execution)

05/31/07 18:29:36 changed by pradeep

  • status changed from new to assigned.
  • description changed.

05/31/07 19:30:34 changed by pradeep

(In [2839]) Addresses #357. Fix the annotation type used and be compatible with versions prior to 0.7 till the data migration is done.

06/13/07 12:28:07 changed by amit

  • version changed from 0.7 to 0.8.
  • milestone changed from 0.7 to 0.8.

Moving to 0.8

(follow-up: ↓ 13 ) 06/25/07 10:50:50 changed by pradeep

There is another change to be done after the data migration. To complete the changes started in [3006], add an @Entity with rdf:type http://www.w3.org/2000/10/annotationType#Comment and remove the type value set via the Spring config.

07/20/07 10:10:24 changed by amit

  • milestone changed from 0.8 to 0.9.

We are not doing data migrations in this release.

09/02/07 22:41:40 changed by

  • milestone deleted.

Milestone 0.9 deleted

01/07/08 18:03:57 changed by rich

  • milestone set to pubApp_0.9.0.

01/07/08 18:07:56 changed by rich

  • priority changed from critical to medium.

(follow-up: ↓ 11 ) 01/08/08 15:15:25 changed by rich

  • milestone changed from pubApp_0.9.0 to pubApp_0.8.2.1.

(in reply to: ↑ 10 ) 01/17/08 23:14:34 changed by pradeep

  • owner changed from pradeep to rich.
  • status changed from assigned to new.

Replying to rich: The insert and delete statements mentioned above needs to be run to do the migration. Let me know when I or Russ should run those against the production database.

01/28/08 16:08:29 changed by rich

  • owner changed from rich to russ.

(in reply to: ↑ 5 ; follow-up: ↓ 14 ) 02/08/08 15:08:51 changed by russ

  • owner changed from russ to pradeep.

Replying to pradeep:

There is another change to be done after the data migration. To complete the changes started in [3006], add an @Entity with rdf:type http://www.w3.org/2000/10/annotationType#Comment and remove the type value set via the Spring config.

sorry, i'm unclear about this.

i can make the changes in comment:1 anytime.

but do i need to do something else per comment:5 at the same time? if so what, specifically, needs doing?

(in reply to: ↑ 13 ) 02/14/08 17:12:15 changed by pradeep

  • owner changed from pradeep to russ.

Replying to russ:

Replying to pradeep:

There is another change to be done after the data migration. To complete the changes started in [3006], add an @Entity with rdf:type http://www.w3.org/2000/10/annotationType#Comment and remove the type value set via the Spring config.

sorry, i'm unclear about this.

Sorry about that.

i can make the changes in comment:1 anytime.

Great!

but do i need to do something else per comment:5 at the same time? if so what, specifically, needs doing?

Just do comment:1 now. (Try it in a test environment to make sure you have the queries right).

Alex has already done comment:5 for 0.8.2.1 (I thought I saw something to that effect in a checkin). So please confirm with him.

Note that these need not be synchronized. comment:1 changes can be done any time before comment:5. The current production version already understands the changed data. So no worries there.

02/19/08 18:06:53 changed by alex

Hi,

I've been trying to refresh my memory on this. I have added @Entity types for Comment so this is taken care of. There are changes in 0.8.2.1 that will require a data migration. If I understand Pradeep correctly, the type assigned to annotations pre 0.7 was "http://www.w3.org/2000/10/annotationType#Annotation", since 0.7 it has been "http://www.w3.org/2000/10/annotationType#Comment". All of these RDF statements need to be migrated.

Incidentally, the original type was bogus. I think we're safe with just migrating as described above. Each Annotation class extends Annotea, which does have the correct base annotation type "http://www.w3.org/2000/10/annotation-ns#Annotation". I assume that all pre0.7 annotations have this type also (which is good).

If the migration does not happen, we will not see these pre-0.7 annotations in 0.8.2.1

We should be backwards compatible with all other annotations.

02/20/08 11:01:07 changed by russ

  • status changed from new to closed.
  • resolution set to fixed.

from runitql:

set autocommit off;

insert 
select $s <rdf:type> <http://www.w3.org/2000/10/annotationType#Comment> 
from <local:///topazproject#ri> 
where $s <rdf:type> <http://www.w3.org/2000/10/annotationType#Annotation> 
into <local:///topazproject#ri>;

commit;

delete 
select $s <rdf:type> <http://www.w3.org/2000/10/annotationType#Annotation> 
from <local:///topazproject#ri> 
where $s <rdf:type> <http://www.w3.org/2000/10/annotationType#Annotation>
from <local:///topazproject#ri>;

commit;

set autocommit on;

02/20/08 11:10:44 changed by amit

  • status changed from closed to reopened.
  • resolution deleted.

I am not sure all the 'offending' code has been removed or cleaned up.

02/20/08 11:11:20 changed by amit

  • owner changed from russ to pradeep.
  • status changed from reopened to new.

(follow-up: ↓ 20 ) 02/20/08 11:17:06 changed by amit

Pradeep, please don't make any changes to the branch code. Please identify any work that still need to be done to close this. I remember we had created some 'flag' to keep compatibility.

(in reply to: ↑ 19 ) 02/20/08 11:32:14 changed by pradeep

  • owner changed from pradeep to alex.

Replying to amit:

Pradeep, please don't make any changes to the branch code. Please identify any work that still need to be done to close this. I remember we had created some 'flag' to keep compatibility.

No flags. We did a switch to the new(correct) rdf:type in 0.7. But 0.7 also could handle the old(bogus) rdf:type. Now that the old(bogus) rdf:type is gone from data, there is no need for that in code. This is what I think Alex did in 0.8.2.1. Alex could you please confirm, that there is no more mention of the old(bogus) rdf:type in code and close this ticket? Thanks.

02/20/08 12:01:09 changed by russ

if we do still have the old(bogus) type in code, let's move this ticket out of the 0.8.2.1 milestone, as there's no need to fix immediately (unless there's some dependency with #418 that i'm not aware of)

02/22/08 18:28:14 changed by alex

  • status changed from new to closed.
  • resolution set to fixed.

(In [4777]) fixes #357 - removed definition of PLOSONE_0_6_DEFAULT_TYPE. This is no longer used. All annotations should have been migrated to use the new type (as per this ticket).

Also - fixed an issue when unflagging an annotation that was not a Comment (i.e. a Correction). This was causing an NPE.

03/21/08 13:00:06 changed by alex

(In [5104]) Merged revisions 4777 via svnmerge from http://gandalf.topazproject.org/svn/branches/0.8.2.1

........

r4777 | alex | 2008-02-22 18:28:13 -0800 (Fri, 22 Feb 2008) | 3 lines

fixes #357 - removed definition of PLOSONE_0_6_DEFAULT_TYPE. This is no longer used. All annotations should have been migrated to use the new type (as per this ticket).

Also - fixed an issue when unflagging an annotation that was not a Comment (i.e. a Correction). This was causing an NPE.

........

07/16/08 11:01:22 changed by

  • milestone deleted.

Milestone pubApp_0.8.2.1 deleted