Is any such database available
I do not believe that a graph database like this exists.
Would it be possible to create one from publicly available Ldraw files?
This would be difficult to create. LDraw files do not store connection information. They store part locations in 3D space. Modelling tools frequently support snapping parts together and/or snapping to a grid, but that information is not directly stored in the LDraw model files as far as I know.
Going from an LDraw file to a connection graph seems possible, but it would require modelling precise connection information for each part for each connection family. It would then require a physics engine that could model the parts and perform collision detection for each connection point to determine if a connection exists and what it is connected to.