code: def get_terms_in_subset(ont, subset):
      
      namedGraph = get_named_graph(ont)
  
      # note subsets have an unusual encoding
      query = """
      prefix oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>
      SELECT ?c ? WHERE {{
      GRAPH <{g}>  {{
      ?c oboInOwl:inSubset ?s ;
         rdfs:label ?l
      FILTER regex(?s,'#{s}$','i')
      }}
      }}
      """.format(s=subset, g=namedGraph)
      bindings = run_sparql(query)
      return [(r['c']['value'],r['l']['value']) for r in bindings]
docs: Find all nodes in a subset.
  
      We assume the oboInOwl encoding of subsets, and subset IDs are IRIs