Question: why did the sword of gryffindor appear to neville?
Answer: This sword was enchanted by Godric to appear whenever a member of his house asks for help while wearing the Hat. Twice, in the course of the Harry Potter series, the sword is transported from a temporary owner to aid a Gryffindor who needs a weapon.