class_docstr: This class implements statistics for concepts and entities using SPARQL. It can be used to
  count concept frequency, entity relation frequency from DBpedia.
class_docstr_tok: ["This","class","implements","statistics","for","concepts","and","entities","using","SPARQL",".","It","can","be","used","to","count","concept","frequency",",","entity","relation","frequency","from","DBpedia","."]
code: def entity_share(self, entity1, entity2):
      s1, t1 = self.thing("s1")
      t2 = self.s_triple(entity1, "p1", s1)
      t3 = self.o_triple(s1, "p1", entity1)
      t4 = self.s_triple(entity2, "p2", s1)
      t5 = self.o_triple(s1, "p2", entity2)
      count_1 = self.count_query(s1, t1 + t2 + t4)
      count_2 = self.count_query(s1, t1 + t2 + t5)
      count_3 = self.count_query(s1, t1 + t3 + t4)
      count_4 = self.count_query(s1, t1 + t3 + t5)
      return sum(map(int, [count_1, count_2, count_3, count_4]))
  
imports: from __future__ import print_function
  from SPARQLWrapper import SPARQLWrapper, JSON
  from rdflib import RDF, RDFS, OWL
label_desc: Use image node_id 7 for calling the StatSPARQL obj's underlying member method code with example usage: obj.entity_share(entity1, entity2) and returns: sum