In the field of musicology, the automatic style classification of compositions such as piano sonatas presents significant challenges because of their intricate structural and temporal characteristics. Traditional approaches often fail to capture the nuanced relationships inherent in musical works. This paper addresses the limitations of traditional neural networks in piano sonata style classification and feature extraction by proposing a novel integration of graph convolutional neural networks (GCNs), graph attention networks (GATs), and Long Short-Term Memory (LSTM) networks to conduct the automatic multi-label classification of piano sonatas. Specifically, the method combines the graph convolution operations of GCNs, the attention mechanism of GATs, and the gating mechanism of LSTMs to perform the graph structure representation, feature extraction, allocation weighting, and coding of time-dependent features of music data layer by layer. The aim is to optimize the representation of the structural and temporal features of musical elements, as well as the dependence between discovery features, so as to improve classification performance. In addition, we utilize MIDI files of several piano sonatas to construct a dataset, spanning the 17th to the 19th centuries (i.e., the late Baroque, Classical, and Romantic periods). The experimental results demonstrate that the proposed method effectively improves the accuracy of style classification by 15% over baseline schemes.