<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cleanup_properties(rdf):
 """Remove unnecessary property definitions. Reemoves SKOS and DC property definitions and definitions of unused properties."""

    for t in (RDF.Property, OWL.DatatypeProperty, OWL.ObjectProperty,
              OWL.SymmetricProperty, OWL.TransitiveProperty,
              OWL.InverseFunctionalProperty, OWL.FunctionalProperty):
        for prop in rdf.subjects(RDF.type, t):
            if prop.startswith(SKOS):
                logging.debug(
                    "removing SKOS property definition: %s", prop)
                replace_subject(rdf, prop, None)
                continue
            if prop.startswith(DC):
                logging.debug("removing DC property definition: %s", prop)
                replace_subject(rdf, prop, None)
                continue

            # if there are triples using the property, keep the property def
            if len(list(rdf.subject_objects(prop))) > 0:
                continue

            logging.debug("removing unused property definition: %s", prop)
            replace_subject(rdf, prop, None)