Iterator over relationship IDs that match a pattern of components

        origin - (optional) origin of the relationship (similar to an RDF subject). If omitted any origin will be matched.
        rel - (optional) type IRI of the relationship (similar to an RDF predicate). If omitted any relationship will be matched.
        target - (optional) target of the relationship (similar to an RDF object), a boolean, floating point or unicode object. If omitted any target will be matched.
        attrs - (optional) attribute mapping of relationship metadata, i.e. {attrname1: attrval1, attrname2: attrval2}. If any attribute is specified, an exact match is made (i.e. the attribute name and value must match).
        include_ids - If true include statement IDs with yield values

def match(self, origin=None, rel=None, target=None, attrs=None, include_ids=False):
        '''
        Iterator over relationship IDs that match a pattern of components

        origin - (optional) origin of the relationship (similar to an RDF subject). If omitted any origin will be matched.
        rel - (optional) type IRI of the relationship (similar to an RDF predicate). If omitted any relationship will be matched.
        target - (optional) target of the relationship (similar to an RDF object), a boolean, floating point or unicode object. If omitted any target will be matched.
        attrs - (optional) attribute mapping of relationship metadata, i.e. {attrname1: attrval1, attrname2: attrval2}. If any attribute is specified, an exact match is made (i.e. the attribute name and value must match).
        include_ids - If true include statement IDs with yield values
        '''
        abbrevs = self._abbreviations()
        index = 0
        if origin is None:
            cursor = self._db_coll.find()
        else:
            cursor = self._db_coll.find({'origin': origin})
            
        for item in cursor:
            if item['origin'] == '@_abbreviations':
                continue
            if origin != item['origin']:
                continue
            for xrel_obj in item['rels']:
                xrelid = xrel_obj['rid'].format(**abbrevs)
                if rel and rel != xrelid:
                    continue
                for xtarget, xattrs in xrel_obj['instances']:
                    xtarget = xtarget.format(**abbrevs)
                    if target and target != xtarget:
                        continue
                    matches = True
                    if attrs:
                        for k, v in attrs.items():
                            if k not in xattrs or xattrs.get(k) != v:
                                matches = False
                    if matches:
                        yield index, (origin, xrelid, xtarget, xattrs)
                        index += 1

                    #if matches:
                    #    if include_ids:
                    #        yield index, (curr_rel[0], curr_rel[1], curr_rel[2], curr_rel[3].copy())
                    #    else:
                    #        yield (curr_rel[0], curr_rel[1], curr_rel[2], curr_rel[3].copy())
        return