docs: def rdf_compare(g1: Graph, g2: Graph, ignore_owl_version: bool=False, ignore_type_arcs: bool = False,
                  compare_filter: Optional[Callable[[Graph, Graph, Graph], None]]=None) -> str:
      """
      Compare graph g1 and g2
      :param g1: first graph
      :param g2: second graph
      :param ignore_owl_version:
      :param ignore_type_arcs:
      :param compare_filter: Final adjustment for graph difference. Used, for example, to deal with FHIR decimal problems.
      :return: List of differences as printable lines or blank if everything matches
      """
      def graph_for_subject(g: Graph, subj: Node) -> Graph:
          subj_in_g = complete_definition(subj, g)
          if ignore_type_arcs:
              for ta_s, ta_o in subj_in_g.subject_objects(RDF.type):
                  if isinstance(ta_s, BNode) and isinstance(ta_o, URIRef):
                      subj_in_g.remove((ta_s, RDF.type, ta_o))
          if ignore_owl_version:
              subj_in_g.remove((subj, OWL.versionIRI, subj_in_g.value(subj, OWL.versionIRI)))
          return subj_in_g
  
      def primary_subjects(g: Graph) -> Set[Node]:
          anon_subjs = set(anon_s for anon_s in g.subjects()
                           if isinstance(anon_s, BNode) and len([g.subject_predicates(anon_s)]) == 0)
          return set(s_ for s_ in g1.subjects() if isinstance(s_, URIRef)).union(anon_subjs)
  
      rval = ""
  
      # Step 1: Find any subjects in one graph that don't exist in the other
      g1_subjs = primary_subjects(g1)
      g2_subjs = primary_subjects(g2)
      for s in g1_subjs - g2_subjs:
          rval += "\n===== Subjects in Graph 1 but not Graph 2: "
          rval += PrettyGraph.strip_prefixes(complete_definition(s, g1))
      for s in g2_subjs - g1_subjs:
          rval += "\n===== Subjects in Graph 2 but not Graph 1: "
          rval += PrettyGraph.strip_prefixes(complete_definition(s, g2))
  
      # Step 2: Iterate over all of the remaining subjects comparing their contents
      for s in g1_subjs.intersection(g2_subjs):
          s_in_g1 = graph_for_subject(g1, s)
          s_in_g2 = graph_for_subject(g2, s)
          in_both, in_first, in_second = graph_diff(skolemize(s_in_g1), skolemize(s_in_g2))
          if compare_filter:
              compare_filter(in_both, in_first, in_second)
          if len(list(in_first)) or len(list(in_second)):
              rval += "\n\nSubject {} DIFFERENCE: ".format(s) + '=' * 30
              if len(in_first):
                  rval += "\n\t----> First: \n" + '\n'.join(dump_nt_sorted(in_first))
              if len(in_second):
                  rval += "\n\t----> Second: \n" + '\n'.join(dump_nt_sorted(in_second))
              rval += '-' * 40
      return rval