Lysferd / demand-ontology

Apache Jena & JRuby on Rails System for Electrical Demand-Response Ontologies.
MIT License
0 stars 0 forks source link

Dataset Individuals' Improvements. #6

Closed Lysferd closed 9 years ago

Lysferd commented 9 years ago

All was well until unique individuals were implemented, making the Dataset model class a true mess of methods doing similar things to each kind of individual. As a result, it is truly painful to do anything on that class, even searching for methods. A means to fix this problem is to create subclasses to Dataset, perhaps Individual, and remove from the superclass anything that can be moved to it. Individual class would be a generic class for all kinds of individuals the application needs to treat uniquely, regardless of how it is designed presently.

class Individual < Dataset
  def initialize( ontological_class )
    model.find_individual( ontclass: ontological_class ) # from superclass
  end
  # ...
end
Lysferd commented 9 years ago

Fixed on be8b50476353299bb9bf61fdab61da42e55f1139.