Materials informatics is a method that combines statistics, machine learning techniques, and high-throughput computing to promote materials discovery and design. In this study, we propose a novel framework based on weighted graph for mapping material compositions to properties. The framework utilizes distributed representations of elemental compositions and incorporates soft attention mechanisms to capture the importance of different elements in the materials. By leveraging attention mechanism and residual network, the model can effectively extract features and generate fixed-length representations for materials, enabling efficient information aggregation. Experimental results on diverse datasets from the Material Project database demonstrate the effectiveness of our proposed method, achieving less errors compared to other methods that do not consider the material structure. This data-driven deep learning method showcases the potential of materials informatics in providing accurate predictions for various material properties.