Karen K. Johnson, the convicted cocaine dealer sentenced to a jail term that prosecutors hoped would force her to give evidence against Mayor Marion Barry, is expected to be released from her contempt of court sentence later this week, sources familiar with the case said.

Johnson, a former city employe, was sent to the D.C. Jail last August when she refused to answer questions about her drug dealings before a federal grand jury probing drug use by city employes and others.

A federal judge held her in contempt and ordered her confined to the jail for the duration of the grand jury's deliberations unless she answered the grand jury's questions. The panel's term ends on Thursday and, sources said, prosecutors are not likely to call Johnson back for further questioning.

If Johnson is released from her contempt sentence later this week, she will then resume serving the four-month prison sentence she received after she was convicted of cocaine sale and possession charges. She had only served two days of that sentence at a minimum-security federal corrections center in Southeast Washington before she was held in contempt and transferred to the jail.

Federal prosecutors considered Johnson's cooperation crucial to their effort to determine whether Barry committed perjury in January 1984 when he appeared before the grand jury and denied ever having obtained cocaine from Johnson.