Skip to content

Commit

Permalink
only include 25 references, citations, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Apr 5, 2020
1 parent 22ccaad commit 212b4b6
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1040,19 +1040,19 @@ def downloads_over_time
end

def reference_ids
reference_events.pluck(:target_doi).uniq.map(&:downcase)
reference_events.pluck(:target_doi).uniq.map { |d| d.present? ? d.downcase : nil }.compact
end

def reference_count
reference_events.pluck(:target_doi).uniq.length
end

def indexed_references
Doi.query(nil, ids: reference_ids, page: { number: 1, size: 100 }).results
Doi.query(nil, ids: reference_ids, page: { number: 1, size: 25 }).results
end

def citation_ids
citation_events.pluck(:source_doi).uniq.map(&:downcase)
citation_events.pluck(:source_doi).uniq.map { |d| d.present? ? d.downcase : nil }.compact
end

# remove duplicate citing source dois
Expand All @@ -1070,55 +1070,55 @@ def citations_over_time
end

def indexed_citations
Doi.query(nil, ids: citation_ids, page: { number: 1, size: 100 }).results
Doi.query(nil, ids: citation_ids, page: { number: 1, size: 25 }).results
end

def part_ids
part_events.pluck(:target_doi).uniq.map(&:downcase)
part_events.pluck(:target_doi).uniq.map { |d| d.present? ? d.downcase : nil }.compact
end

def part_count
part_events.pluck(:target_doi).uniq.length
end

def indexed_parts
Doi.query(nil, ids: part_ids, page: { number: 1, size: 100 }).results.to_a
Doi.query(nil, ids: part_ids, page: { number: 1, size: 25 }).results.to_a
end

def part_of_ids
part_of_events.pluck(:source_doi).uniq.map(&:downcase)
part_of_events.pluck(:source_doi).uniq.map { |d| d.present? ? d.downcase : nil }.compact
end

def part_of_count
part_of_events.pluck(:source_doi).uniq.length
end

def indexed_part_of
Doi.query(nil, ids: part_of_ids, page: { number: 1, size: 100 }).results
Doi.query(nil, ids: part_of_ids, page: { number: 1, size: 25 }).results
end

def version_ids
version_events.pluck(:target_doi).uniq.map(&:downcase)
version_events.pluck(:target_doi).uniq.map { |d| d.present? ? d.downcase : nil }.compact
end

def version_count
version_events.pluck(:target_doi).uniq.length
end

def indexed_versions
Doi.query(nil, ids: version_ids, page: { number: 1, size: 100 }).results
Doi.query(nil, ids: version_ids, page: { number: 1, size: 25 }).results
end

def version_of_ids
version_of_events.pluck(:source_doi).uniq.map(&:downcase)
version_of_events.pluck(:source_doi).uniq.map { |d| d.present? ? d.downcase : nil }.compact
end

def version_of_count
version_of_events.pluck(:source_doi).uniq.length
end

def indexed_version_of
Doi.query(nil, ids: version_of_ids, page: { number: 1, size: 100 }).results
Doi.query(nil, ids: version_of_ids, page: { number: 1, size: 25 }).results
end

def xml_encoded
Expand Down

0 comments on commit 212b4b6

Please sign in to comment.