jupyrdf / ipyradiant

Jupyter widgets for working with RDF graphs.
BSD 3-Clause "New" or "Revised" License
5 stars 7 forks source link

Handle 1..N queries for converter. #59

Closed zwelz3 closed 3 years ago

zwelz3 commented 3 years ago

Monolithic queries are difficult to define, challenging to maintain, and in some cases less performant than multiple separate queries.

This ticket investigates a way to allow for N number of queries of each type for the ipyradiant.rdf2nx.RDF2NX converter. This would allow users to specify multiple queries that satisfy a stage of the process (e.g. NodeIRIs). The process should use nx.compose to aggregate results and pass them through the normal RDF2NX process.

Blocked by #50/#58

zwelz3 commented 3 years ago

After discussion with Santiago, we have decided that the following pattern should be sufficient:

if isinstance(cls.node_iris, (list, tuple)):
  node_iris = pd.concat(
    [query.run_query(rdf_graph) for query in cls.node_iris],
    ignore_index=True,
  )
else:
  # run_query