class_docstr: This class implement basic query graph patterns which can query type of things, and a type entity pattern.
class_docstr_tok: ["This","class","implement","basic","query","graph","patterns","which","can","query","type","of","things",",","and","a","type","entity","pattern","."]
docstr: Construct type entity queries.
  Some more possible patterns.
  ?x ?p1 ?y. ?y ?p2 <%s>.
  ?x ?p1 ?y. <%s> ?p2 ?y.
  ?y ?p1 ?x. ?y ?p2 <%s>
  ?y ?p1 ?x. <%s> ?p2 ?y.
  :param concepts:
  :param entity:
  :return:
docstr_tok: ["Construct","type","entity","queries",".","Some","more","possible","patterns",".","?","x","?","p1","?","y",".","?","y","?","p2","<","%","s",">",".","?","x","?","p1","?","y",".","<","%","s",">","?","p2","?","y",".","?","y","?","p1","?","x",".","?","y","?","p2","<","%","s",">","?","y","?","p1","?","x",".","<","%","s",">","?","p2","?","y",".",":","param","concepts",":",":","param","entity",":",":","return",":"]
code: def type_entity_query(self, concepts, entity, show_query=False):
      """
      Construct type entity queries.
      Some more possible patterns.
      ?x ?p1 ?y. ?y ?p2 <%s>.
      ?x ?p1 ?y. <%s> ?p2 ?y.
      ?y ?p1 ?x. ?y ?p2 <%s>
      ?y ?p1 ?x. <%s> ?p2 ?y.
      :param concepts:
      :param entity:
      :return:
      """
      triples = map(
          lambda x: self.po_triple(RDF.type, x, "s"), concepts
      )
      t1 = [t for v, t in triples]
      t1 = self.union(t1)
      t2 = self.s_triple(entity, "p", "s")
      t3 = self.o_triple("s", "p", entity)
      res1 = self.text_query("s", t1 + t2, show_query=show_query)
      res2 = self.text_query("s", t1 + t3, show_query=show_query)
      return res1 + res2
  
imports: from __future__ import print_function
  from SPARQLWrapper import SPARQLWrapper, JSON
  from rdflib import RDF, RDFS, OWL
label_desc: Use image node_id 3 for calling the QueryGraph obj's underlying member method code with example usage: obj.type_entity_query(concepts, entity, show_query) and returns: unknown