zazuko / rdf-cube-view-query

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

Non-existing cube is not null #41

Closed jstcki closed 3 years ago

jstcki commented 3 years ago

A cube that doesn't exist is never returned as null

const cube = await source.cube(iri);

Because this check is wrong: https://github.com/zazuko/rdf-cube-view-query/blob/e7cead4b8acafacc7d14b643b564112890c4e8c7/lib/Source.js#L53-L56

.out().length is always undefined therefore never 0. This should be .out().terms.length I think?

jstcki commented 3 years ago

Also, there may be cubes without observationConstraint (by accident?) … I wonder if those should also return null, as they're not very usable by this library.