To Term I often need to create taxonomy terms, checking if they exist first. This is a small function that handles that. Tags taxonomy term
Drupal 8: Get bundles and reference fields referencing a specific bundle Get all field mappings of a taxonomy term. Cycle through the fields, and select only the fields having references to a specific bundle. Tags field reference taxonomy field mapping snippet Drupal8 API