Attached is a custom plugin designed to map imported data into a taxonomy that is already defined/managed using the D6 taxonomy module.

Features
1. Ability to search for matches within taxonomy synonyms
2. Ability to also add parent and/or child terms
3. Ability to semi-customize the tag to use for terms not found within the taxonomy

One example use case would be if you were importing tags regarding baseball teams, and you wanted to avoid a scenario where some articles were tagged with "Yankees", some with "NYY", some with "New York Yankees", etc. You could simply define the desired term, add the appropriate synonyms, and any tag matching either the term or synonym would receive the correct tag.

I've done some testing mapping to both taxonomy and content taxonomy fields, and I think it works. Still, if anyone is trying to do something similar, of wants to add some additional features, I would welcome the help in trying it out.

Comments

twistor’s picture

Assigned: Unassigned » twistor
Status: Needs review » Needs work

The api has changed a bit. I'm also not quite sure what this accomplishes. Does filter, tag, or add to a vocabulary? Also, look up cvsdo.

brycesenz’s picture

I will post an updated actual patch soon-ish with a new version that works with the new API.

I apologize if my former post was unclear. My use case was as follows - I had a pre-defined taxonomy that I wanted all of my imported nodes to be tagged with. For simplicity's sake, let's say that it was just tagging items as either "Male" or "Female". However, the field that I was importing from would occasionally use "Men", "Mens", "Guys", "Ladies", etc. Using this plugin, I could set all of those options to synonyms of "Male" or "Female" inside my Drupal Taxonomy, and the plugin would query the raw field against the synonyms and then tag them as "Male" or "Female" appropriately.

It may not be broadly applicable, but I figured I'd post it anyway.

cedarm’s picture

I'm doing almost exactly the same thing in Term Uncle. Would be nice to have term synonym mapping and I would likewise add a Feeds Tamper plugin to Term Uncle for uncle term mapping.

brycesenz’s picture

@cedarm,

I'm obviously happy to help fold this into what might be a more broadly applicable module. What's your ideal end state with regards to both your module and this random plugin?

cedarm’s picture

I have to admit I didn't give it a lot of thought. It feels like most of the logic in this plugin would end up being copied if I were to implement a plugin for Term Uncle. So I guess I'd like to see Term Uncle support added to this plugin which would be available if module_exists('term_uncle'). And then this plugin becoming part of Feeds Tamper.

My issue however is that FT can't currently map one source field to multiple targets, applying a different set of filters to each mapping (see #963026: Allow source to be used for two targets). Because of that I wouldn't be able to use this in the site I developed Term Uncle for. (I ended up implementing my own Feeds hooks.)

twistor’s picture

@brycesenz,
Are you still interested in getting this in? I'm not sure what my confusion was before, it seems pretty strait forward. I haven't looked at Term Uncle yet, so I'm not sure what the overlap would be.

wizonesolutions’s picture

With all the trouble trying to get explode to result in multiple taxonomy tags, this seems like it would be an easier solution if the plugin were updated to the current API. Watching.

brycesenz’s picture

StatusFileSize
new2.37 KB

@twistor -
This plugin is still a lifesaver for me, so by all means include it if you want. I looked into Term Uncle, but concluded that this plugin vs. that module solve for completely different use cases.

Drupal is just a hobby for me, and all familiarity with patching disappeared when we moved to git. I've attached the version of this plugin that works with the API from "Feeds Tamper 6.x-1.0-beta2". Has the API changed since then?

@wizonesolutions -
As above, please let me know if the plugin attached doesn't meet the latest API requirements. Also, if you have tips for simplifying the code, feel free to pass them on and I'll make the changes.

szy’s picture

When choosing your plugin I get a Javascript error
with some PHP errors in it.

Szy.

ndf’s picture

Perfect for this usecase (while importing, replace synonyms with superterms)

Got the error too. This is mostly a Feeds Tamper javascript issue.
The default description is too long. This gives an error. When reloading or changing, Tamper gives the error.

Solution: when adding the plugin give it a short and unique description before clicking on 'add'.

vincent rommelaars’s picture

Category: feature » support

@nielsdefeyter, @brycesenz; I added the plugin to the plugins folder of feeds_tamper-6.x-1.0-beta4.
When I created a list of feeds from the feed module, next I'm going to Tamper plugins and click on "Add plugin" under the desired feed.
Then I choose the plugin to add (which is the tag_taxonomy_filter plugin), but when I had it chosen, the error pops up.

This plugin is really what I'm looking for, so if anyone has a solution for me it would be great!

Currently I'm using:
Drupal 6.26
feeds-6.x-1.0-beta12
feeds_tamper-6.x-1.0-beta4

Hope you can help me with this?

Thanks in advance.

twistor’s picture

Assigned: twistor » Unassigned
Issue summary: View changes
Status: Needs work » Closed (works as designed)

Feeds Tamper really shouldn't be dealing with this.

Some of the mentioned things, Feeds should do itself.