code: def transform_relations(rdf, relationmap):
      
  
      affected_types = (SKOS.Concept, SKOS.Collection,
                        SKOSEXT.DeprecatedConcept)
  
      props = set()
      for t in affected_types:
          for conc in rdf.subjects(RDF.type, t):
              for p, o in rdf.predicate_objects(conc):
                  if isinstance(o, (URIRef, BNode)) \
                     and (p in relationmap or not in_general_ns(p)):
                      props.add(p)
  
      for p in props:
          if mapping_match(p, relationmap):
              newval = mapping_get(p, relationmap)
              logging.debug("transform relation %s -> %s", p, str(newval))
              replace_predicate(
                  rdf, p, newval, subjecttypes=affected_types)
          else:
              logging.info("Don't know what to do with relation %s", p)
docs: Transform YSO-style concept relations into SKOS equivalents.