Gluing fabric or ribbon to walnut shells
If the ribbon is polyester or nylon, it will be hard to make a strong bond to it.  Most adhesives will stick a ribbon to something if it's only decorative and won't really get pulled.  You need something more secure if the ribbon is going to serve as a hinge or closure.
If you can use a ribbon made from cotton, lots of glues will make a strong bond.  Even regular PVA glue (e.g., Elmers), should work well.
If you prefer to stick with a polyester or nylon ribbon, at least you won't need a &quot;structural&quot; adhesive (something that makes a bond as strong as the material, itself); a locket won't get &quot;abusive&quot; handling.  So an adhesive like E6000 would probably be strong enough for that purpose.
Another approach would be to create a hinge with a strip of cotton fabric that can be bonded well to the walnut.  The walnut is a curved surface, so a wide hinge won't work (everything but the widest part of the shell will move apart when you open it).  You would need to create something with an &quot;H&quot; shape (turned sideways).  The connector in the middle would be the hinge, located at the widest point of the shell.  The long legs would each go on one half of the shell to provide a longer gluing surface.  Embed the polyester or nylon ribbon tie under the hinge part in the middle so the hinge holds the ribbon in place.  A little glue on the ribbon will provide enough friction so it won't easily pull out.