def transform_relations(rdf, relationmap):
affected_types = (SKOS.Concept, SKOS.Collection,<EOL>SKOSEXT.DeprecatedConcept)<EOL>props = set()<EOL>for t in affected_types:<EOL><INDENT>for conc in rdf.subjects(RDF.type, t):<EOL><INDENT>for p, o in rdf.predicate_objects(conc):<EOL><INDENT>if isinstance(o, (URIRef, BNode))and (p in relationmap or not in_general_ns(p)):<EOL><INDENT>props.add(p)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>for p in props:<EOL><INDENT>if mapping_match(p, relationmap):<EOL><INDENT>newval = mapping_get(p, relationmap)<EOL>logging.debug("<STR_LIT>", p, str(newval))<EOL>replace_predicate(<EOL>rdf, p, newval, subjecttypes=affected_types)<EOL><DEDENT>else:<EOL><INDENT>logging.info("<STR_LIT>", p)<EOL><DEDENT><DEDENT>
Transform YSO-style concept relations into SKOS equivalents.