docs: private void updateRelations(CmsObject cms, CmsResource importResource, List<RelationData> relations)
      throws CmsException {
  
          Map<String, CmsRelationType> relTypes = new HashMap<>();
          for (CmsRelationType relType : OpenCms.getResourceManager().getRelationTypes()) {
              relTypes.put(relType.getName(), relType);
          }
          Set<CmsRelation> existingRelations = Sets.newHashSet(
              cms.readRelations(CmsRelationFilter.relationsFromStructureId(importResource.getStructureId())));
          List<CmsRelation> noContentRelations = existingRelations.stream().filter(
              rel -> !rel.getType().isDefinedInContent()).collect(Collectors.toList());
          Set<CmsRelation> newRelations = new HashSet<>();
          for (RelationData rel : relations) {
              if (!rel.getType().isDefinedInContent()) {
                  newRelations.add(
                      new CmsRelation(
                          importResource.getStructureId(),
                          importResource.getRootPath(),
                          rel.getTargetId(),
                          rel.getTarget(),
                          rel.getType()));
              }
          }
          if (!newRelations.equals(noContentRelations)) {
  
              CmsRelationFilter relFilter = CmsRelationFilter.TARGETS.filterNotDefinedInContent();
  
              cms.deleteRelationsFromResource(importResource, relFilter);
              for (CmsRelation newRel : newRelations) {
                  cms.addRelationToResource(
                      importResource,
                      cms.readResource(newRel.getTargetId(), CmsResourceFilter.IGNORE_EXPIRATION),
                      newRel.getType().getName());
  
              }
          }
      }