'Resolve the base and slope selectors against resource
@param resource: the resource'

def resolve(self, resource):

    self.resource = None
    base = self.base
    self.base_rfield = None
    self.base_column = base
    slope = self.slope
    self.slope_rfield = None
    self.slope_column = slope
    base_rfield = None
    if base:
        try:
            base_rfield = resource.resolve_selector(base)
        except (AttributeError, SyntaxError) as e:
            base_rfield = None
    slope_rfield = None
    if slope:
        try:
            slope_rfield = resource.resolve_selector(slope)
        except (AttributeError, SyntaxError):
            slope_rfield = None
    method = self.method
    if (base_rfield is None):
        if ((method != 'cumulate') or (slope_rfield is None)):
            raise SyntaxError('Invalid    fact    parameter')
    if (method != 'count'):
        numeric_types = NUMERIC_TYPES
        if (base_rfield and (base_rfield.ftype not in numeric_types)):
            raise SyntaxError(('Fact    field    type    not    numeric:    %s    (%s)' % (base, base_rfield.ftype)))
        if (slope_rfield and (slope_rfield.ftype not in numeric_types)):
            raise SyntaxError(('Fact    field    type    not    numeric:    %s    (%s)' % (slope, slope_rfield.ftype)))
    if base_rfield:
        self.base_rfield = base_rfield
        self.base_column = base_rfield.colname
    if slope_rfield:
        self.slope_rfield = slope_rfield
        self.slope_column = slope_rfield.colname
    if (not self.label):
        label = self.lookup_label(resource, method, base, slope, self.interval)
        if (not label):
            label = self.default_label(base_rfield, self.method)
        self.label = label
    self.resource = resource
    return self
