metarelate / metOcean-mapping

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

Refactor of the metocean API. #41

Closed bjlittle closed 10 years ago

bjlittle commented 10 years ago

This PR is the first refactor of the metocean API.

It contains the first draft of minimal changes required to abstract the internal mapping representations for the user.

It does not consider value maps, which will be address in another additive PR, nor does it contain unit tests, which will be added once a test framework is established with another PR.

This PR introduces the dependency on pydot for digraph plotting of MetaRelate mappings.

wizardstoy commented 10 years ago

Awesome, Bill, A year on, I'm still keen to keep up on changes here :) Simon

On 28/10/2013, at 11:11 AM, Bill Little notifications@github.com wrote:

This PR is the first refactor of the metocean API.

It contains the first draft of minimal changes required to abstract the internal mapping representations for the user.

It does not consider value maps, which will be address in another additive PR, nor does it contain unit tests, which will be added once a test framework is established with another PR.

This PR introduces the dependency on pydot for digraph plotting of MetaRelate mappings.

You can merge this Pull Request by running

git pull https://github.com/bjlittle/metOcean-mapping reorg Or view, comment on, or merge it at:

https://github.com/metarelate/metOcean-mapping/pull/41

Commit Summary

Refactor of the metocean API. File Changes

M lib/metocean/init.py (548) M lib/metocean/fuseki.py (136) Patch Links:

https://github.com/metarelate/metOcean-mapping/pull/41.patch https://github.com/metarelate/metOcean-mapping/pull/41.diff

marqh commented 10 years ago

The function _retrieve_component function in the fuseki module seems somewhat out of place, now that there are classes in the __init__ module.

https://github.com/bjlittle/metOcean-mapping/blob/11c8e72dc3f2a539b2b8abb7bb5201dd7a9a5469/lib/metocean/fuseki.py#L279-322

Perhaps this function should be a class method on the Component class, perhaps even a private method, used during initialisation.

The SPARQL queries which are required for this can then also be encapsulated in the Component class.

marqh commented 10 years ago

The _retrieve_value function in the fuseki module seems somewhat out of place, now that there are classes in the init module.

https://github.com/bjlittle/metOcean-mapping/blob/11c8e72dc3f2a539b2b8abb7bb5201dd7a9a5469/lib/metocean/fuseki.py#L349-378

Perhaps this function should be a class method on the Property class, perhaps even a private method, used during initialisation.

The SPARQL queries which are required for this can then also be encapsulated in the Property class.

marqh commented 10 years ago

The structured_mapping function in the fuseki module seems somewhat out of place, now that there are classes in the init module.

https://github.com/bjlittle/metOcean-mapping/blob/11c8e72dc3f2a539b2b8abb7bb5201dd7a9a5469/lib/metocean/fuseki.py#L380-384

Perhaps this function should be a class method on the Mapping class, perhaps even a private method, used during initialisation.

marqh commented 10 years ago

The doc strings for Mapping, Component, Concept and SimpleComponent are too similar, we should have some clearer differentiation between these classes in their documentation