Complex sentence: Sophia became a friend and admirer of Gottfried Leibniz while he was librarian at the Court of Hanover, the friendship lasted from 1676 until her death in 1714.
Split into simpler sentences: Sophia became a friend and admirer of Gottfried Leibniz while he was librarian at the Court of Hanover. Their friendship lasted from 1676 until her death in 1714.