diff --git a/app/graphql/types/audiovisual_connection_type.rb b/app/graphql/types/audiovisual_connection_type.rb index 4a2868519..aaa00accd 100644 --- a/app/graphql/types/audiovisual_connection_type.rb +++ b/app/graphql/types/audiovisual_connection_type.rb @@ -34,7 +34,9 @@ def response(**args) has_person: args[:has_person], has_funder: args[:has_funder], has_organization: args[:has_organization], - has_citations: args[:has_citations], + has_citations: args[:has_citations], + has_parts: args[:has_parts], + has_versions: args[:has_versions], has_views: args[:has_views], has_downloads: args[:has_downloads], page: { number: 1, size: 0 }) diff --git a/app/graphql/types/client_type.rb b/app/graphql/types/client_type.rb index f9a47213f..f6ef99d9c 100644 --- a/app/graphql/types/client_type.rb +++ b/app/graphql/types/client_type.rb @@ -34,6 +34,8 @@ class ClientType < BaseObject argument :has_organization, Boolean, required: false argument :has_funder, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -51,6 +53,8 @@ class ClientType < BaseObject argument :has_organization, Boolean, required: false argument :has_funder, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -68,6 +72,8 @@ class ClientType < BaseObject argument :has_organization, Boolean, required: false argument :has_funder, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -85,6 +91,8 @@ class ClientType < BaseObject argument :has_organization, Boolean, required: false argument :has_funder, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -151,6 +159,6 @@ def citation_count end def response(**args) - Doi.query(args[:query], funder_id: args[:funder_id], user_id: args[:user_id], client_id: object.uid, provider_id: args[:provider_id], affiliation_id: args[:affiliation_id], resource_type_id: args[:resource_type_id], has_person: args[:has_person], has_organization: args[:has_organization], has_funder: args[:has_funder], has_citations: args[:has_citations], has_views: args[:has_views], has_downloads: args[:has_downloads], state: "findable", page: { number: 1, size: args[:first] }) + Doi.query(args[:query], funder_id: args[:funder_id], user_id: args[:user_id], client_id: object.uid, provider_id: args[:provider_id], affiliation_id: args[:affiliation_id], resource_type_id: args[:resource_type_id], has_person: args[:has_person], has_organization: args[:has_organization], has_funder: args[:has_funder], has_citations: args[:has_citations], has_parts: args[:has_parts], has_versions: args[:has_versions], has_views: args[:has_views], has_downloads: args[:has_downloads], state: "findable", page: { number: 1, size: args[:first] }) end end diff --git a/app/graphql/types/collection_connection_type.rb b/app/graphql/types/collection_connection_type.rb index 33a2a89c7..28b4e8685 100644 --- a/app/graphql/types/collection_connection_type.rb +++ b/app/graphql/types/collection_connection_type.rb @@ -35,7 +35,9 @@ def response(**args) has_funder: args[:has_funder], has_organization: args[:has_organization], has_citations: args[:has_citations], - has_views: args[:has_views], + has_parts: args[:has_parts], + has_versions: args[:has_versions], + has_views: args[:has_views], has_downloads: args[:has_downloads], page: { number: 1, size: 0 }) end diff --git a/app/graphql/types/data_catalog_type.rb b/app/graphql/types/data_catalog_type.rb index 7ce477da6..d70637ae5 100644 --- a/app/graphql/types/data_catalog_type.rb +++ b/app/graphql/types/data_catalog_type.rb @@ -33,6 +33,8 @@ class DataCatalogType < BaseObject argument :client_id, String, required: false argument :provider_id, String, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -74,7 +76,7 @@ def software_application end def datasets(**args) - Doi.query(args[:query], re3data_id: object[:id], user_id: args[:user_id], client_id: args[:client_id], provider_id: args[:provider_id], has_citations: args[:has_citations], has_views: args[:has_views], has_downloads: args[:has_downloads], resource_type_id: "Dataset", state: "findable", page: { number: 1, size: args[:first] }).results.to_a + Doi.query(args[:query], re3data_id: object[:id], user_id: args[:user_id], client_id: args[:client_id], provider_id: args[:provider_id], has_citations: args[:has_citations], has_parts: args[:has_parts], has_versions: args[:has_versions], has_views: args[:has_views], has_downloads: args[:has_downloads], resource_type_id: "Dataset", state: "findable", page: { number: 1, size: args[:first] }).results.to_a end def view_count diff --git a/app/graphql/types/data_paper_connection_type.rb b/app/graphql/types/data_paper_connection_type.rb index 2ec580d6e..f6ab81320 100644 --- a/app/graphql/types/data_paper_connection_type.rb +++ b/app/graphql/types/data_paper_connection_type.rb @@ -34,7 +34,9 @@ def response(**args) has_person: args[:has_person], has_funder: args[:has_funder], has_organization: args[:has_organization], - has_citations: args[:has_citations], + has_citations: args[:has_citations], + has_parts: args[:has_parts], + has_versions: args[:has_versions], has_views: args[:has_views], has_downloads: args[:has_downloads], page: { number: 1, size: 0 }) diff --git a/app/graphql/types/dataset_connection_type.rb b/app/graphql/types/dataset_connection_type.rb index b63430af1..0cf75e557 100644 --- a/app/graphql/types/dataset_connection_type.rb +++ b/app/graphql/types/dataset_connection_type.rb @@ -40,7 +40,9 @@ def response(**args) has_person: args[:has_person], has_funder: args[:has_funder], has_organization: args[:has_organization], - has_citations: args[:has_citations], + has_citations: args[:has_citations], + has_parts: args[:has_parts], + has_versions: args[:has_versions], has_views: args[:has_views], has_downloads: args[:has_downloads], page: { number: 1, size: 0 }) diff --git a/app/graphql/types/doi_item.rb b/app/graphql/types/doi_item.rb index ce3505cd6..95fd92475 100644 --- a/app/graphql/types/doi_item.rb +++ b/app/graphql/types/doi_item.rb @@ -62,6 +62,8 @@ module DoiItem argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -78,6 +80,8 @@ module DoiItem argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -94,6 +98,8 @@ module DoiItem argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -110,6 +116,8 @@ module DoiItem argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -126,6 +134,8 @@ module DoiItem argument :affiliation_id, String, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -142,6 +152,8 @@ module DoiItem argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -231,7 +243,7 @@ def version_of(**args) def response(**args) return [] if args[:ids].blank? - Doi.query(args[:query], ids: args[:ids], funder_id: object[:id], user_id: args[:user_id], client_id: args[:client_id], provider_id: args[:provider_id], has_person: args[:has_person], has_funder: args[:has_funder], has_organization: args[:has_organization], has_citations: args[:has_citations], has_views: args[:has_views], has_downloads: args[:has_downloads], state: "findable", page: { number: 1, size: args[:first] }).results.to_a + Doi.query(args[:query], ids: args[:ids], funder_id: object[:id], user_id: args[:user_id], client_id: args[:client_id], provider_id: args[:provider_id], has_person: args[:has_person], has_funder: args[:has_funder], has_organization: args[:has_organization], has_citations: args[:has_citations], has_parts: args[:has_parts], has_versions: args[:has_versions], has_views: args[:has_views], has_downloads: args[:has_downloads], state: "findable", page: { number: 1, size: args[:first] }).results.to_a end def doi_link(url) diff --git a/app/graphql/types/event_connection_type.rb b/app/graphql/types/event_connection_type.rb index b42ac44a7..85e15922b 100644 --- a/app/graphql/types/event_connection_type.rb +++ b/app/graphql/types/event_connection_type.rb @@ -34,8 +34,10 @@ def response(**args) has_person: args[:has_person], has_funder: args[:has_funder], has_organization: args[:has_organization], - has_citations: args[:has_citations], - has_views: args[:has_views], + has_citations: args[:has_citations], + has_parts: args[:has_parts], + has_versions: args[:has_versions], + has_views: args[:has_views], has_downloads: args[:has_downloads], page: { number: 1, size: 0 }) end diff --git a/app/graphql/types/funder_type.rb b/app/graphql/types/funder_type.rb index ae309991d..e2d77dd9b 100644 --- a/app/graphql/types/funder_type.rb +++ b/app/graphql/types/funder_type.rb @@ -21,6 +21,8 @@ class FunderType < BaseObject argument :has_person, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -35,6 +37,8 @@ class FunderType < BaseObject argument :has_person, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -49,6 +53,8 @@ class FunderType < BaseObject argument :has_person, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -65,6 +71,8 @@ class FunderType < BaseObject argument :has_person, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -121,6 +129,6 @@ def citation_count end def response(**args) - Doi.query(args[:query], funder_id: object[:id], user_id: args[:user_id], client_id: args[:client_id], provider_id: args[:provider_id], affiliation_id: args[:affiliation_id], resource_type_id: args[:resource_type_id], has_person: args[:has_person], has_organization: args[:has_organization], has_citations: args[:has_citations], has_views: args[:has_views], has_downloads: args[:has_downloads], state: "findable", page: { number: 1, size: args[:first] }) + Doi.query(args[:query], funder_id: object[:id], user_id: args[:user_id], client_id: args[:client_id], provider_id: args[:provider_id], affiliation_id: args[:affiliation_id], resource_type_id: args[:resource_type_id], has_person: args[:has_person], has_organization: args[:has_organization], has_citations: args[:has_citations], has_parts: args[:has_parts], has_versions: args[:has_versions], has_views: args[:has_views], has_downloads: args[:has_downloads], state: "findable", page: { number: 1, size: args[:first] }) end end diff --git a/app/graphql/types/image_connection_type.rb b/app/graphql/types/image_connection_type.rb index 73585c180..dc86a8518 100644 --- a/app/graphql/types/image_connection_type.rb +++ b/app/graphql/types/image_connection_type.rb @@ -34,7 +34,9 @@ def response(**args) has_person: args[:has_person], has_funder: args[:has_funder], has_organization: args[:has_organization], - has_citations: args[:has_citations], + has_citations: args[:has_citations], + has_parts: args[:has_parts], + has_versions: args[:has_versions], has_views: args[:has_views], has_downloads: args[:has_downloads], page: { number: 1, size: 0 }) diff --git a/app/graphql/types/interactive_resource_connection_type.rb b/app/graphql/types/interactive_resource_connection_type.rb index dc6b038b6..25d56638f 100644 --- a/app/graphql/types/interactive_resource_connection_type.rb +++ b/app/graphql/types/interactive_resource_connection_type.rb @@ -34,7 +34,9 @@ def response(**args) has_person: args[:has_person], has_funder: args[:has_funder], has_organization: args[:has_organization], - has_citations: args[:has_citations], + has_citations: args[:has_citations], + has_parts: args[:has_parts], + has_versions: args[:has_versions], has_views: args[:has_views], has_downloads: args[:has_downloads], page: { number: 1, size: 0 }) diff --git a/app/graphql/types/model_connection_type.rb b/app/graphql/types/model_connection_type.rb index edaaefe72..b3256c2f5 100644 --- a/app/graphql/types/model_connection_type.rb +++ b/app/graphql/types/model_connection_type.rb @@ -34,7 +34,9 @@ def response(**args) has_person: args[:has_person], has_funder: args[:has_funder], has_organization: args[:has_organization], - has_citations: args[:has_citations], + has_citations: args[:has_citations], + has_parts: args[:has_parts], + has_versions: args[:has_versions], has_views: args[:has_views], has_downloads: args[:has_downloads], page: { number: 1, size: 0 }) diff --git a/app/graphql/types/organization_type.rb b/app/graphql/types/organization_type.rb index 0bc53995c..388a2023a 100644 --- a/app/graphql/types/organization_type.rb +++ b/app/graphql/types/organization_type.rb @@ -22,6 +22,8 @@ class OrganizationType < BaseObject argument :client_id, String, required: false argument :provider_id, String, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -35,6 +37,8 @@ class OrganizationType < BaseObject argument :client_id, String, required: false argument :provider_id, String, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -48,6 +52,8 @@ class OrganizationType < BaseObject argument :client_id, String, required: false argument :provider_id, String, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -61,6 +67,8 @@ class OrganizationType < BaseObject argument :client_id, String, required: false argument :provider_id, String, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -129,6 +137,6 @@ def citation_count end def response(**args) - Doi.query(args[:query], affiliation_id: object[:id], user_id: args[:user_id], client_id: args[:client_id], provider_id: args[:provider_id], funder_id: args[:funder_id], resource_type_id: args[:resource_type_id], has_person: args[:has_person], has_funder: args[:has_funder], has_citations: args[:has_citations], has_views: args[:has_views], has_downloads: args[:has_downloads], state: "findable", page: { number: 1, size: args[:first] }) + Doi.query(args[:query], affiliation_id: object[:id], user_id: args[:user_id], client_id: args[:client_id], provider_id: args[:provider_id], funder_id: args[:funder_id], resource_type_id: args[:resource_type_id], has_person: args[:has_person], has_funder: args[:has_funder], has_citations: args[:has_citations], has_parts: args[:has_parts], has_versions: args[:has_versions], has_views: args[:has_views], has_downloads: args[:has_downloads], state: "findable", page: { number: 1, size: args[:first] }) end end diff --git a/app/graphql/types/other_connection_type.rb b/app/graphql/types/other_connection_type.rb index 16d47a744..3f9f77d40 100644 --- a/app/graphql/types/other_connection_type.rb +++ b/app/graphql/types/other_connection_type.rb @@ -34,7 +34,9 @@ def response(**args) has_person: args[:has_person], has_funder: args[:has_funder], has_organization: args[:has_organization], - has_citations: args[:has_citations], + has_citations: args[:has_citations], + has_parts: args[:has_parts], + has_versions: args[:has_versions], has_views: args[:has_views], has_downloads: args[:has_downloads], page: { number: 1, size: 0 }) diff --git a/app/graphql/types/person_type.rb b/app/graphql/types/person_type.rb index 5f663067a..2d19ddf7c 100644 --- a/app/graphql/types/person_type.rb +++ b/app/graphql/types/person_type.rb @@ -20,6 +20,8 @@ class PersonType < BaseObject argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -33,6 +35,8 @@ class PersonType < BaseObject argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -46,6 +50,8 @@ class PersonType < BaseObject argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -60,6 +66,8 @@ class PersonType < BaseObject argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -111,6 +119,6 @@ def citation_count end def response(**args) - Doi.query(args[:query], user_id: object[:id], client_id: args[:client_id], provider_id: args[:provider_id], affiliation_id: args[:affiliation_id], resource_type_id: args[:resource_type_id], has_funder: args[:has_funder], has_affiliation: args[:has_affiliation], has_citations: args[:has_citations], has_views: args[:has_views], has_downloads: args[:has_downloads], state: "findable", page: { number: 1, size: args[:first] }) + Doi.query(args[:query], user_id: object[:id], client_id: args[:client_id], provider_id: args[:provider_id], affiliation_id: args[:affiliation_id], resource_type_id: args[:resource_type_id], has_funder: args[:has_funder], has_affiliation: args[:has_affiliation], has_citations: args[:has_citations], has_parts: args[:has_parts], has_versions: args[:has_versions], has_views: args[:has_views], has_downloads: args[:has_downloads], state: "findable", page: { number: 1, size: args[:first] }) end end diff --git a/app/graphql/types/physical_object_connection_type.rb b/app/graphql/types/physical_object_connection_type.rb index 5c0e9a620..fe6635943 100644 --- a/app/graphql/types/physical_object_connection_type.rb +++ b/app/graphql/types/physical_object_connection_type.rb @@ -34,7 +34,9 @@ def response(**args) has_person: args[:has_person], has_funder: args[:has_funder], has_organization: args[:has_organization], - has_citations: args[:has_citations], + has_citations: args[:has_citations], + has_parts: args[:has_parts], + has_versions: args[:has_versions], has_views: args[:has_views], has_downloads: args[:has_downloads], page: { number: 1, size: 0 }) diff --git a/app/graphql/types/provider_type.rb b/app/graphql/types/provider_type.rb index 4520ca33a..314ecf07b 100644 --- a/app/graphql/types/provider_type.rb +++ b/app/graphql/types/provider_type.rb @@ -33,6 +33,8 @@ class ProviderType < BaseObject argument :has_organization, Boolean, required: false argument :has_funder, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -50,6 +52,8 @@ class ProviderType < BaseObject argument :has_organization, Boolean, required: false argument :has_funder, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -67,6 +71,8 @@ class ProviderType < BaseObject argument :has_organization, Boolean, required: false argument :has_funder, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -84,6 +90,8 @@ class ProviderType < BaseObject argument :has_organization, Boolean, required: false argument :has_funder, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -169,6 +177,6 @@ def citation_count end def response(**args) - Doi.query(args[:query], user_id: args[:user_id], client_id: args[:client_id], provider_id: object.uid, funder_id: args[:funder_id], affiliation_id: args[:affiliation_id], resource_type_id: args[:resource_type_id], has_person: args[:has_person], has_funder: args[:has_funder], has_affiliation: args[:has_affiliation], has_citations: args[:has_citations], has_views: args[:has_views], has_downloads: args[:has_downloads], state: "findable", page: { number: 1, size: args[:first] }) + Doi.query(args[:query], user_id: args[:user_id], client_id: args[:client_id], provider_id: object.uid, funder_id: args[:funder_id], affiliation_id: args[:affiliation_id], resource_type_id: args[:resource_type_id], has_person: args[:has_person], has_funder: args[:has_funder], has_affiliation: args[:has_affiliation], has_citations: args[:has_citations], has_parts: args[:has_parts], has_versions: args[:has_versions], has_views: args[:has_views], has_downloads: args[:has_downloads], state: "findable", page: { number: 1, size: args[:first] }) end end diff --git a/app/graphql/types/publication_connection_type.rb b/app/graphql/types/publication_connection_type.rb index 41cbe85a3..93b42ffe4 100644 --- a/app/graphql/types/publication_connection_type.rb +++ b/app/graphql/types/publication_connection_type.rb @@ -40,7 +40,9 @@ def response(**args) has_person: args[:has_person], has_funder: args[:has_funder], has_organization: args[:has_organization], - has_citations: args[:has_citations], + has_citations: args[:has_citations], + has_parts: args[:has_parts], + has_versions: args[:has_versions], has_views: args[:has_views], has_downloads: args[:has_downloads], page: { number: 1, size: 0 }) diff --git a/app/graphql/types/query_type.rb b/app/graphql/types/query_type.rb index b94bac891..1d0c1fe90 100644 --- a/app/graphql/types/query_type.rb +++ b/app/graphql/types/query_type.rb @@ -146,6 +146,8 @@ def people(**args) argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -172,6 +174,8 @@ def work(id:) argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -199,6 +203,8 @@ def dataset(id:) argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -226,6 +232,8 @@ def publication(id:) argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -253,6 +261,8 @@ def audiovisual(id:) argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -280,6 +290,8 @@ def collection(id:) argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -307,6 +319,8 @@ def data_paper(id:) argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -334,6 +348,8 @@ def event(id:) argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -361,6 +377,8 @@ def image(id:) argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -388,6 +406,8 @@ def interactive_resource(id:) argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -415,6 +435,8 @@ def model(id:) argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -442,6 +464,8 @@ def physical_object(id:) argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -469,6 +493,8 @@ def service(id:) argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -496,6 +522,8 @@ def software(id:) argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -523,6 +551,8 @@ def sound(id:) argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -550,6 +580,8 @@ def workflow(id:) argument :has_funder, Boolean, required: false argument :has_organization, Boolean, required: false argument :has_citations, Int, required: false + argument :has_parts, Int, required: false + argument :has_versions, Int, required: false argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :first, Int, required: false, default_value: 25 @@ -588,7 +620,7 @@ def usage_report(id:) end def response(**args) - @response ||= Doi.query(args[:query], ids: args[:ids], user_id: args[:user_id], client_id: args[:client_id], provider_id: args[:provider_id], resource_type_id: args[:resource_type_id], has_person: args[:has_person], has_funder: args[:has_funder], has_organization: args[:has_organization], has_citations: args[:has_citations], has_views: args[:has_views], has_downloads: args[:has_downloads], state: "findable", page: { number: 1, size: args[:first] }).results.to_a + @response ||= Doi.query(args[:query], ids: args[:ids], user_id: args[:user_id], client_id: args[:client_id], provider_id: args[:provider_id], resource_type_id: args[:resource_type_id], has_person: args[:has_person], has_funder: args[:has_funder], has_organization: args[:has_organization], has_citations: args[:has_citations], has_parts: args[:has_parts], has_versions: args[:has_versions], has_views: args[:has_views], has_downloads: args[:has_downloads], state: "findable", page: { number: 1, size: args[:first] }).results.to_a end def set_doi(id) diff --git a/app/graphql/types/service_connection_type.rb b/app/graphql/types/service_connection_type.rb index c55f761e1..d881048b0 100644 --- a/app/graphql/types/service_connection_type.rb +++ b/app/graphql/types/service_connection_type.rb @@ -21,6 +21,6 @@ def years end def response(**args) - @response ||= Doi.query(args[:query], user_id: args[:user_id], client_id: args[:client_id], provider_id: args[:provider_id], year: args[:year], resource_type_id: "Service", has_citations: args[:has_citations], has_views: args[:has_views], has_downloads: args[:has_downloads], page: { number: 1, size: 0 }) + @response ||= Doi.query(args[:query], user_id: args[:user_id], client_id: args[:client_id], provider_id: args[:provider_id], year: args[:year], resource_type_id: "Service", has_citations: args[:has_citations], has_parts: args[:has_parts], has_versions: args[:has_versions], has_views: args[:has_views], has_downloads: args[:has_downloads], page: { number: 1, size: 0 }) end end diff --git a/app/graphql/types/software_connection_type.rb b/app/graphql/types/software_connection_type.rb index 5ea745a28..57ab0e6c0 100644 --- a/app/graphql/types/software_connection_type.rb +++ b/app/graphql/types/software_connection_type.rb @@ -43,7 +43,9 @@ def response(**args) has_person: args[:has_person], has_funder: args[:has_funder], has_organization: args[:has_organization], - has_citations: args[:has_citations], + has_citations: args[:has_citations], + has_parts: args[:has_parts], + has_versions: args[:has_versions], has_views: args[:has_views], has_downloads: args[:has_downloads], page: { number: 1, size: 0 }) diff --git a/app/graphql/types/sound_connection_type.rb b/app/graphql/types/sound_connection_type.rb index fd5b32bba..74c249b94 100644 --- a/app/graphql/types/sound_connection_type.rb +++ b/app/graphql/types/sound_connection_type.rb @@ -34,7 +34,9 @@ def response(**args) has_person: args[:has_person], has_funder: args[:has_funder], has_organization: args[:has_organization], - has_citations: args[:has_citations], + has_citations: args[:has_citations], + has_parts: args[:has_parts], + has_versions: args[:has_versions], has_views: args[:has_views], has_downloads: args[:has_downloads], page: { number: 1, size: 0 }) diff --git a/app/graphql/types/work_connection_type.rb b/app/graphql/types/work_connection_type.rb index 70ee61405..b1db041ff 100644 --- a/app/graphql/types/work_connection_type.rb +++ b/app/graphql/types/work_connection_type.rb @@ -42,7 +42,9 @@ def response(**args) has_person: args[:has_person], has_funder: args[:has_funder], has_organization: args[:has_organization], - has_citations: args[:has_citations], + has_citations: args[:has_citations], + has_parts: args[:has_parts], + has_versions: args[:has_versions], has_views: args[:has_views], has_downloads: args[:has_downloads], page: { number: 1, size: 0 }) diff --git a/app/graphql/types/workflow_connection_type.rb b/app/graphql/types/workflow_connection_type.rb index 16c883de0..491dd0be0 100644 --- a/app/graphql/types/workflow_connection_type.rb +++ b/app/graphql/types/workflow_connection_type.rb @@ -34,7 +34,9 @@ def response(**args) has_person: args[:has_person], has_funder: args[:has_funder], has_organization: args[:has_organization], - has_citations: args[:has_citations], + has_citations: args[:has_citations], + has_parts: args[:has_parts], + has_versions: args[:has_versions], has_views: args[:has_views], has_downloads: args[:has_downloads], page: { number: 1, size: 0 }) diff --git a/app/models/doi.rb b/app/models/doi.rb index 5c483de89..b6d59692e 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -717,9 +717,9 @@ def self.query(query, options={}) must << { range: { reference_count: { "gte": options[:has_references].to_i } } } if options[:has_references].present? must << { range: { citation_count: { "gte": options[:has_citations].to_i } } } if options[:has_citations].present? must << { range: { part_count: { "gte": options[:has_parts].to_i } } } if options[:has_parts].present? - must << { range: { part_of_count: { "gte": options[:has_part_of_count].to_i } } } if options[:has_part_of].present? - must << { range: { version_count: { "gte": options[:has_version_count].to_i } } } if options[:has_versions].present? - must << { range: { version_of_count: { "gte": options[:has_version_of_count].to_i } } } if options[:has_version_of].present? + must << { range: { part_of_count: { "gte": options[:has_part_of].to_i } } } if options[:has_part_of].present? + must << { range: { version_count: { "gte": options[:has_versions].to_i } } } if options[:has_versions].present? + must << { range: { version_of_count: { "gte": options[:has_version_of].to_i } } } if options[:has_version_of].present? must << { range: { view_count: { "gte": options[:has_views].to_i } } } if options[:has_views].present? must << { range: { download_count: { "gte": options[:has_downloads].to_i } } } if options[:has_downloads].present? must << { term: { "landing_page.status": options[:link_check_status] } } if options[:link_check_status].present?