def configGraphIO(remote_base,
                      local_base=        None,
                      branch=            'master',
                      core_graph_paths=  tuple(),
                      core_graph=        None,
                      in_graph_paths=    tuple(),
                      out_graph_path=    None,
                      out_imports=       tuple(),
                      out_graph=         None,
                      prefixes=          tuple(),
                      force_remote=      False,
                      checkout_ok=       ont_checkout_ok,
                      scigraph=          None,
                      iri=               None,
                      sources=           tuple(),
                      source_file=       None,
                      use_local_import_paths=True,
                      compiled_location= (PPath('/tmp/neurondm/compiled')
                                          if working_dir is None else
                                          PPath(working_dir, 'neurondm/neurondm/compiled')),
                      ignore_existing=   False,
                      local_conventions= False,):
        # FIXME suffixes seem like a bad way to have done this :/
        """ We set this up to work this way because we can't
            instantiate graphBase, it is a super class that needs
            to be configurable and it needs to do so globally.
            All the default values here are examples and not real.
            You should write a local `def config` function as part
            of your local setup that replicates that arguments of
            configureGraphIO.

            Example:
            def config(remote_base=       'http://someurl.org/remote/ontology/',
                       local_base=        '/home/user/git/ontology/',
                       branch=            'master',
                       core_graph_paths= ['local/path/localCore.ttl',
                                          'local/path/localClasses.ttl'],
                       core_graph=        None,
                       in_graph_paths=    tuple(),
                       out_graph_path=    '/tmp/outputGraph.ttl',
                       out_imports=      ['local/path/localCore.ttl'],
                       out_graph=         None,
                       prefixes=          {'hello':'http://world.org/'}
                       force_remote=      False,
                       checkout_ok=       False,
                       scigraph=          'http://scigraph.mydomain.org:9000/scigraph'):
            graphBase.configGraphIO(remote_base, local_base, branch,
                                    core_graph_paths, core_graph,
                                    in_graph_paths,
                                    out_graph_path, out_imports, out_graph,
                                    force_remote, checkout_ok, scigraph)

        """

        graphBase.local_conventions = local_conventions

        if local_base is None:
            local_base = devconfig.ontology_local_repo
        graphBase.local_base = Path(local_base).expanduser().resolve()
        graphBase.remote_base = remote_base

        def makeLocalRemote(suffixes):
            remote = [os.path.join(graphBase.remote_base, branch, s)
                      if '://' not in s else  # 'remote' is file:// or http[s]://
                      s for s in suffixes]
            # TODO the whole thing needs to be reworked to not use suffixes...
            local = [(graphBase.local_base / s).as_posix()
                     if '://' not in s else
                     ((graphBase.local_base / s.replace(graphBase.remote_base, '').strip('/')).as_uri()
                      if graphBase.remote_base in s else s)  # FIXME this breaks the semanics of local?
                      for s in suffixes]
            return remote, local

        # file location setup
        remote_core_paths,  local_core_paths =  makeLocalRemote(core_graph_paths)
        remote_in_paths,    local_in_paths =    makeLocalRemote(in_graph_paths)
        remote_out_imports, local_out_imports = makeLocalRemote(out_imports)

        out_graph_paths = [out_graph_path]
        remote_out_paths, local_out_paths = makeLocalRemote(out_graph_paths)  # XXX fail w/ tmp
        remote_out_paths = local_out_paths  # can't write to a remote server without magic

        if (not force_remote
            and graphBase.local_base == Path(devconfig.ontology_local_repo)
            and graphBase.local_base.exists()):

            repo = Repo(graphBase.local_base.as_posix())
            if repo.active_branch.name != branch and not checkout_ok:
                raise graphBase.GitRepoOnWrongBranch(
                    'Local git repo not on %s branch!\n'
                    'Please run `git checkout %s` in %s, '
                    'set NIFSTD_CHECKOUT_OK= via export or '
                    'at runtime, or set checkout_ok=True.'
                    % (branch, branch, repo.working_dir))
            elif checkout_ok:
                graphBase.repo = repo
                graphBase.working_branch = next(h for h in repo.heads
                                                if h.name == branch)
                graphBase.original_branch = repo.active_branch
                graphBase.set_repo_state()
            use_core_paths = local_core_paths
            use_in_paths = local_in_paths
        else:
            if not force_remote and not graphBase.local_base.exists():
                log.warning(f'Warning local ontology path {local_base!r} not found!')
            use_core_paths = remote_core_paths
            use_in_paths = remote_in_paths

            if local_base is not None:
                log.warning(f'Warning local base has been set manually you are on your own!')
                try:
                    repo = Repo(graphBase.local_base.as_posix())
                except (git.exc.InvalidGitRepositoryError, git.exc.NoSuchPathError) as e:
                    local_working_dir = get_working_dir(graphBase.local_base)
                    if local_working_dir is None:
                        raise e
                    else:
                        msg = (f'{graphBase.local_base} is already contained in a git repository '
                               'located in {local_working_dir} if you wish to use this repo please '
                               'set local_base to {local_working_dir}.')
                        raise git.exc.InvalidGitRepositoryError(msg) from e

                graphBase.repo = repo
                # FIXME repo init when branch set still an issue
                # ideally remove _all_ of this code though because WOW
                # it is a mess
                graphBase.set_repo_state()

        # core graph setup
        if core_graph is None:
            core_graph = rdflib.ConjunctiveGraph()
        for cg in use_core_paths:
            try:
                core_graph.parse(cg, format='turtle')
            except (FileNotFoundError, HTTPError) as e:
                # TODO failover to local if we were remote?
                #print(tc.red('WARNING:'), f'no file found for core graph at {cg}')
                log.warning(f'no file found for core graph at {cg}')
        graphBase.core_graph = core_graph
        if RDFL not in [type(s) for s in OntTerm.query.services]:
            # FIXME ah subtle differences between graphs >_<
            # need a much more consistent way to handle the local graphs
            # switching everything out for a single RDFL instance seems
            # the most attractive ...
            OntTerm.query.ladd(RDFL(core_graph, OntId))  # ladd for higher priority

        # store prefixes
        if isinstance(prefixes, dict):
            graphBase.prefixes = prefixes
        else:
            graphBase.prefixes = makePrefixes(*prefixes)

        PREFIXES = {**graphBase.prefixes, **uPREFIXES}
        OntCuries(PREFIXES)

        # input graph setup
        in_graph = core_graph
        for ig in use_in_paths:
            in_graph.parse(ig, format='turtle')

        nin_graph = makeGraph('', prefixes=PREFIXES, graph=in_graph)
        graphBase.in_graph = in_graph
        graphBase.ignore_existing = ignore_existing

        # output graph setup
        if out_graph is None:
            _sources = sources
            _source_file = source_file
            class NeurOnt(Ont):  # FIXME this is super misleading wrt the source ...
                path = 'ttl/generated/neurons/'
                #filename = 'to-be-set-later'
                prefixes = PREFIXES
                sources = _sources
                source_file = _source_file
                # FIXME temp fix for issue with wgb in core
                #wasGeneratedBy = ('https://github.com/tgbugs/pyontutils/blob/'
                                  #'{commit}/'
                                  #'{filepath}'
                                  #'{hash_L_line}')

            no = NeurOnt()
            out_graph = no.graph
            graphBase.ng = no._graph

            #out_graph = rdflib.Graph()
            # in thise case we also want to wipe any existing python Neuron entires
            # that we use to serialize so that behavior is consistent
            NeuronBase.existing_pes = {}
            NeuronBase.existing_ids = {}
        else:
            no = None
            graphBase.ng = makeGraph('', prefixes=PREFIXES, graph=out_graph)
        #new_graph = makeGraph('', prefixes=PREFIXES, graph=out_graph)
        graphBase.out_graph = out_graph

        # python output setup
        graphBase.compiled_location = compiled_location

        # makeGraph setup
        new_graph = graphBase.ng #= new_graph
        new_graph.filename = out_graph_path

        if iri is not None:
            ontid = rdflib.URIRef(iri)
        else:
            ontid = rdflib.URIRef('file://' + out_graph_path)  # do not use Path().absolute() it will leak

        if use_local_import_paths:
            new_graph.add_trip(ontid, rdf.type, owl.Ontology)
            for local_out_import in local_out_imports:  # TODO flip switch between local and remote import behavior
                new_graph.add_trip(ontid, owl.imports, rdflib.URIRef(local_out_import))  # core should be in the import closure
        else:
            new_graph.add_trip(ontid, rdf.type, owl.Ontology)
            for remote_out_import in remote_out_imports:  # TODO flip switch between local and remote import behavior
                new_graph.add_trip(ontid, owl.imports, rdflib.URIRef(remote_out_import))  # core should be in the import closure

        if no is not None:
            no()  # populate generated by info

        # set predicates
        graphBase._predicates = getPhenotypePredicates(graphBase.core_graph)

        # scigraph setup
        if scigraph is not None:
            graphBase._sgv = Vocabulary(cache=True, basePath=scigraph)
        else:
            graphBase._sgv = Vocabulary(cache=True)
We set this up to work this way because we can't
            instantiate graphBase, it is a super class that needs
            to be configurable and it needs to do so globally.
            All the default values here are examples and not real.
            You should write a local `def config` function as part
            of your local setup that replicates that arguments of
            configureGraphIO.

            Example:
            def config(remote_base=       'http://someurl.org/remote/ontology/',
                       local_base=        '/home/user/git/ontology/',
                       branch=            'master',
                       core_graph_paths= ['local/path/localCore.ttl',
                                          'local/path/localClasses.ttl'],
                       core_graph=        None,
                       in_graph_paths=    tuple(),
                       out_graph_path=    '/tmp/outputGraph.ttl',
                       out_imports=      ['local/path/localCore.ttl'],
                       out_graph=         None,
                       prefixes=          {'hello':'http://world.org/'}
                       force_remote=      False,
                       checkout_ok=       False,
                       scigraph=          'http://scigraph.mydomain.org:9000/scigraph'):
            graphBase.configGraphIO(remote_base, local_base, branch,
                                    core_graph_paths, core_graph,
                                    in_graph_paths,
                                    out_graph_path, out_imports, out_graph,
                                    force_remote, checkout_ok, scigraph)