returns a triplestore conncection based on the kwargs.
    Order of preceedence is as follows:
        kwargs['conn']
        kwargs['tstore_def']
        kwargs['triplestore_url']
        kwargs['rdflib']
        RdfConfigManager.data_tstore
        RdfConfigManager.TRIPLESTORE_URL

    kwargs:
        conn: established triplestore connection object
        tstore_def: dictionary of paramaters specifying the connection as
                outlined in the config file
        triplestore_url: url to a triplestore. A blazegraph connection
            will be used if specified
        rdflib: defintion for an rdflib connection

def setup_conn(**kwargs):
    """ returns a triplestore conncection based on the kwargs.
    Order of preceedence is as follows:
        kwargs['conn']
        kwargs['tstore_def']
        kwargs['triplestore_url']
        kwargs['rdflib']
        RdfConfigManager.data_tstore
        RdfConfigManager.TRIPLESTORE_URL

    kwargs:
        conn: established triplestore connection object
        tstore_def: dictionary of paramaters specifying the connection as
                outlined in the config file
        triplestore_url: url to a triplestore. A blazegraph connection
            will be used if specified
        rdflib: defintion for an rdflib connection
    """
    from rdfframework.configuration import RdfConfigManager
    if kwargs.get("conn"):
        conn = kwargs['conn']
    elif kwargs.get("tstore_def"):
        conn = make_tstore_conn(kwargs['tstore_def'])
    elif kwargs.get("triplestore_url"):
        conn = RdfwConnections['triplestore']['blazegraph']( \
                kwargs['triplestore_url'])
    elif kwargs.get("rdflib"):
        conn = RdfwConnections['triplestore']['rdflib'](kwargs.get('rdflib'))
    elif RdfConfigManager().data_tstore and \
            not isinstance(RdfConfigManager().data_tstore, EmptyDot):
        conn = ConnManager().datastore
    elif RdfConfigManager().TRIPLESTORE_URL and \
            not isinstance(RdfConfigManager().TRIPLESTORE_URL, EmptyDot):
        conn = RdfwConnections['triplestore']['blazegraph'](\
                RdfConfigManager().TRIPLESTORE_URL)
    else:
        conn = RdfwConnections['triplestore']['blazegraph']()
    return conn