Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#2149 closed enhancement (fixed)

Batch item importers should be able to use an annotation for item identification

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: major Milestone: BASE 3.15
Component: coreplugins Version:
Keywords: Cc:

Description

The batch item importers can currently use name, internal id or external id for identifying items. It would be nice if it was possible to use an annotation for this purpose. Typically, the annotation values should be unique among all items, otherwise the usual error handling routines should apply (as when the name or external id is used).

This ticket applies to all regular batch item importers (=subclasses of the AbstractItemImporter class) as well as the annotation importer.

Attachments (1)

id-method-annotationtypes.png (7.7 KB ) - added by Nicklas Nordborg 6 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 by Nicklas Nordborg, 6 years ago

Owner: changed from everyone to Nicklas Nordborg
Status: newaccepted

comment:2 by Nicklas Nordborg, 6 years ago

In 7588:

References #2149: Batch item importers should be able to use an annotation for item identification

Added the AnnotationIdMethod implementation that makes it possible to specify an annotation type to use for item identification. It has been implemented in the biosource and sample importers so far.

While it seems to work as expected the numer of possible annotation types that can be used probably need to be limited in some way. The plug-ins will currently list all annotation types that have STRING, INT or LONG values that are not enumerations. Maybe we should add a flag option to the annotation type?

comment:3 by Nicklas Nordborg, 6 years ago

In 7589:

References #2149: Batch item importers should be able to use an annotation for item identification

Implemented support in all other batch item importers.

comment:4 by Nicklas Nordborg, 6 years ago

In 7590:

References #2149: Batch item importers should be able to use an annotation for item identification

Implemented a way to set the identifier when creating new items. This used to work automatically before since it was handled by the column mappers for each of the identification methods. This did not work when using annotations since there are no column mappers for annotation types.

IdMethod.setIdentifierOnNewItem() method was added and implemented by the AnnotationIdMethod to make sure that the specified annotation is set on new items.

comment:5 by Nicklas Nordborg, 6 years ago

In 7591:

References #2149: Batch item importers should be able to use an annotation for item identification

The annotation importer plug-in has been updated with support for using annotations to identify items. An extra complication was that it was not using the IdMethod implementations for finding items. This has been changed which may not be fully backwards compatible if the plug-in is used programmatically.

comment:6 by Nicklas Nordborg, 6 years ago

In 7592:

References #2149: Batch item importers should be able to use an annotation for item identification

Need to set the idMethod and includeMine parameters in the test code.

by Nicklas Nordborg, 6 years ago

comment:7 by Nicklas Nordborg, 6 years ago

Just tested this on a cloned production server. Clearly we need a way to limit which annotation types that are included in the "Identification method" selection list. Most annotation types are not identifiers!

comment:8 by Nicklas Nordborg, 6 years ago

In 7615:

References #2149: Batch item importers should be able to use an annotation for item identification

Added AnnotationTypeData.isIdentifier() so that we can flag annotation types that are intended to be used as indentifiers.

comment:9 by Nicklas Nordborg, 6 years ago

In 7616:

References #2149: Batch item importers should be able to use an annotation for item identification

Added "Is identifier" to the annotation type edit, view and list pages.

comment:10 by Nicklas Nordborg, 6 years ago

In 7617:

References #2149: Batch item importers should be able to use an annotation for item identification

The batch importers now only select annotation types with the 'identifier' flag set.

comment:11 by Nicklas Nordborg, 6 years ago

In 7618:

References #2149: Batch item importers should be able to use an annotation for item identification

Added column mapping for the "Is identifier" flag to the annotation type importer.

comment:12 by Nicklas Nordborg, 6 years ago

In 7620:

References #2149 and #2150. Updated documentation.

comment:13 by Nicklas Nordborg, 6 years ago

Resolution: fixed
Status: acceptedclosed

comment:14 by Nicklas Nordborg, 6 years ago

In 7684:

References #2149: Batch item importers should be able to use an annotation for item identification

If there are no "include" options, do not call the setIncludes() method on the query since that will cause it to never find any items. It's better to leave it at the default (=Mine+InProject).

Note: See TracTickets for help on using tickets.