(results, b='p', freq_threshold=0)
return results
Takes results of a SPARQL query and filters out all rows that contain blacklisted relations.

    :param results: results of a SPARQL query
    :param b: the key of the relation value in the results dictionary
    :return: filtered results
    >>> filter_relations([{"p":"http://www.w3.org/1999/02/22-rdf-syntax-ns#type", "e2":"http://www.wikidata.org/ontology#Item"}, {"p":"http://www.wikidata.org/entity/P1429s", "e2":"http://www.wikidata.org/entity/Q76S69dc8e7d-4666-633e-0631-05ad295c891b"}])
    []
Takes results of a SPARQL query and filters out all rows that contain blacklisted relations.
Takes results of a SPARQL query and filters out all rows that contain blacklisted relations .
def filter_relations(results, b='p', freq_threshold=0):
    """
    Takes results of a SPARQL query and filters out all rows that contain blacklisted relations.

    :param results: results of a SPARQL query
    :param b: the key of the relation value in the results dictionary
    :return: filtered results
    >>> filter_relations([{"p":"http://www.w3.org/1999/02/22-rdf-syntax-ns#type", "e2":"http://www.wikidata.org/ontology#Item"}, {"p":"http://www.wikidata.org/entity/P1429s", "e2":"http://www.wikidata.org/entity/Q76S69dc8e7d-4666-633e-0631-05ad295c891b"}])
    []
    """
    results = [r for r in results if b not in r or
               (r[b] in EXCEPTION_RELATIONS or
                (r[b][:-1] in CONTENT_PROPERTIES and r[b][-1] not in endpoint_access.FILTER_RELATION_CLASSES))
               ]
    results = [r for r in results if b not in r or scheme.property2label[r[b][:-1]]['freq'] > freq_threshold]
    return results
def filter_relations ( results , b = 'p' , freq_threshold = 0 ) : results = [ r for r in results if b not in r or ( r [ b ] in EXCEPTION_RELATIONS or ( r [ b ] [ : - 1 ] in CONTENT_PROPERTIES and r [ b ] [ - 1 ] not in endpoint_access . FILTER_RELATION_CLASSES ) ) ] results = [ r for r in results if b not in r or scheme . property2label [ r [ b ] [ : - 1 ] ] [ 'freq' ] > freq_threshold ] return results