Answer:
I believe is a metaphor because the apples always have a worm in them: thus the whole bookworm idea...
Actually, it is a symbol for education. In the old days, children brought their teachers apples. A book is more obvious as a symbol for education.