Skip to content

Commit fdf9eb8

Browse files
author
Gaurav SinghaRoy
committed
Merge branch 'alpha' into beta
2 parents 27994d1 + ae647d5 commit fdf9eb8

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

app/helpers/query_helper.rb

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,18 @@ def get_properties_of_class(dataset, class_uri)
9191
unless properties_json["rdfClass"].blank?
9292
unless properties_json["rdfClass"]["properties"].blank?
9393
properties_json["rdfClass"]["properties"].each do |p|
94-
if p["type"] == "data"
95-
properties[:data_type] << p
96-
elsif p["type"] == "object"
97-
properties[:object_type] << p
98-
end
94+
if p["count"] > 0
95+
if p["type"] == "data"
96+
properties[:data_type] << p
97+
elsif p["type"] == "object"
98+
properties[:object_type] << p
99+
end
100+
end
99101
end
100102
end
101103
end
104+
properties[:data_type] = properties[:data_type].sort_by{|a|a['count']}.reverse unless properties[:data_type].blank?
105+
properties[:object_type] = properties[:object_type].sort_by{|a|a['count']}.reverse unless properties[:object_type].blank?
102106
properties
103107
end
104108

0 commit comments

Comments
 (0)