grafter icon indicating copy to clipboard operation
grafter copied to clipboard

grafter.rdf.templater/graph should error if you have a nil graph

Open RickMoynihan opened this issue 8 years ago • 0 comments

For triples you get an error when a nil value is coerced into RDF, however if you're using the graph function it currently allows nil.

Normally pipeline developers will want to create Quads not triples, so we should raise an error in this case. If a pipeline developer wants to construct triples (i.e. Quad objects with a nil graph, we should define a new function in the grafter.rdf.templater namespace called default-graph that operates like graph but sets a nil graph on all the quads.

The problem is that we want to let you construct a triple by having a Quad with a nil context - this is much better than having two diferent types).

  • [ ] The graph function ( https://github.com/Swirrl/grafter/blob/0.8.x-SNAPSHOT/src/templater/grafter/rdf/templater.clj#L76 ) should error appropraitely if graph is nil (we should use a :pre condition for this check.
  • [ ] Add a new default-graph function that works like graph but sets a nil graph on the Quad objects it generates.

RickMoynihan avatar Nov 08 '16 12:11 RickMoynihan