6781bb45898cf79b639807def34b372becc91cc2,entity2rec/sparql.py,Sparql,_get_properties,#Sparql#,72

Before Change



            c = Counter()

            for results in self.wrapper.query().convert()["results"]["bindings"]:

                prop = results["p"]["value"]

                if "wiki" not in prop and "thumb" not in prop:

                    c[prop] += 1

            top_10_prop = sorted(c.items(), key=operator.itemgetter(1), reverse=True)[0:10]

            for p, count in top_10_prop:

After Change



        c = Counter()

        for entity in self.entities:

            query = "select distinct ?p " \
                         "where {{ <{}> ?p ?o. " \
                         "FILTER(!isLiteral(?o) && regex(STR(?p)," \
                         ""dbpedia.org/ontology") && !regex(STR(?p)," \
                         ""wiki") && !regex(STR(?p),"thumb"))}} ".format(entity)

            self.wrapper.setQuery(query)

            for results in self.wrapper.query().convert()["results"]["bindings"]:

                prop = results["p"]["value"]

                c[prop] += 1

        top_10_prop = sorted(c.items(), key=operator.itemgetter(1), reverse=True)[0:10]

        for p, count in top_10_prop:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: D2KLab/entity2rec
Commit Name: 6781bb45898cf79b639807def34b372becc91cc2
Time: 2017-12-22
Author: enricopalumbo0@gmail.com
File Name: entity2rec/sparql.py
Class Name: Sparql
Method Name: _get_properties


Project Name: scikit-image/scikit-image
Commit Name: f8d9a6c144ef84bad2478a4ba4eedb1c559274e0
Time: 2020-11-11
Author: rfezzani@gmail.com
File Name: skimage/_shared/coord.py
Class Name:
Method Name: ensure_spacing


Project Name: facebookresearch/pythia
Commit Name: 2f337387d6759627bae60284e7fa612268580724
Time: 2020-09-15
Author: vedanujg@gmail.com
File Name: mmf/models/mmf_transformer.py
Class Name: MMFTransformerEmbeddings
Method Name: forward