class GraphRemoveNodePropertiesProc extends CatalogProc {

    @NotNull
    private Long removeNodeProperties(GraphStore graphStore, GraphRemoveNodePropertiesConfig config) {
        Collection<NodeLabel> validNodeLabels = config.validNodeLabels(graphStore);

        long sum = validNodeLabels.stream()
            .mapToLong(nodeLabel ->
                config.nodeProperties().stream()
                    .mapToLong(property -> graphStore.nodePropertyValues(nodeLabel, property).size())
                    .sum())
            .sum();

        validNodeLabels.forEach(label ->
            config.nodeProperties().forEach(property ->
                graphStore.removeNodeProperty(label, property))
        );

        return sum;
    }

}