NaturalHistoryMuseum / scratchpads2

Scratchpads 2.0
http://scratchpads.org
GNU General Public License v2.0
199 stars 83 forks source link

Associating batch uploaded content with a bibliographical reference - which biblio field to use? #2143

Closed informatics-dev closed 11 years ago

informatics-dev commented 13 years ago

Description:

I am about to batch upload a lot of content and would like to associate it with previously uploaded bibliographical information. When I use the auto-complete text field option to associate some content with a bibliographical reference it seems to use primarily the title of the paper or book. Can I use this field in batch uploads as well?

informatics-dev commented 13 years ago

Comment by Irina Brake

No, to my knowledge you can't automatically link uploaded content with your existing bibliography. However, if you want to upload content which is linked (via a unique ID) to bibliographic references that are new to your Scratchpad, then this is possible to do for our developers. I usually add a temporary field into which I import the citation and then go through each node and link it to the correct biblio. You can use the matrix editor for this. When all is done I delete the temporary field.

informatics-dev commented 13 years ago

Comment by Andreas Wallberg

So if I have about 1700 location records with an associated bibliographical reference, I have to link each manually... Ouch.

informatics-dev commented 13 years ago

Comment by Irina Brake

Sorry, I know the feeling. Been there, done it...

informatics-dev commented 13 years ago

Comment by Andreas Wallberg

Sorry to open this one again, but when you say "unique ID", do you mean the "/view/NNNN" number of the link to each bibliographical reference or some other number?

Just to be clear on this, the devs can to it, as long as I provide the correct ID in a column of my tab-separated-file?

informatics-dev commented 13 years ago

Comment by Andreas Wallberg

Hmm, it turns out I have problems associating other content with other node references on batch uploads as well. Can anyone please provide a hint for how to accomplish this?

informatics-dev commented 13 years ago

Comment by Andreas Wallberg

Ok. I managed to figure this one out after a bit of trial-and-error and UTFG:ing.

Association with node references works if:

1) one knows the NID, the number in the "nid:NNNN" statement that pops up when manually linking to a node reference or which is present in the "/view/NNNN" html-link. I have not found a way to access lists of these numbers through the site itself but am able to scrape them with a bit of Perl.

2) Having selected the "Node reference" field type in the content manager, you have to go for "Select list" as the widget type.

3) In the CSV-file use the NNNN number in the data column, without any extra "nid:" or characters.

It works just fine. The main problem for most users will be how to get the NIDs.

informatics-dev commented 13 years ago

Comment by Irina Brake

Wow, I am impressed, Andreas. Did you really manage to import data and link them to another content type via the node number? I am not familiar with your (I guess) programming language. With NID I guess you mean the node number that shows in the URL when you edit a node? As I said, you can see these numbers when editing a node or hovering over the 'Edit' link. The only way I know of seeing these numbers more quickly would be to go to the 'List Content' page (/admin/content/node), filter for the content type you need and hover over the 'edit' links. Obviously, if you have a lot of content, this is not a quick solution...

informatics-dev commented 13 years ago

Comment by Andreas Wallberg

Yes it works and those are the NIDs (Node IDs?). I tried linking against both my bibliographical NIDs and location NIDs in the same spreadsheet for a few objects and it works just fine :-)

I have not started any massive uploads yet though since I now have to make a strategic design decision: i) having many different linked content types for different kinds of data, which is the best solution from a conceptual standpoint and I think in the long run, or ii) few but massive content types with fewer links needed and easier to upload data to for my collaborators but messier to manage on-site and worse separation between data of different kinds and more duplication. Export of data as spreadsheets from the site definitely ties in to this design decision as well but is a different issue.

In my case it comes down to linking:

Location (coordinates) <-> Collection sample (some marine sediment that was collected with some method in some habitat) <-> Specimens (worms)

We often find many worms in the same samples and often collect several samples at approximately the same locations. If it too cumbersome to link these three content types, I will have to put the sample information in either the location content type or the specimen content type, or I am sure people with not bother to fill this in correctly, defeating the purpose of the tool...

My way to get the NIDs for my bibliographical references is to present my complete bibliography on one page, save the HTML-source and use a simple Perl script to scan for the href="/biblio/view/NNNN" pattern in the code to generate my own list. I think that I may extend the bibliography with a "NID field" and expose the NIDs explicitly... Super hacky and sub-optimal and something I do not expect anyone else will bother doing.

So I'll open this thread again and turn it into a feature request (hoping it is already possible somehow):

1) The best way to go about to get the NIDs is to have an easy way to expose them as a simple Title<->NID list through some admin function of the site itself, which should be super easy to implement for the devs and make a world of difference for us who manage both online and offline data.

2) In the long run though, it would be great if we could link against the titles instead of the NIDs. Please implement this. I read that this should be possible through the Drupal "Table Wizard", which I am unable to locate in my Scratchpad.

informatics-dev commented 13 years ago

Comment by Simon Rycroft

Andreas! We will be working on the import functions of the site as part of the upgrade to Drupal 7. I'm afraid this can not be fixed before this point (I believe the "Node Import" module that we currently use does not support referencing nodes by title).

informatics-dev commented 13 years ago

Comment by Andreas Wallberg

Thanks for the feedback Simon!

I managed to solve No 1) myself though. It can be easily dealt with by adding the "Node: Nid" as a field in the table while using the Table Style view to expose the NIDs. Absolutely great. Maybe I should just shut up for a while and UTFG.

informatics-dev commented 13 years ago

Comment by Andreas Wallberg

This is a clarification:

My link-on-import method works at the preview-step for my "Sample" content type and links to both locations and bibliographies. The actual import fails.

I have not managed to link a location with a bibliography this way.

informatics-dev commented 12 years ago

Comment by Laurence J Livermore

This feature would require major work and will be reviewed by Simon post-launch of Scratchpads 2.0.

informatics-dev commented 11 years ago

Comment by Simon Rycroft

This feature was added to Scratchpads 2.x. It is possible to link to another node using the node ID (NID), or the node title.