metarelate / metOcean-mapping

GNU Lesser General Public License v3.0
1 stars 6 forks source link

peculiar API features #2 #35

Open pp-mo opened 11 years ago

pp-mo commented 11 years ago

The implementation of the server 'retrieve_mappings' call seems rather odd. It passes info -- and itself -- to queries.valid_ordered_mappings. Which then ...

  1. constructs a query string
  2. calls the the server back, via the run_query method
  3. returns the data from that back to the caller

Many of the queries behave similarly, though some also perform extra processing of the raw query result at step (3), to make the final return value .

It feels to me like any+all server ('fuseki') methods which make calls into the queries module should not be there at all (retrieve_mappings, validate, save et al.). In effect, these methods provide management concepts specific to our database structure and/or usage. So that should really be kept separate from the generic server functions.

So, I'd expect (+ much prefer) to see the server module called by the queries module, but never the other way around.

Meanwhile, the existing 'fuseki' enquiry API methods, that I'm objecting to here, might belong in the existing queries module, or possibly in a separate layer that encodes DB usage rather than encoding concepts (I haven't seen enough to grasp it all).