code: def subontology(self, nodes=None, minimal=False, relations=None):
          
          g = None
          if nodes is not None:
              g = self.subgraph(nodes)
          else:
              g = self.get_graph()
          if minimal:
              from ontobio.slimmer import get_minimal_subgraph
              g = get_minimal_subgraph(g, nodes)
  
          ont = Ontology(graph=g, xref_graph=self.xref_graph) # TODO - add metadata
          if relations is not None:
              g = ont.get_filtered_graph(relations)
              ont = Ontology(graph=g, xref_graph=self.xref_graph)
          return ont
docs: Return a new ontology that is an extract of this one
  
          Arguments
          ---------
          - nodes: list
              list of node IDs to include in subontology. If None, all are used
          - relations: list
              list of relation IDs to include in subontology. If None, all are used