def rdfs_properties(rdf):
<EOL>superprops = {}  <EOL>for s, o in rdf.subject_objects(RDFS.subPropertyOf):<EOL><INDENT>superprops.setdefault(s, set())<EOL>for sp in rdf.transitive_objects(s, RDFS.subPropertyOf):<EOL><INDENT>if sp != s:<EOL><INDENT>superprops[s].add(sp)<EOL><DEDENT><DEDENT><DEDENT>for p, sps in superprops.items():<EOL><INDENT>logging.debug("<STR_LIT>", p, str(sps))<EOL>for s, o in rdf.subject_objects(p):<EOL><INDENT>for sp in sps:<EOL><INDENT>rdf.add((s, sp, o))<EOL><DEDENT><DEDENT><DEDENT>
Perform RDFS subproperty inference.

    Add superproperties where subproperties have been used.