<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def transform_deprecated_concepts(rdf, cs):
 """Transform deprecated concepts so they are in their own concept scheme."""


    deprecated_concepts = []

    for conc in rdf.subjects(RDF.type, SKOSEXT.DeprecatedConcept):
        rdf.add((conc, RDF.type, SKOS.Concept))
        rdf.add((conc, OWL.deprecated, Literal("true", datatype=XSD.boolean)))
        deprecated_concepts.append(conc)

    if len(deprecated_concepts) > 0:
        ns = cs.replace(localname(cs), '')
        dcs = create_concept_scheme(
            rdf, ns, 'deprecatedconceptscheme')
        logging.debug("creating deprecated concept scheme %s", dcs)
        for conc in deprecated_concepts:
            rdf.add((conc, SKOS.inScheme, dcs))