class_docstr: Neo4jStellarGraph class for graph machine learning on graphs stored in
  a Neo4j database.
  
  This class communicates with Neo4j via a :class:`py2neo.Graph` connected to the graph
  database of interest and contains functions to query the graph data necessary
  for machine learning.
  
  .. seealso:: `Examples using Neoj <https://stellargraph.readthedocs.io/en/stable/demos/connector/neo4j/index.html>`__.
  
  Args:
      graph_db (py2neo.Graph): a :class:`py2neo.Graph` connected to a Neo4j graph database.
      node_label (str, optional): Common label for all nodes in the graph, if such label exists.
          Providing this is useful if there are any indexes created on this label (e.g. on node IDs),
          as it will improve performance of queries.
      id_property (str, optional): Name of Neo4j property to use as ID.
      features_property (str, optional): Name of Neo4j property to use as features.
      is_directed (bool, optional): If True, the data represents a
          directed multigraph, otherwise an undirected multigraph.
class_docstr_tok: ["Neo4jStellarGraph","class","for","graph","machine","learning","on","graphs","stored","in","a","Neo4j","database",".","This","class","communicates","with","Neo4j","via","a",":","class",":","`","py2neo.Graph","`","connected","to","the","graph","database","of","interest","and","contains","functions","to","query","the","graph","data","necessary","for","machine","learning",".","..","seealso",":",":","`","Examples","using","Neoj","<","https",":","\/\/stellargraph.readthedocs.io\/en\/stable\/demos\/connector\/neo4j\/index.html",">","`","__",".","Args",":","graph_db","(","py2neo.Graph",")",":","a",":","class",":","`","py2neo.Graph","`","connected","to","a","Neo4j","graph","database",".","node_label","(","str",",","optional",")",":","Common","label","for","all","nodes","in","the","graph",",","if","such","label","exists",".","Providing","this","is","useful","if","there","are","any","indexes","created","on","this","label","(","e.g",".","on","node","IDs",")",",","as","it","will","improve","performance","of","queries",".","id_property","(","str",",","optional",")",":","Name","of","Neo4j","property","to","use","as","ID",".","features_property","(","str",",","optional",")",":","Name","of","Neo4j","property","to","use","as","features",".","is_directed","(","bool",",","optional",")",":","If","True",",","the","data","represents","a","directed","multigraph",",","otherwise","an","undirected","multigraph","."]
docstr: Obtains a SciPy sparse adjacency matrix for the subgraph containing
  the nodes specified in node_ids.
  
  Args:
      nodes (list): The collection of nodes
          comprising the subgraph. The adjacency matrix is
          computed for this subgraph.
      weighted (bool, optional): Must be false, at the moment.
  
  Returns:
       The weighted adjacency matrix.
docstr_tok: ["Obtains","a","SciPy","sparse","adjacency","matrix","for","the","subgraph","containing","the","nodes","specified","in","node_ids",".","Args",":","nodes","(","list",")",":","The","collection","of","nodes","comprising","the","subgraph",".","The","adjacency","matrix","is","computed","for","this","subgraph",".","weighted","(","bool",",","optional",")",":","Must","be","false",",","at","the","moment",".","Returns",":","The","weighted","adjacency","matrix","."]
code: def to_adjacency_matrix(self, node_ids, weighted=False):
      """
      Obtains a SciPy sparse adjacency matrix for the subgraph containing
      the nodes specified in node_ids.
  
      Args:
          nodes (list): The collection of nodes
              comprising the subgraph. The adjacency matrix is
              computed for this subgraph.
          weighted (bool, optional): Must be false, at the moment.
  
      Returns:
           The weighted adjacency matrix.
      """
  
      # this param is for compatibility with StellarGraph.to_adjacency_matrix
      if weighted:
          raise ValueError(
              "weighted: expected False, found {weighted!r}"
          )
  
      # neo4j optimizes this query to be O(edges incident to nodes)
      # not O(E) as it appears
      subgraph_query = f"""
              MATCH (source)-->(target)
              WHERE source.{self.cypher_id_property} IN $node_id_list AND target.{self.cypher_id_property} IN $node_id_list
              RETURN collect(source.{self.cypher_id_property}) AS sources, collect(target.{self.cypher_id_property}) as targets
              """
  
      result = self.graph_db.run(
          subgraph_query, parameters={"node_id_list": node_ids}
      )
  
      data = result.data()[0]
      sources = np.array(data["sources"])
      targets = np.array(data["targets"])
  
      index = pd.Index(node_ids)
  
      src_idx = index.get_indexer(sources)
      tgt_idx = index.get_indexer(targets)
  
      weights = np.ones(len(sources), dtype=np.float32)
      shape = (len(node_ids), len(node_ids))
      adj = sps.csr_matrix((weights, (src_idx, tgt_idx)), shape=shape)
  
      if not self.is_directed() and len(data) > 0:
          # in an undirected graph, the adjacency matrix should be symmetric: which means counting
          # weights from either "incoming" or "outgoing" edges, but not double-counting self loops
  
          # FIXME https://github.com/scipy/scipy/issues/11949: these operations, particularly the
          # diagonal, don't work for an empty matrix (n == 0)
          backward = adj.transpose(copy=True)
          # this is setdiag(0), but faster, since it doesn't change the sparsity structure of the
          # matrix (https://github.com/scipy/scipy/issues/11600)
          (nonzero,) = backward.diagonal().nonzero()
          backward[nonzero, nonzero] = 0
  
          adj += backward
  
      # this is a multigraph, let's eliminate any duplicate entries
      adj.sum_duplicates()
      return adj
  
imports: import numpy
  import scipy.sparse
  import pandas
  import re
  import warnings
  from ...None import globalvar
  from ...core.experimental import experimental
  from ...core import convert
  from ...core.indexed_array import IndexedArray
  from ...core.graph import extract_element_features
  from ...core.validation import comma_sep
label_desc: Use image node_id 8 for calling the Neo4jStellarGraph obj's underlying member method code with example usage: obj.to_adjacency_matrix(node_ids, weighted) and returns: adj