def skos_topConcept(rdf):
for s, o in rdf.subject_objects(SKOS.hasTopConcept):<EOL><INDENT>rdf.add((o, SKOS.topConceptOf, s))<EOL><DEDENT>for s, o in rdf.subject_objects(SKOS.topConceptOf):<EOL><INDENT>rdf.add((o, SKOS.hasTopConcept, s))<EOL><DEDENT>for s, o in rdf.subject_objects(SKOS.topConceptOf):<EOL><INDENT>rdf.add((s, SKOS.inScheme, o))<EOL><DEDENT>
Infer skos:topConceptOf/skos:hasTopConcept (S8) and skos:inScheme (S7).