zazuko / rdf-cube-view-query

RDF Cube View Schema query library
2 stars 3 forks source link

Override sourceGraph in LookupSource #39

Open jstcki opened 3 years ago

jstcki commented 3 years ago

If a lookup source is created from a source that has a sourceGraph, lookups will be restricted to that graph. This is undesirable in the case where we only want cubes from a specific graph but lookups outside of it (e.g. to look up canton names).

My current workaround:

  const lookupSource = LookupSource.fromSource(cube.source);
  // Override sourceGraph from cube source, so lookups also work outside of that graph
  lookupSource.ptr.deleteOut(ns.cubeView.graph);
  lookupSource.ptr.addOut(ns.cubeView.graph, rdf.defaultGraph());

Could be:

  const lookupSource = LookupSource.fromSource(cube.source, { sourceGraph: rdf.defaultGraph() });
l00mi commented 3 years ago

@herrstucki do we need this urgent?

jstcki commented 3 years ago

Not urgent for our use cases at the moment 🙂