class_docstr: Represents a SPARQL connector.
  
  Attributes:
      _asession: The aiohttp session to use for asynchrone requests.
          Defaults to None.
      _headers: The HTTP headers to use.
          Defaults to {"Accept": "application/sparql-results+json"}.
      cache: The policy and size cache to use.
          Defaults to connectors.TTLCache(maxsize=1024, ttl=1200).
      endpoint: The endpoint to execute the queries.
class_docstr_tok: ["Represents","a","SPARQL","connector",".","Attributes",":","_asession",":","The","aiohttp","session","to","use","for","asynchrone","requests",".","Defaults","to","None",".","_headers",":","The","HTTP","headers","to","use",".","Defaults","to","{","``","Accept","''",":","``","application\/sparql-results+json","''","}",".","cache",":","The","policy","and","size","cache","to","use",".","Defaults","to","connectors.TTLCache","(","maxsize=1024",",","ttl=1200",")",".","endpoint",":","The","endpoint","to","execute","the","queries","."]
docstr: Gets the SPARQL query for an entity.
  
  Args:
      entity: The entity to get the SPARQL query.
      preds: The predicate chain to fetch a literal
          Defaults to None.
  
  Returns:
      The SPARQL query for the given entity.
docstr_tok: ["Gets","the","SPARQL","query","for","an","entity",".","Args",":","entity",":","The","entity","to","get","the","SPARQL","query",".","preds",":","The","predicate","chain","to","fetch","a","literal","Defaults","to","None",".","Returns",":","The","SPARQL","query","for","the","given","entity","."]
code: def get_query(
      self, entity: str, preds: Optional[List[str]] = None
  ) -> str:
      """Gets the SPARQL query for an entity.
  
      Args:
          entity: The entity to get the SPARQL query.
          preds: The predicate chain to fetch a literal
              Defaults to None.
  
      Returns:
          The SPARQL query for the given entity.
  
      """
      query = f"SELECT ?p ?o WHERE {{ <{entity}> ?p "
      if preds:
          query = f"SELECT ?o WHERE {{ <{entity}> <{preds[0]}> "
          for i in range(1, len(preds)):
              query += f"?o{i} . ?o{i} <{preds[i]}> "
      query += "?o . }"
      return query
  
file_path: pyRDF2Vec/pyrdf2vec/connectors.py
imports: import asyncio
  import operator
  from abc import ABC, abstractmethod
  from typing import Dict, List, Optional, Tuple, Union
  from urllib import parse
  import aiohttp
  import attr
  import numpy
  import requests
  from cachetools import Cache, TTLCache, cachedmethod
  from pyrdf2vec.typings import Literal, Response
label_desc: Use image node_id 2 for calling the SPARQLConnector obj's underlying member method code with example usage: obj.get_query(entity, preds) and returns: query