code: private void checkInteractionModel(final UpdateRequest request)  {
          final List<Quad> deleteQuads = new ArrayList<>();
          final List<Quad> updateQuads = new ArrayList<>();
  
          for (final Update operation : request.getOperations()) {
              if (operation instanceof UpdateModify) {
                  final UpdateModify op = (UpdateModify) operation;
                  deleteQuads.addAll(op.getDeleteQuads());
                  updateQuads.addAll(op.getInsertQuads());
              } else if (operation instanceof UpdateData) {
                  final UpdateData op = (UpdateData) operation;
                  updateQuads.addAll(op.getQuads());
              } else if (operation instanceof UpdateDeleteWhere) {
                  final UpdateDeleteWhere op = (UpdateDeleteWhere) operation;
                  deleteQuads.addAll(op.getQuads());
              }
  
              final Optional<String> resourceInteractionModel = getResourceInteraction();
              if (resourceInteractionModel.isPresent()) {
                  updateQuads.forEach(e -> {
                      // check for interaction model change violation
                      checkInteractionModel(e.asTriple(), resourceInteractionModel);
                  });
              }
  
              deleteQuads.forEach(e -> {
                  final String interactionModel = getInteractionModel.apply(e.asTriple());
                  if (StringUtils.isNotBlank(interactionModel)) {
                      throw new InteractionModelViolationException("Deleting the interaction model "
                              + interactionModel + " is not allowed!");
                  }
              });
          }
      }
docs: /*
  Check the SPARQLUpdate statements for the invalid interaction model changes.
  @param request the UpdateRequest
  @throws InteractionModelViolationException when attempting to change the interaction model