ontology.rb revision 9cfb01db247ca04bb4b5b337bbd77c66b7150e53
# Ontohub Library Includes
# Ontology Model Includes
scope :search, ->(query) { where "ontologies.iri #{connection.ilike_operator} :term OR name #{connection.ilike_operator} :term", :term => "%" << query << "%" }
scope :list, includes(:logic).order('ontologies.state asc, ontologies.entities_count desc')
def to_s
name? ? name : iri
end
# title for links
def title
name? ? iri : nil
end
def symbols
entities
end
def symbols_count
entities_count
end
def self.filename_without_extension(filename)
filename.gsub(/(.+)\.[^\.]+/, "\\1")
end
end