diff --git a/aspnetcore/src/DatabaseContext/ApiDbContext.cs b/aspnetcore/src/DatabaseContext/ApiDbContext.cs index 46396f4..f44505e 100644 --- a/aspnetcore/src/DatabaseContext/ApiDbContext.cs +++ b/aspnetcore/src/DatabaseContext/ApiDbContext.cs @@ -148,6 +148,8 @@ public ApiDbContext(DbContextOptions options) public virtual DbSet FactKeywords { get; set; } + public virtual DbSet FactReferencedata { get; set; } + public virtual DbSet FactRelations { get; set; } public virtual DbSet FactUpkeeps { get; set; } @@ -722,6 +724,9 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasDefaultValue(-1) .HasColumnName("dim_publication_id"); entity.Property(e => e.DimRegisteredDataSourceId).HasColumnName("dim_registered_data_source_id"); + entity.Property(e => e.DimResearchDataCatalogId) + .HasDefaultValue(-1) + .HasColumnName("dim_research_data_catalog_id"); entity.Property(e => e.DimResearchDatasetId) .HasDefaultValue(-1) .HasColumnName("dim_research_dataset_id"); @@ -755,6 +760,11 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FKdim_descri977501"); + entity.HasOne(d => d.DimResearchDataCatalog).WithMany(p => p.DimDescriptiveItems) + .HasForeignKey(d => d.DimResearchDataCatalogId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("descriptive_datacatalog"); + entity.HasOne(d => d.DimResearchDataset).WithMany(p => p.DimDescriptiveItems) .HasForeignKey(d => d.DimResearchDatasetId) .OnDelete(DeleteBehavior.ClientSetNull) @@ -1301,6 +1311,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasColumnType("datetime") .HasColumnName("created"); entity.Property(e => e.DimIdentifierlessDataId).HasColumnName("dim_identifierless_data_id"); + entity.Property(e => e.DimOrganizationId).HasColumnName("dim_organization_id"); entity.Property(e => e.Modified) .HasColumnType("datetime") .HasColumnName("modified"); @@ -1326,10 +1337,18 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.ValueSv) .HasMaxLength(4000) .HasColumnName("value_sv"); + entity.Property(e => e.ValueUnd) + .HasMaxLength(4000) + .HasColumnName("value_und"); entity.HasOne(d => d.DimIdentifierlessData).WithMany(p => p.InverseDimIdentifierlessData) .HasForeignKey(d => d.DimIdentifierlessDataId) .HasConstraintName("parent_data"); + + entity.HasOne(d => d.DimOrganization).WithMany(p => p.DimIdentifierlessData) + .HasForeignKey(d => d.DimOrganizationId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("identifierlessIsPartOfOrganization"); }); modelBuilder.Entity(entity => @@ -3055,60 +3074,27 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.DatasetModified) .HasColumnType("datetime") .HasColumnName("dataset_modified"); - entity.Property(e => e.DescriptionEn).HasColumnName("description_en"); - entity.Property(e => e.DescriptionFi).HasColumnName("description_fi"); - entity.Property(e => e.DescriptionSv).HasColumnName("description_sv"); - entity.Property(e => e.DescriptionUnd).HasColumnName("description_und"); entity.Property(e => e.DimReferencedataAvailability).HasColumnName("dim_referencedata_availability"); - entity.Property(e => e.DimReferencedataLicense).HasColumnName("dim_referencedata_license"); entity.Property(e => e.DimRegisteredDataSourceId).HasColumnName("dim_registered_data_source_id"); entity.Property(e => e.DimResearchDataCatalogId).HasColumnName("dim_research_data_catalog_id"); - entity.Property(e => e.GeographicCoverage) - .HasMaxLength(4000) - .HasColumnName("geographic_coverage"); - entity.Property(e => e.InternationalCollaboration).HasColumnName("international_collaboration"); entity.Property(e => e.LocalIdentifier) .HasMaxLength(255) .HasColumnName("local_identifier"); entity.Property(e => e.Modified) .HasColumnType("datetime") .HasColumnName("modified"); - entity.Property(e => e.NameEn) - .HasMaxLength(4000) - .HasColumnName("name_en"); - entity.Property(e => e.NameFi) - .HasMaxLength(4000) - .HasColumnName("name_fi"); - entity.Property(e => e.NameSv) - .HasMaxLength(4000) - .HasColumnName("name_sv"); - entity.Property(e => e.NameUnd) - .HasMaxLength(4000) - .HasColumnName("name_und"); entity.Property(e => e.SourceDescription) .HasMaxLength(255) .HasColumnName("source_description"); entity.Property(e => e.SourceId) .HasMaxLength(255) .HasColumnName("source_id"); - entity.Property(e => e.TemporalCoverageEnd) - .HasColumnType("datetime") - .HasColumnName("temporal_coverage_end"); - entity.Property(e => e.TemporalCoverageStart) - .HasColumnType("datetime") - .HasColumnName("temporal_coverage_start"); - entity.Property(e => e.VersionInfo) - .HasMaxLength(255) - .HasColumnName("version_info"); + entity.Property(e => e.VersionInfo).HasColumnName("version_info"); - entity.HasOne(d => d.DimReferencedataAvailabilityNavigation).WithMany(p => p.DimResearchDatasetDimReferencedataAvailabilityNavigations) + entity.HasOne(d => d.DimReferencedataAvailabilityNavigation).WithMany(p => p.DimResearchDatasets) .HasForeignKey(d => d.DimReferencedataAvailability) .HasConstraintName("Availibiity classes"); - entity.HasOne(d => d.DimReferencedataLicenseNavigation).WithMany(p => p.DimResearchDatasetDimReferencedataLicenseNavigations) - .HasForeignKey(d => d.DimReferencedataLicense) - .HasConstraintName("License"); - entity.HasOne(d => d.DimRegisteredDataSource).WithMany(p => p.DimResearchDatasets) .HasForeignKey(d => d.DimRegisteredDataSourceId) .OnDelete(DeleteBehavior.ClientSetNull) @@ -3117,45 +3103,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.HasOne(d => d.DimResearchDataCatalog).WithMany(p => p.DimResearchDatasets) .HasForeignKey(d => d.DimResearchDataCatalogId) .HasConstraintName("FKdim_resear753411"); - - entity.HasMany(d => d.DimKeywords).WithMany(p => p.DimResearchDatasets) - .UsingEntity>( - "BrResearchDatasetDimKeyword", - r => r.HasOne().WithMany() - .HasForeignKey("DimKeywordId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FKbr_researc961356"), - l => l.HasOne().WithMany() - .HasForeignKey("DimResearchDatasetId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("dataset-keywords"), - j => - { - j.HasKey("DimResearchDatasetId", "DimKeywordId").HasName("PK__br_resea__4D226DF29D73B9C7"); - j.ToTable("br_research_dataset_dim_keyword"); - j.HasIndex(new[] { "DimKeywordId" }, "idx_dim_keyword_id"); - j.IndexerProperty("DimResearchDatasetId").HasColumnName("dim_research_dataset_id"); - j.IndexerProperty("DimKeywordId").HasColumnName("dim_keyword_id"); - }); - - entity.HasMany(d => d.DimReferencedata).WithMany(p => p.DimResearchDatasets) - .UsingEntity>( - "BrLanguageCodesForDataset", - r => r.HasOne().WithMany() - .HasForeignKey("DimReferencedataId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FKbr_languag480770"), - l => l.HasOne().WithMany() - .HasForeignKey("DimResearchDatasetId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FKbr_languag34243"), - j => - { - j.HasKey("DimResearchDatasetId", "DimReferencedataId").HasName("PK__br_langu__576647BF72E3964D"); - j.ToTable("br_language_codes_for_datasets"); - j.IndexerProperty("DimResearchDatasetId").HasColumnName("dim_research_dataset_id"); - j.IndexerProperty("DimReferencedataId").HasColumnName("dim_referencedata_id"); - }); }); modelBuilder.Entity(entity => @@ -4203,15 +4150,12 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.ToTable("fact_keywords"); - entity.Property(e => e.DimKeywordId) - .HasDefaultValueSql("('-1')") - .HasColumnName("dim_keyword_id"); - entity.Property(e => e.DimResearchProjectId) - .HasDefaultValueSql("('-1')") - .HasColumnName("dim_research_project_id"); + entity.Property(e => e.DimKeywordId).HasColumnName("dim_keyword_id"); + entity.Property(e => e.DimResearchProjectId).HasColumnName("dim_research_project_id"); entity.Property(e => e.Created) .HasColumnType("datetime") .HasColumnName("created"); + entity.Property(e => e.DimResearchDatasetId).HasColumnName("dim_research_dataset_id"); entity.Property(e => e.Modified) .HasColumnType("datetime") .HasColumnName("modified"); @@ -4221,6 +4165,83 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.SourceId) .HasMaxLength(255) .HasColumnName("source_id"); + + entity.HasOne(d => d.DimKeyword).WithMany(p => p.FactKeywords) + .HasForeignKey(d => d.DimKeywordId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FKfact_keywo738006"); + + entity.HasOne(d => d.DimResearchDataset).WithMany(p => p.FactKeywords) + .HasForeignKey(d => d.DimResearchDatasetId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("dataset-keywords"); + + entity.HasOne(d => d.DimResearchProject).WithMany(p => p.FactKeywords) + .HasForeignKey(d => d.DimResearchProjectId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FKfact_keywo171431"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.DimReferencedataId, e.DimResearchDatasetId, e.DimInfrastructureId, e.DimPublicationId, e.DimResearchActivityId, e.DimFundingDecisionId, e.DimCallProgrammeId }).HasName("PK__fact_ref__302C51990AF30AC0"); + + entity.ToTable("fact_referencedata"); + + entity.Property(e => e.DimReferencedataId).HasColumnName("dim_referencedata_id"); + entity.Property(e => e.DimResearchDatasetId).HasColumnName("dim_research_dataset_id"); + entity.Property(e => e.DimInfrastructureId).HasColumnName("dim_infrastructure_id"); + entity.Property(e => e.DimPublicationId).HasColumnName("dim_publication_id"); + entity.Property(e => e.DimResearchActivityId).HasColumnName("dim_research_activity_id"); + entity.Property(e => e.DimFundingDecisionId).HasColumnName("dim_funding_decision_id"); + entity.Property(e => e.DimCallProgrammeId).HasColumnName("dim_call_programme_id"); + entity.Property(e => e.Created) + .HasColumnType("datetime") + .HasColumnName("created"); + entity.Property(e => e.Modified) + .HasColumnType("datetime") + .HasColumnName("modified"); + entity.Property(e => e.SourceDescription) + .HasMaxLength(255) + .HasColumnName("source_description"); + entity.Property(e => e.SourceId) + .HasMaxLength(255) + .HasColumnName("source_id"); + + entity.HasOne(d => d.DimCallProgramme).WithMany(p => p.FactReferencedata) + .HasForeignKey(d => d.DimCallProgrammeId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("call_programme_referencedata"); + + entity.HasOne(d => d.DimFundingDecision).WithMany(p => p.FactReferencedata) + .HasForeignKey(d => d.DimFundingDecisionId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("funding_decision_referencedata"); + + entity.HasOne(d => d.DimInfrastructure).WithMany(p => p.FactReferencedata) + .HasForeignKey(d => d.DimInfrastructureId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("infrastructure_referencedata"); + + entity.HasOne(d => d.DimPublication).WithMany(p => p.FactReferencedata) + .HasForeignKey(d => d.DimPublicationId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("publication_referencedata"); + + entity.HasOne(d => d.DimReferencedata).WithMany(p => p.FactReferencedata) + .HasForeignKey(d => d.DimReferencedataId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FKfact_refer715553"); + + entity.HasOne(d => d.DimResearchActivity).WithMany(p => p.FactReferencedata) + .HasForeignKey(d => d.DimResearchActivityId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("research_activity_referencedata"); + + entity.HasOne(d => d.DimResearchDataset).WithMany(p => p.FactReferencedata) + .HasForeignKey(d => d.DimResearchDatasetId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("dataset_referencedata"); }); modelBuilder.Entity(entity => diff --git a/aspnetcore/src/DatabaseContext/Entities/DimCallProgramme.cs b/aspnetcore/src/DatabaseContext/Entities/DimCallProgramme.cs index 1d6bd2f..8c01346 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimCallProgramme.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimCallProgramme.cs @@ -83,6 +83,8 @@ public partial class DimCallProgramme public virtual ICollection DimWebLinks { get; set; } = new List(); + public virtual ICollection FactReferencedata { get; set; } = new List(); + public virtual ICollection InverseDimCallProgrammeNavigation { get; set; } = new List(); public virtual DimReferencedatum? TypeOfFundingNavigation { get; set; } diff --git a/aspnetcore/src/DatabaseContext/Entities/DimDescriptiveItem.cs b/aspnetcore/src/DatabaseContext/Entities/DimDescriptiveItem.cs index 1630c60..1d5aa51 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimDescriptiveItem.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimDescriptiveItem.cs @@ -74,12 +74,16 @@ public partial class DimDescriptiveItem public int DimResearchDatasetId { get; set; } + public int DimResearchDataCatalogId { get; set; } + public virtual DimDate? DimEndDateNavigation { get; set; } public virtual DimPublication DimPublication { get; set; } = null!; public virtual DimRegisteredDataSource DimRegisteredDataSource { get; set; } = null!; + public virtual DimResearchDataCatalog DimResearchDataCatalog { get; set; } = null!; + public virtual DimResearchDataset DimResearchDataset { get; set; } = null!; public virtual DimResearchProject DimResearchProject { get; set; } = null!; diff --git a/aspnetcore/src/DatabaseContext/Entities/DimFundingDecision.cs b/aspnetcore/src/DatabaseContext/Entities/DimFundingDecision.cs index 443ce2e..5478d9f 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimFundingDecision.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimFundingDecision.cs @@ -109,6 +109,8 @@ public partial class DimFundingDecision public virtual ICollection FactFieldValues { get; set; } = new List(); + public virtual ICollection FactReferencedata { get; set; } = new List(); + public virtual ICollection InverseDimFundingDecisionIdParentDecisionNavigation { get; set; } = new List(); public virtual ICollection DimFundingDecisionFroms { get; set; } = new List(); diff --git a/aspnetcore/src/DatabaseContext/Entities/DimIdentifierlessDatum.cs b/aspnetcore/src/DatabaseContext/Entities/DimIdentifierlessDatum.cs index 454bcaf..670691f 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimIdentifierlessDatum.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimIdentifierlessDatum.cs @@ -27,8 +27,14 @@ public partial class DimIdentifierlessDatum public string? UnlinkedIdentifier { get; set; } + public int DimOrganizationId { get; set; } + + public string? ValueUnd { get; set; } + public virtual DimIdentifierlessDatum? DimIdentifierlessData { get; set; } + public virtual DimOrganization DimOrganization { get; set; } = null!; + public virtual ICollection FactContributions { get; set; } = new List(); public virtual ICollection FactFieldValues { get; set; } = new List(); diff --git a/aspnetcore/src/DatabaseContext/Entities/DimInfrastructure.cs b/aspnetcore/src/DatabaseContext/Entities/DimInfrastructure.cs index 36d753d..d7b19e1 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimInfrastructure.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimInfrastructure.cs @@ -53,6 +53,8 @@ public partial class DimInfrastructure public virtual ICollection FactInfraKeywords { get; set; } = new List(); + public virtual ICollection FactReferencedata { get; set; } = new List(); + public virtual ICollection FactRelationFromInfrastructures { get; set; } = new List(); public virtual ICollection FactRelationToInfrastructures { get; set; } = new List(); diff --git a/aspnetcore/src/DatabaseContext/Entities/DimKeyword.cs b/aspnetcore/src/DatabaseContext/Entities/DimKeyword.cs index 59bfe11..814c200 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimKeyword.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimKeyword.cs @@ -45,6 +45,8 @@ public partial class DimKeyword public virtual ICollection FactInfraKeywords { get; set; } = new List(); + public virtual ICollection FactKeywords { get; set; } = new List(); + public virtual ICollection InverseDimKeywordCloseMatchNavigation { get; set; } = new List(); public virtual ICollection InverseDimKeywordLanguageVariantNavigation { get; set; } = new List(); @@ -54,6 +56,4 @@ public partial class DimKeyword public virtual ICollection DimFundingDecisions { get; set; } = new List(); public virtual ICollection DimPublications { get; set; } = new List(); - - public virtual ICollection DimResearchDatasets { get; set; } = new List(); } diff --git a/aspnetcore/src/DatabaseContext/Entities/DimOrganization.cs b/aspnetcore/src/DatabaseContext/Entities/DimOrganization.cs index a474541..7d5bb57 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimOrganization.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimOrganization.cs @@ -73,6 +73,8 @@ public partial class DimOrganization public virtual ICollection DimFundingDecisions { get; set; } = new List(); + public virtual ICollection DimIdentifierlessData { get; set; } = new List(); + public virtual DimOrganization? DimOrganizationBroaderNavigation { get; set; } public virtual ICollection DimPids { get; set; } = new List(); diff --git a/aspnetcore/src/DatabaseContext/Entities/DimPublication.cs b/aspnetcore/src/DatabaseContext/Entities/DimPublication.cs index 16a151e..5b31d38 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimPublication.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimPublication.cs @@ -127,6 +127,8 @@ public partial class DimPublication public virtual ICollection FactFieldValues { get; set; } = new List(); + public virtual ICollection FactReferencedata { get; set; } = new List(); + public virtual ICollection FactRelationFromPublications { get; set; } = new List(); public virtual ICollection FactRelationToPublications { get; set; } = new List(); diff --git a/aspnetcore/src/DatabaseContext/Entities/DimReferencedatum.cs b/aspnetcore/src/DatabaseContext/Entities/DimReferencedatum.cs index 49d4fb2..b4d8dc4 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimReferencedatum.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimReferencedatum.cs @@ -97,9 +97,7 @@ public partial class DimReferencedatum public virtual DimReferencedatum DimReferencedata { get; set; } = null!; - public virtual ICollection DimResearchDatasetDimReferencedataAvailabilityNavigations { get; set; } = new List(); - - public virtual ICollection DimResearchDatasetDimReferencedataLicenseNavigations { get; set; } = new List(); + public virtual ICollection DimResearchDatasets { get; set; } = new List(); public virtual ICollection DimUserChoices { get; set; } = new List(); @@ -111,6 +109,8 @@ public partial class DimReferencedatum public virtual ICollection FactFieldValueDimReferencedataFieldOfSciences { get; set; } = new List(); + public virtual ICollection FactReferencedata { get; set; } = new List(); + public virtual ICollection FactRelations { get; set; } = new List(); public virtual ICollection InverseDimReferencedata { get; set; } = new List(); @@ -120,6 +120,4 @@ public partial class DimReferencedatum public virtual ICollection DimPublications { get; set; } = new List(); public virtual ICollection DimPublicationsNavigation { get; set; } = new List(); - - public virtual ICollection DimResearchDatasets { get; set; } = new List(); } diff --git a/aspnetcore/src/DatabaseContext/Entities/DimResearchActivity.cs b/aspnetcore/src/DatabaseContext/Entities/DimResearchActivity.cs index 0e0731f..1e540c6 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimResearchActivity.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimResearchActivity.cs @@ -72,4 +72,6 @@ public partial class DimResearchActivity public virtual ICollection FactContributions { get; set; } = new List(); public virtual ICollection FactFieldValues { get; set; } = new List(); + + public virtual ICollection FactReferencedata { get; set; } = new List(); } diff --git a/aspnetcore/src/DatabaseContext/Entities/DimResearchDataCatalog.cs b/aspnetcore/src/DatabaseContext/Entities/DimResearchDataCatalog.cs index e57a122..d60db77 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimResearchDataCatalog.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimResearchDataCatalog.cs @@ -27,6 +27,8 @@ public partial class DimResearchDataCatalog public DateTime? Modified { get; set; } + public virtual ICollection DimDescriptiveItems { get; set; } = new List(); + public virtual ICollection DimPids { get; set; } = new List(); public virtual ICollection DimResearchDatasets { get; set; } = new List(); diff --git a/aspnetcore/src/DatabaseContext/Entities/DimResearchDataset.cs b/aspnetcore/src/DatabaseContext/Entities/DimResearchDataset.cs index 0d6c84f..f6393e1 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimResearchDataset.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimResearchDataset.cs @@ -9,36 +9,14 @@ public partial class DimResearchDataset public int? DimResearchDataCatalogId { get; set; } - public int? DimReferencedataLicense { get; set; } - public int? DimReferencedataAvailability { get; set; } public string? LocalIdentifier { get; set; } - public string? NameFi { get; set; } - - public string? NameSv { get; set; } - - public string? NameEn { get; set; } - - public string? DescriptionFi { get; set; } - - public string? DescriptionSv { get; set; } - - public string? DescriptionEn { get; set; } - - public bool? InternationalCollaboration { get; set; } - public DateTime? DatasetCreated { get; set; } public DateTime? DatasetModified { get; set; } - public DateTime? TemporalCoverageStart { get; set; } - - public DateTime? TemporalCoverageEnd { get; set; } - - public string? GeographicCoverage { get; set; } - public string SourceId { get; set; } = null!; public string? SourceDescription { get; set; } @@ -47,13 +25,9 @@ public partial class DimResearchDataset public DateTime? Modified { get; set; } - public string? NameUnd { get; set; } - - public string? DescriptionUnd { get; set; } - public int DimRegisteredDataSourceId { get; set; } - public string? VersionInfo { get; set; } + public int VersionInfo { get; set; } public virtual ICollection BrDatasetDatasetRelationshipDimResearchDatasetId2Navigations { get; set; } = new List(); @@ -65,8 +39,6 @@ public partial class DimResearchDataset public virtual DimReferencedatum? DimReferencedataAvailabilityNavigation { get; set; } - public virtual DimReferencedatum? DimReferencedataLicenseNavigation { get; set; } - public virtual DimRegisteredDataSource DimRegisteredDataSource { get; set; } = null!; public virtual DimResearchDataCatalog? DimResearchDataCatalog { get; set; } @@ -79,11 +51,11 @@ public partial class DimResearchDataset public virtual ICollection FactFieldValues { get; set; } = new List(); - public virtual ICollection FactRelationFromResearchDatasets { get; set; } = new List(); + public virtual ICollection FactKeywords { get; set; } = new List(); - public virtual ICollection FactRelationToResearchDatasets { get; set; } = new List(); + public virtual ICollection FactReferencedata { get; set; } = new List(); - public virtual ICollection DimKeywords { get; set; } = new List(); + public virtual ICollection FactRelationFromResearchDatasets { get; set; } = new List(); - public virtual ICollection DimReferencedata { get; set; } = new List(); + public virtual ICollection FactRelationToResearchDatasets { get; set; } = new List(); } diff --git a/aspnetcore/src/DatabaseContext/Entities/DimResearchProject.cs b/aspnetcore/src/DatabaseContext/Entities/DimResearchProject.cs index b782c7a..d93e390 100644 --- a/aspnetcore/src/DatabaseContext/Entities/DimResearchProject.cs +++ b/aspnetcore/src/DatabaseContext/Entities/DimResearchProject.cs @@ -40,6 +40,8 @@ public partial class DimResearchProject public virtual DimDate? EndDateNavigation { get; set; } + public virtual ICollection FactKeywords { get; set; } = new List(); + public virtual DimOrganization ResponsibleOrganizationNavigation { get; set; } = null!; public virtual DimName ResponsiblePersonNavigation { get; set; } = null!; diff --git a/aspnetcore/src/DatabaseContext/Entities/FactKeyword.cs b/aspnetcore/src/DatabaseContext/Entities/FactKeyword.cs index 60949fb..0d02bee 100644 --- a/aspnetcore/src/DatabaseContext/Entities/FactKeyword.cs +++ b/aspnetcore/src/DatabaseContext/Entities/FactKeyword.cs @@ -16,4 +16,12 @@ public partial class FactKeyword public DateTime? Created { get; set; } public DateTime? Modified { get; set; } + + public int DimResearchDatasetId { get; set; } + + public virtual DimKeyword DimKeyword { get; set; } = null!; + + public virtual DimResearchDataset DimResearchDataset { get; set; } = null!; + + public virtual DimResearchProject DimResearchProject { get; set; } = null!; } diff --git a/aspnetcore/src/DatabaseContext/Entities/FactReferencedatum.cs b/aspnetcore/src/DatabaseContext/Entities/FactReferencedatum.cs new file mode 100644 index 0000000..48a8ee7 --- /dev/null +++ b/aspnetcore/src/DatabaseContext/Entities/FactReferencedatum.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; + +namespace CSC.PublicApi.DatabaseContext.Entities; + +public partial class FactReferencedatum +{ + public int DimReferencedataId { get; set; } + + public int DimResearchDatasetId { get; set; } + + public int DimInfrastructureId { get; set; } + + public int DimPublicationId { get; set; } + + public int DimResearchActivityId { get; set; } + + public int DimFundingDecisionId { get; set; } + + public int DimCallProgrammeId { get; set; } + + public string? SourceId { get; set; } + + public string? SourceDescription { get; set; } + + public DateTime? Created { get; set; } + + public DateTime? Modified { get; set; } + + public virtual DimCallProgramme DimCallProgramme { get; set; } = null!; + + public virtual DimFundingDecision DimFundingDecision { get; set; } = null!; + + public virtual DimInfrastructure DimInfrastructure { get; set; } = null!; + + public virtual DimPublication DimPublication { get; set; } = null!; + + public virtual DimReferencedatum DimReferencedata { get; set; } = null!; + + public virtual DimResearchActivity DimResearchActivity { get; set; } = null!; + + public virtual DimResearchDataset DimResearchDataset { get; set; } = null!; +} diff --git a/aspnetcore/src/Indexer/Indexer.cs b/aspnetcore/src/Indexer/Indexer.cs index ed75bce..07ab9b9 100644 --- a/aspnetcore/src/Indexer/Indexer.cs +++ b/aspnetcore/src/Indexer/Indexer.cs @@ -134,7 +134,7 @@ private async Task IndexEntities(string indexName, IIndexRepository repository, { List finalized = new(); - if (indexName.Contains("publication")) + if (indexName.Contains("publication") || indexName.Contains("dataset")) { // Create new index var (indexToCreate, indexToDelete) = await _indexService.GetIndexNames(indexName); @@ -174,7 +174,7 @@ private async Task IndexEntities(string indexName, IIndexRepository repository, processedCount = processedCount + numOfResults; finalized = new(); _logger.LogInformation("{EntityType:l}: Total documents indexed = {processedCount}", type.Name, processedCount); - } while (numOfResults >= takeAmount - 1); + } while (numOfResults > 0 && numOfResults >= takeAmount - 1); // Activate new index and delete old await _indexService.SwitchIndexes(indexName, indexToCreate, indexToDelete, type.Name); diff --git a/aspnetcore/src/Repositories/Maps/ResearchDatasetProfile.cs b/aspnetcore/src/Repositories/Maps/ResearchDatasetProfile.cs index 794ec83..ae43c44 100644 --- a/aspnetcore/src/Repositories/Maps/ResearchDatasetProfile.cs +++ b/aspnetcore/src/Repositories/Maps/ResearchDatasetProfile.cs @@ -9,6 +9,8 @@ namespace CSC.PublicApi.Repositories.Maps; public class ResearchDatasetProfile : Profile { private const string DataSetTypeVersion = "version"; + private const string DescriptiveItemType_Name = "name"; + private const string DescriptiveItemType_Description = "description"; public ResearchDatasetProfile() { @@ -18,27 +20,79 @@ public ResearchDatasetProfile() CreateProjection() .ForMember(dst => dst.ExportSortId, opt => opt.MapFrom(src => (long)src.Id)) .ForMember(dst => dst.DatabaseId, opt => opt.MapFrom(src => src.Id)) - .ForMember(dst => dst.NameFi, opt => opt.MapFrom(src => src.NameFi)) - .ForMember(dst => dst.NameSv, opt => opt.MapFrom(src => src.NameSv)) - .ForMember(dst => dst.NameEn, opt => opt.MapFrom(src => src.NameEn)) - .ForMember(dst => dst.DescriptionFi, opt => opt.MapFrom(src => src.DescriptionFi)) - .ForMember(dst => dst.DescriptionSv, opt => opt.MapFrom(src => src.DescriptionSv)) - .ForMember(dst => dst.DescriptionEn, opt => opt.MapFrom(src => src.DescriptionEn)) + .ForMember(dst => dst.NameFi, opt => opt.MapFrom(src => src.DimDescriptiveItems + .Where(di => di.DescriptiveItemType == DescriptiveItemType_Name && di.DescriptiveItemLanguage == "fi") + .Select(di => di.DescriptiveItem) + .FirstOrDefault())) + .ForMember(dst => dst.NameSv, opt => opt.MapFrom(src => src.DimDescriptiveItems + .Where(di => di.DescriptiveItemType == DescriptiveItemType_Name && di.DescriptiveItemLanguage == "sv") + .Select(di => di.DescriptiveItem) + .FirstOrDefault())) + .ForMember(dst => dst.NameEn, opt => opt.MapFrom(src => src.DimDescriptiveItems + .Where(di => di.DescriptiveItemType == DescriptiveItemType_Name && di.DescriptiveItemLanguage == "en") + .Select(di => di.DescriptiveItem) + .FirstOrDefault())) + .ForMember(dst => dst.DescriptionFi, opt => opt.MapFrom(src => src.DimDescriptiveItems + .Where(di => di.DescriptiveItemType == DescriptiveItemType_Description && di.DescriptiveItemLanguage == "fi") + .Select(di => di.DescriptiveItem) + .FirstOrDefault())) + .ForMember(dst => dst.DescriptionSv, opt => opt.MapFrom(src => src.DimDescriptiveItems + .Where(di => di.DescriptiveItemType == DescriptiveItemType_Description && di.DescriptiveItemLanguage == "sv") + .Select(di => di.DescriptiveItem) + .FirstOrDefault())) + .ForMember(dst => dst.DescriptionEn, opt => opt.MapFrom(src => src.DimDescriptiveItems + .Where(di => di.DescriptiveItemType == DescriptiveItemType_Description && di.DescriptiveItemLanguage == "en") + .Select(di => di.DescriptiveItem) + .FirstOrDefault())) .ForMember(dst => dst.Created, opt => opt.MapFrom(src => src.DatasetCreated)) - .ForMember(dst => dst.Contributors, opt => opt.MapFrom(src => src.FactContributions.Where(fc => fc.DimOrganizationId != -1 || fc.DimNameId != -1))) - .ForMember(dst => dst.FieldsOfScience, opt => opt.MapFrom(src => src.FactDimReferencedataFieldOfSciences)) - .ForMember(dst => dst.Languages, opt => opt.MapFrom(src => src.DimReferencedata)) + .ForMember(dst => dst.Contributors, opt => opt.Ignore()) // Handled during in memory operations in the index repository + .ForMember(dst => dst.ContributorsHelper, opt => opt.MapFrom(src => src.FactContributions.Where(fc => fc.DimOrganizationId != -1 || fc.DimNameId != -1 || fc.DimIdentifierlessDataId != -1))) + .ForMember(dst => dst.FieldsOfScience, opt => opt.MapFrom(src => src.FactReferencedata.Where(f => f.DimReferencedata.CodeScheme == "Tieteenala2010").Select(f => f.DimReferencedata))) + .ForMember(dst => dst.Languages, opt => opt.MapFrom(src => src.FactReferencedata.Where(f => f.DimReferencedata.CodeScheme == "languages").Select(f => f.DimReferencedata))) .ForMember(dst => dst.AccessType, opt => opt.MapFrom(src => src.DimReferencedataAvailabilityNavigation)) - .ForMember(dst => dst.License, opt => opt.MapFrom(src => src.DimReferencedataLicenseNavigation)) - .ForMember(dst => dst.Keywords, opt => opt.MapFrom(src => src.DimKeywords.Where(keyword => keyword.Scheme == "Avainsana"))) - .ForMember(dst => dst.SubjectHeadings, opt => opt.MapFrom(src => src.DimKeywords.Where(keyword => keyword.Scheme == "Theme"))) + .ForMember(dst => dst.License, opt => opt.MapFrom(src => src.FactReferencedata + .Where(f => f.DimReferencedata.CodeScheme == "license") + .Select(f => new ReferenceData + { + Code = f.DimReferencedata.CodeValue, + NameFi = f.DimReferencedata.NameFi, + NameSv = f.DimReferencedata.NameSv, + NameEn = f.DimReferencedata.NameEn + }).FirstOrDefault())) + .ForMember(dst => dst.Keywords, opt => opt.MapFrom(src => src.FactKeywords + .Where(f => f.DimKeyword.Scheme == "Avainsana") + .Select(f => new Keyword + { + Value = f.DimKeyword.Keyword, + Language = f.DimKeyword.Language, + Scheme = f.DimKeyword.Scheme + }))) + .ForMember(dst => dst.SubjectHeadings, opt => opt.MapFrom(src => src.FactKeywords + .Where(f => f.DimKeyword.Scheme == "Theme") + .Select(f => new Keyword + { + Value = f.DimKeyword.Keyword, + Language = f.DimKeyword.Language, + Scheme = f.DimKeyword.Scheme + }))) .ForMember(dst => dst.PersistentIdentifiers, opt => opt.MapFrom(src => src.DimPids)) .ForMember(dst => dst.Id, opt => opt.MapFrom(src => src.LocalIdentifier)) .ForMember(dst => dst.ResearchDataCatalog, opt => opt.MapFrom(src => src.DimResearchDataCatalog)) - .ForMember(dst => dst.OutgoingDatasetRelations, opt => opt.MapFrom(src => src.BrDatasetDatasetRelationshipDimResearchDatasets)) - .ForMember(dst => dst.IncomingDatasetVersionRelations, opt => opt.MapFrom(src => src.BrDatasetDatasetRelationshipDimResearchDatasetId2Navigations.Where(s => s.Type == DataSetTypeVersion))) - .ForMember(dst => dst.DatasetRelations, opt => opt.Ignore()) // Handled during in memory operations in the index repository - .ForMember(dst => dst.VersionSet, opt => opt.Ignore()) // Handled during in memory operations in the index repository + .ForMember(dst => dst.DatasetRelations, opt => opt.MapFrom(src => src.FactRelationFromResearchDatasets + .Where(f => f.RelationTypeCodeNavigation.CodeValue != "HasVersion") + .Select(f => new DatasetRelation + { + Id = f.ToResearchDataset.LocalIdentifier, + Type = f.RelationTypeCodeNavigation.CodeValue + }))) + .ForMember(dst => dst.VersionInfo, opt => opt.MapFrom(src => src.VersionInfo)) + .ForMember(dst => dst.VersionSet, opt => opt.MapFrom(src => src.FactRelationFromResearchDatasets + .Where(f => f.RelationTypeCodeNavigation.CodeValue == "HasVersion") + .Select(f => new CSC.PublicApi.Service.Models.ResearchDataset.Version + { + VersionNumber = f.ToResearchDataset.VersionInfo, + Identifier = f.ToResearchDataset.LocalIdentifier + }))) .ForMember(dst => dst.IsLatestVersion, opt => opt.Ignore()) // Handled during in memory operations in the index repository .ForMember(dst => dst.ResearchfiUrl, opt => opt.Ignore()); // Handled during in memory operations in the index repository @@ -49,20 +103,25 @@ public ResearchDatasetProfile() .ForMember(dst => dst.NameSv, opt => opt.MapFrom(src => src.NameSv)) .ForMember(dst => dst.NameEn, opt => opt.MapFrom(src => src.NameEn)); - CreateProjection() - .AddTransform(s => string.IsNullOrWhiteSpace(s) ? null : s) - .ForMember(dst => dst.Code, opt => opt.MapFrom(src => src.DimReferencedata.CodeValue)) - .ForMember(dst => dst.NameFi, opt => opt.MapFrom(src => src.DimReferencedata.NameFi)) - .ForMember(dst => dst.NameSv, opt => opt.MapFrom(src => src.DimReferencedata.NameSv)) - .ForMember(dst => dst.NameEn, opt => opt.MapFrom(src => src.DimReferencedata.NameEn)); + // CreateProjection() + // .AddTransform(s => string.IsNullOrWhiteSpace(s) ? null : s) + // .ForMember(dst => dst.Code, opt => opt.MapFrom(src => src.DimReferencedata.CodeValue)) + // .ForMember(dst => dst.NameFi, opt => opt.MapFrom(src => src.DimReferencedata.NameFi)) + // .ForMember(dst => dst.NameSv, opt => opt.MapFrom(src => src.DimReferencedata.NameSv)) + // .ForMember(dst => dst.NameEn, opt => opt.MapFrom(src => src.DimReferencedata.NameEn)); CreateProjection() .AddTransform(s => string.IsNullOrWhiteSpace(s) ? null : s) .ForMember(dst => dst.Value, opt => opt.MapFrom(src => src.Keyword)) .ForMember(dst => dst.Language, opt => opt.MapFrom(src => src.Language)); - CreateProjection() - .ForMember(dst => dst.Organization, opt => opt.MapFrom(src => src.DimOrganization)) + CreateProjection() + .ForMember(dst => dst.FactContribution_DimOrganizationId, opt => opt.MapFrom(src => src.DimOrganizationId)) + .ForMember(dst => dst.FactContribution_DimIdentifierlessDataId, opt => opt.MapFrom(src => src.DimIdentifierlessDataId)) + .ForMember(dst => dst.FactContribution_DimIdentifierlessData_DimOrganizationId, opt => opt.MapFrom(src => src.DimIdentifierlessData.DimOrganizationId)) + .ForMember(dst => dst.Organization_From_FactContribution_DimOrganization, opt => opt.MapFrom(src => src.DimOrganization)) + .ForMember(dst => dst.Organization_From_FactContribution_DimIdentifierlessData, opt => opt.MapFrom(src => src.DimIdentifierlessData)) + .ForMember(dst => dst.Organization_From_FactContribution_DimIdentifierlessData_DimOrganization, opt => opt.MapFrom(src => src.DimIdentifierlessData.DimOrganization)) .ForMember(dst => dst.Person, opt => opt.MapFrom(src => src.DimName)) .ForMember(dst => dst.Role, opt => opt.MapFrom(src => src.DimReferencedataActorRole)); @@ -75,19 +134,19 @@ public ResearchDatasetProfile() .ForMember(dst => dst.NameEn, opt => opt.MapFrom(src => src.NameEn)) .ForMember(dst => dst.NameVariants, opt => opt.MapFrom(src => src.NameVariants)); + CreateProjection() + .AddTransform(s => string.IsNullOrWhiteSpace(s) ? null : s) + .ForMember(dst => dst.Id, opt => opt.MapFrom(src => (string?)null)) // Set as null because data comes from table dim_identifierless_data + .ForMember(dst => dst.Pids, opt => opt.Ignore()) // Ignore for dim_identifierless_data + .ForMember(dst => dst.NameFi, opt => opt.MapFrom(src => src.ValueFi)) + .ForMember(dst => dst.NameSv, opt => opt.MapFrom(src => src.ValueSv)) + .ForMember(dst => dst.NameEn, opt => opt.MapFrom(src => src.ValueEn)) + .ForMember(dst => dst.NameVariants, opt => opt.MapFrom(src => src.ValueUnd)); + CreateProjection() .AddTransform(s => string.IsNullOrWhiteSpace(s) ? null : s) .ForMember(dst => dst.Name, opt => opt.MapFrom(src => src.FullName)); - CreateProjection() - .ForMember(dst => dst.Type, opt => opt.MapFrom(src => src.Type)) - .ForMember(dst => dst.DatabaseId, opt => opt.MapFrom(src => src.DimResearchDatasetId)) - .ForMember(dst => dst.DatabaseId2, opt => opt.MapFrom(src => src.DimResearchDatasetId2)) - .ForMember(dst => dst.VersionNumber, opt => opt.MapFrom(src => src.DimResearchDataset.VersionInfo)) - .ForMember(dst => dst.VersionNumber2, opt => opt.MapFrom(src => src.DimResearchDatasetId2Navigation.VersionInfo)) - .ForMember(dst => dst.Id, opt => opt.MapFrom(src => src.DimResearchDataset.LocalIdentifier)) - .ForMember(dst => dst.Id2, opt => opt.MapFrom(src => src.DimResearchDatasetId2Navigation.LocalIdentifier)); - CreateProjection() .ForMember(dst => dst.Id, opt => opt.MapFrom(src => src.Id)) .ForMember(dst => dst.NameFi, opt => opt.MapFrom(src => src.NameFi)) @@ -101,4 +160,4 @@ public ResearchDatasetProfile() .ForMember(dst => dst.Content, opt => opt.MapFrom(src => src.PidContent)) .ForMember(dst => dst.Type, opt => opt.MapFrom(src => src.PidType)); } -} +} \ No newline at end of file diff --git a/aspnetcore/src/Repositories/ResearchDatasetIndexRepository.cs b/aspnetcore/src/Repositories/ResearchDatasetIndexRepository.cs index 010ecd8..5e6abb8 100644 --- a/aspnetcore/src/Repositories/ResearchDatasetIndexRepository.cs +++ b/aspnetcore/src/Repositories/ResearchDatasetIndexRepository.cs @@ -44,7 +44,7 @@ protected override IQueryable GetChunk(int skipAmount, int take .ThenInclude(f => f.DimOrganization) .ProjectTo(_mapper.ConfigurationProvider); } - + public override List PerformInMemoryOperations(List entities) { entities.ForEach(o => @@ -53,15 +53,62 @@ public override List PerformInMemoryOperations(List entities) { return; } - + + HandleContributorOrganizations(researchDataset); HandleEmptyContributors(researchDataset); - HandleDatasetRelations(researchDataset); + HandleIsLatestVersion(researchDataset); HandleEmptyCollections(researchDataset); HandleResearchfiUrl(researchDataset); }); return entities; } + public override object PerformInMemoryOperation(object entity) + { + ResearchDataset researchDataset = (ResearchDataset)entity; + HandleContributorOrganizations(researchDataset); + HandleEmptyContributors(researchDataset); + HandleIsLatestVersion(researchDataset); + HandleEmptyCollections(researchDataset); + HandleResearchfiUrl(researchDataset); + return researchDataset; + } + + private static void HandleContributorOrganizations(ResearchDataset researchDataset) + { + if (researchDataset.ContributorsHelper == null) + { + return; + } + + researchDataset.Contributors = new List(); + + foreach (var contributorHelper in researchDataset.ContributorsHelper) + { + var contributor = new Contributor + { + // Determine the correct organization based on available IDs + // Priority: + // 1. FactContribution_DimOrganizationId + // 2. FactContribution_DimIdentifierlessData_DimOrganizationId + // 3. FactContribution_DimIdentifierlessDataId + Organization = contributorHelper.FactContribution_DimOrganizationId != -1 + ? contributorHelper.Organization_From_FactContribution_DimOrganization + : contributorHelper.FactContribution_DimIdentifierlessDataId != -1 + ? (contributorHelper.FactContribution_DimIdentifierlessData_DimOrganizationId != -1 + ? contributorHelper.Organization_From_FactContribution_DimIdentifierlessData_DimOrganization + : contributorHelper.Organization_From_FactContribution_DimIdentifierlessData) + : null, + Person = contributorHelper.Person, + Role = contributorHelper.Role + }; + + researchDataset.Contributors.Add(contributor); + } + + researchDataset.ContributorsHelper = null; + } + private static void HandleEmptyCollections(ResearchDataset researchDataset) { if (researchDataset.Keywords != null && !researchDataset.Keywords.Any()) @@ -73,17 +120,17 @@ private static void HandleEmptyCollections(ResearchDataset researchDataset) { researchDataset.SubjectHeadings = null; } - + if (researchDataset.FieldsOfScience != null && !researchDataset.FieldsOfScience.Any()) { researchDataset.FieldsOfScience = null; } - + if (researchDataset.Languages != null && !researchDataset.Languages.Any()) { researchDataset.Languages = null; } - + if (researchDataset.PersistentIdentifiers != null && !researchDataset.PersistentIdentifiers.Any()) { researchDataset.PersistentIdentifiers = null; @@ -93,6 +140,16 @@ private static void HandleEmptyCollections(ResearchDataset researchDataset) { researchDataset.License = null; } + + if (researchDataset.DatasetRelations != null && !researchDataset.DatasetRelations.Any()) + { + researchDataset.DatasetRelations = null; + } + + if (researchDataset.VersionSet != null && !researchDataset.VersionSet.Any()) + { + researchDataset.VersionSet = null; + } } /// @@ -119,57 +176,15 @@ private static void HandleEmptyContributors(ResearchDataset researchDataset) } /// - /// Checks all incoming and outgoing versions and creates a single list to the property. + /// Determine if dataset is the latest version /// - private static void HandleDatasetRelations(ResearchDataset researchDataset) + private static void HandleIsLatestVersion(ResearchDataset researchDataset) { - var versions = new List(); - - if (researchDataset.IncomingDatasetVersionRelations != null) - { - versions.AddRange(researchDataset.IncomingDatasetVersionRelations.Select(version => new Version - { - DatabaseId = version.DatabaseId, - VersionNumber = version.VersionNumber, - Identifier = version.Id - }).ToList()); - } - - if (researchDataset.OutgoingDatasetRelations != null) - { - foreach (var outgoingRelation in researchDataset.OutgoingDatasetRelations) - { - if (outgoingRelation.Type == "version") - { - if (versions.All(s => s.DatabaseId != outgoingRelation.DatabaseId2)) - { - versions.Add(new Version - { - DatabaseId = outgoingRelation.DatabaseId2, - VersionNumber = outgoingRelation.VersionNumber2, - Identifier = outgoingRelation.Id2 - }); - } - - continue; - } - - researchDataset.DatasetRelations ??= new List(); - researchDataset.DatasetRelations.Add(new DatasetRelation - { - Id = outgoingRelation.Id2, - Type = outgoingRelation.Type - }); - } - } - - if (versions.Any()) - { - researchDataset.VersionSet = versions; - } - - researchDataset.IsLatestVersion = researchDataset.VersionSet == null || researchDataset.VersionSet.Any(s => - s.DatabaseId == researchDataset.DatabaseId && s.VersionNumber == researchDataset.VersionSet.Max(m => m.VersionNumber)); + researchDataset.IsLatestVersion = + researchDataset.VersionSet == null || + researchDataset.VersionSet.Count == 0 || + researchDataset.VersionInfo >= + researchDataset.VersionSet.Max(m => m.VersionNumber); } private static void HandleResearchfiUrl(ResearchDataset researchDataset) diff --git a/aspnetcore/src/Service.Models/ResearchDataset/ContributorHelper.cs b/aspnetcore/src/Service.Models/ResearchDataset/ContributorHelper.cs new file mode 100644 index 0000000..c52747d --- /dev/null +++ b/aspnetcore/src/Service.Models/ResearchDataset/ContributorHelper.cs @@ -0,0 +1,14 @@ +namespace CSC.PublicApi.Service.Models.ResearchDataset; + +public class ContributorHelper +{ + public int FactContribution_DimOrganizationId { get; set; } + public int FactContribution_DimIdentifierlessDataId { get; set; } + public int FactContribution_DimIdentifierlessData_DimOrganizationId { get; set; } + public Organization? Organization_From_FactContribution_DimOrganization { get; set; } + public Organization? Organization_From_FactContribution_DimIdentifierlessData { get; set; } + public Organization? Organization_From_FactContribution_DimIdentifierlessData_DimOrganization { get; set; } + public Person? Person { get; set; } + public ReferenceData? Role { get; set; } + +} \ No newline at end of file diff --git a/aspnetcore/src/Service.Models/ResearchDataset/ResearchDataset.cs b/aspnetcore/src/Service.Models/ResearchDataset/ResearchDataset.cs index 105c699..3404561 100644 --- a/aspnetcore/src/Service.Models/ResearchDataset/ResearchDataset.cs +++ b/aspnetcore/src/Service.Models/ResearchDataset/ResearchDataset.cs @@ -26,6 +26,9 @@ public class ResearchDataset public DateTime? Created { get; set; } public List? Contributors { get; set; } + + [Ignore] + public List? ContributorsHelper { get; set; } public List? FieldsOfScience { get; set; } @@ -45,24 +48,12 @@ public class ResearchDataset public ResearchDataCatalog? ResearchDataCatalog { get; set; } - /// - /// Intermediate collection for getting outgoing version relations from the database. Not to be stored in Elastic Search. - /// [Ignore] - public List? OutgoingDatasetRelations { get; set; } - - /// - /// Intermediate collection for getting incoming version relations from the database. Not to be stored in Elastic Search. - /// - [Ignore] - public List? IncomingDatasetVersionRelations { get; set; } + public int VersionInfo { get; set; } /// /// Collection of version references built from incoming and outgoing relations, to be able to include all versions of the data set for all entities. /// - /// - /// Filled in the in memory operations of the index repository. - /// public List? VersionSet { get; set; } /// diff --git a/aspnetcore/src/Service.Models/ResearchDataset/Version.cs b/aspnetcore/src/Service.Models/ResearchDataset/Version.cs index 527e9c5..86073df 100644 --- a/aspnetcore/src/Service.Models/ResearchDataset/Version.cs +++ b/aspnetcore/src/Service.Models/ResearchDataset/Version.cs @@ -7,8 +7,5 @@ public class Version [Keyword] public string? Identifier { get; set; } - public string? VersionNumber { get; set; } - - [Ignore] - public int DatabaseId { get; set; } + public int VersionNumber { get; set; } } \ No newline at end of file diff --git a/aspnetcore/test/Indexer.Tests/Maps/ResearchDatasetProfileTest.cs b/aspnetcore/test/Indexer.Tests/Maps/ResearchDatasetProfileTest.cs index 54ef895..93ffd61 100644 --- a/aspnetcore/test/Indexer.Tests/Maps/ResearchDatasetProfileTest.cs +++ b/aspnetcore/test/Indexer.Tests/Maps/ResearchDatasetProfileTest.cs @@ -6,6 +6,7 @@ using FluentAssertions; using Xunit; using Organization = CSC.PublicApi.Service.Models.ResearchDataset.Organization; +using Version = CSC.PublicApi.Service.Models.ResearchDataset.Version; namespace CSC.PublicApi.Indexer.Tests.Maps; @@ -44,12 +45,40 @@ public void ProjectTo_DimResearchDatasetWithoutVersions_ShouldBeMappedToResearch { // Arrange var entity = GetEntity(); - entity.BrDatasetDatasetRelationshipDimResearchDatasetId2Navigations = new List(); - entity.BrDatasetDatasetRelationshipDimResearchDatasets = new List(); + // Relation type "HasVersion" is not included in related datasets. + entity.FactRelationFromResearchDatasets = new List + { + new FactRelation() + { + FromResearchDataset = new DimResearchDataset + { + VersionInfo = 1, + LocalIdentifier = "localIdentifier_1" + }, + ToResearchDataset = new DimResearchDataset + { + VersionInfo = 3, + LocalIdentifier = "localIdentifier_3" + }, + FromResearchDatasetId = 111, + ToResearchDatasetId = 113, + RelationTypeCodeNavigation = new DimReferencedatum + { + CodeValue = "IsPartOf" + } + } + }; var model = GetModel(); - model.IncomingDatasetVersionRelations = new List(); - model.OutgoingDatasetRelations = new List(); + model.DatasetRelations = new List() + { + new DatasetRelation() + { + Id = "localIdentifier_3", + Type = "IsPartOf" + } + }; + model.VersionSet = new List(); // Act var result = Act_Map(entity); @@ -75,17 +104,51 @@ private static DimResearchDataset GetEntity() return new DimResearchDataset { Id = Id, - NameFi = "nameFi", - NameSv = "nameSv", - NameEn = "nameEn", - DescriptionFi = "descFi", - DescriptionSv = "descSv", - DescriptionEn = "descEn", + DimDescriptiveItems = new List + { + new() + { + DescriptiveItemType = "name", + DescriptiveItemLanguage = "fi", + DescriptiveItem = "nameFi" + }, + new() + { + DescriptiveItemType = "name", + DescriptiveItemLanguage = "sv", + DescriptiveItem = "nameSv" + }, + new() + { + DescriptiveItemType = "name", + DescriptiveItemLanguage = "en", + DescriptiveItem = "nameEn" + }, + new() + { + DescriptiveItemType = "description", + DescriptiveItemLanguage = "fi", + DescriptiveItem = "descFi" + }, + new() + { + DescriptiveItemType = "description", + DescriptiveItemLanguage = "sv", + DescriptiveItem = "descSv" + }, + new() + { + DescriptiveItemType = "description", + DescriptiveItemLanguage = "en", + DescriptiveItem = "descEn" + } + }, DatasetCreated = new DateTime(2021, 10, 1), FactContributions = new List { new() { + DimOrganizationId = 42, DimOrganization = new DimOrganization { Id = 42, @@ -123,30 +186,101 @@ private static DimResearchDataset GetEntity() NameFi = "roleNameFi", NameSv = "roleNameSv", NameEn = "roleNameEn" + }, + DimIdentifierlessDataId = 99, + DimIdentifierlessData = new DimIdentifierlessDatum + { + Id = 99, + ValueFi = "identifierlessDataValueFi", + ValueSv = "identifierlessDataValueSv", + ValueEn = "identifierlessDataValueEn", + ValueUnd = "identifierlessDataValueUnd", + DimOrganizationId = 43, + DimOrganization = new DimOrganization + { + Id = 43, + NameFi = "identifierlessOrganizationNameFi", + NameSv = "identifierlessOrganizationNameSv", + NameEn = "identifierlessOrganizationNameEn", + NameVariants = "identifierlessOrganizationNameVariants", + DimPids = new List + { + new() + { + PidContent = "pidContent4", + PidType = "BusinessID" + }, + new() + { + PidContent = "pidContent5", + PidType = "PIC" + }, + new() + { + PidContent = "pidContent6", + PidType = "WrongType" + } + } + } } } }, - FactDimReferencedataFieldOfSciences = new List + FactReferencedata = new List { new() { DimReferencedata = new DimReferencedatum { - CodeValue = "fieldOfScienceFieldId", - NameFi = "fieldOfScienceNameFi", - NameSv = "fieldOfScienceNameSv", - NameEn = "fieldOfScienceNameEn" + CodeValue = "fieldOfScienceFieldId_1", + NameFi = "fieldOfScienceNameFi_1", + NameSv = "fieldOfScienceNameSv_1", + NameEn = "fieldOfScienceNameEn_1", + CodeScheme = "Tieteenala2010" } - } - }, - DimReferencedata = new List - { + }, new() { - CodeValue = "languageCode", - NameEn = "languageNameEn", - NameFi = "languageNameFi", - NameSv = "languageNameSv", + DimReferencedata = new DimReferencedatum + { + CodeValue = "fieldOfScienceFieldId_2", + NameFi = "fieldOfScienceNameFi_2", + NameSv = "fieldOfScienceNameSv_2", + NameEn = "fieldOfScienceNameEn_2", + CodeScheme = "Tieteenala2010" + } + }, + new() + { + DimReferencedata = new DimReferencedatum + { + CodeValue = "languageCode", + NameEn = "languageNameEn", + NameFi = "languageNameFi", + NameSv = "languageNameSv", + CodeScheme = "languages" + } + }, + new() + { + DimReferencedata = new DimReferencedatum + { + CodeValue = "licenseCode", + NameFi = "licenseNameFi", + NameSv = "licenseNameSv", + NameEn = "licenseNameEn", + CodeScheme = "license" + } + }, + new() + { + DimReferencedata = new DimReferencedatum + { + CodeValue = "accessTypeCode", + NameFi = "accessTypeNameFi", + NameSv = "accessTypeNameSv", + NameEn = "accessTypeNameEn", + CodeScheme = "access_type" + } } }, DimReferencedataAvailabilityNavigation = new DimReferencedatum @@ -157,99 +291,95 @@ private static DimResearchDataset GetEntity() NameEn = "accessTypeNameEn", CodeScheme = "access_type" }, - DimReferencedataLicenseNavigation = new DimReferencedatum - { - CodeValue = "licenseCode", - NameFi = "licenseNameFi", - NameSv = "licenseNameSv", - NameEn = "licenseNameEn", - CodeScheme = "license" - }, - DimKeywords = new List + FactKeywords = new List { new() { - Keyword = "keyword1", - Language = "keywordLanguage", - Scheme = "Avainsana" + DimKeyword = new DimKeyword + { + Keyword = "keyword1", + Language = "keywordLanguage1", + Scheme = "Avainsana" + } }, new() { - Keyword = "subjectHeading1", - Language = "keywordLanguage", - Scheme = "Theme" + DimKeyword = new DimKeyword + { + Keyword = "subjectHeading1", + Language = "keywordLanguage2", + Scheme = "Theme" + } }, - }, - BrDatasetDatasetRelationshipDimResearchDatasets = new List - { new() { - DimResearchDataset = new DimResearchDataset + DimKeyword = new DimKeyword { - VersionInfo = "123", - LocalIdentifier = "1" - }, - DimResearchDatasetId2Navigation = new DimResearchDataset - { - VersionInfo = "123", - LocalIdentifier = "2" - }, - DimResearchDatasetId = 32410, - DimResearchDatasetId2 = 32410, - Type = "version" - }, + Keyword = "wrongSchemeKeyword", + Language = "keywordLanguage3", + Scheme = "WrongScheme" + } + } + }, + VersionInfo = 1, + FactRelationFromResearchDatasets = new List + { new() { - DimResearchDataset = new DimResearchDataset + FromResearchDataset = new DimResearchDataset { - VersionInfo = "321", - LocalIdentifier = "3" + VersionInfo = 1, + LocalIdentifier = "localIdentifier_1" }, - DimResearchDatasetId2Navigation = new DimResearchDataset + ToResearchDataset = new DimResearchDataset { - VersionInfo = "321", - LocalIdentifier = "4" + VersionInfo = 1, + LocalIdentifier = "localIdentifier_1" }, - DimResearchDatasetId = 32411, - DimResearchDatasetId2 = 32411, - Type = "notVersion" + FromResearchDatasetId = 111, + ToResearchDatasetId = 111, + RelationTypeCodeNavigation = new DimReferencedatum + { + CodeValue = "HasVersion" + } }, - - }, - BrDatasetDatasetRelationshipDimResearchDatasetId2Navigations = new List - { new() { - DimResearchDataset = new DimResearchDataset + FromResearchDataset = new DimResearchDataset { - VersionInfo = "321", - LocalIdentifier = "5" + VersionInfo = 1, + LocalIdentifier = "localIdentifier_1" }, - DimResearchDatasetId2Navigation = new DimResearchDataset + ToResearchDataset = new DimResearchDataset { - VersionInfo = "322", - LocalIdentifier = "6" - + VersionInfo = 2, + LocalIdentifier = "localIdentifier_2" }, - DimResearchDatasetId = 32411, - DimResearchDatasetId2 = 32412, - Type = "notVersion" + FromResearchDatasetId = 111, + ToResearchDatasetId = 112, + RelationTypeCodeNavigation = new DimReferencedatum + { + CodeValue = "HasVersion" + } }, new() { - DimResearchDataset = new DimResearchDataset + FromResearchDataset = new DimResearchDataset { - VersionInfo = "123", - LocalIdentifier = "7" + VersionInfo = 1, + LocalIdentifier = "localIdentifier_1" }, - DimResearchDatasetId2Navigation = new DimResearchDataset + ToResearchDataset = new DimResearchDataset { - VersionInfo = "321", - LocalIdentifier = "8" + VersionInfo = 3, + LocalIdentifier = "localIdentifier_3" }, - DimResearchDatasetId = 32410, - DimResearchDatasetId2 = 32411, - Type = "version" + FromResearchDatasetId = 111, + ToResearchDatasetId = 113, + RelationTypeCodeNavigation = new DimReferencedatum + { + CodeValue = "IsPartOf" + } } }, DimPids = new List @@ -286,11 +416,14 @@ private static ResearchDataset GetModel() DescriptionSv = "descSv", DescriptionEn = "descEn", Created = new DateTime(2021, 10, 1), - Contributors = new List + ContributorsHelper = new List { new() { - Organization = new Organization + FactContribution_DimOrganizationId = 42, + FactContribution_DimIdentifierlessDataId = 99, + FactContribution_DimIdentifierlessData_DimOrganizationId = 43, + Organization_From_FactContribution_DimOrganization = new Organization { Id = "42", Pids = new List @@ -311,7 +444,37 @@ private static ResearchDataset GetModel() NameEn = "organizationNameEn", NameVariants = "organizationNameVariants" }, - Person = new Person + Organization_From_FactContribution_DimIdentifierlessData = new Organization + { + Id = null, + NameEn = "identifierlessDataValueEn", + NameFi = "identifierlessDataValueFi", + NameSv = "identifierlessDataValueSv", + NameVariants = "identifierlessDataValueUnd", + Pids = null + }, + Organization_From_FactContribution_DimIdentifierlessData_DimOrganization = new Organization + { + Id = "43", + NameEn = "identifierlessOrganizationNameEn", + NameFi = "identifierlessOrganizationNameFi", + NameSv = "identifierlessOrganizationNameSv", + NameVariants = "identifierlessOrganizationNameVariants", + Pids = new List + { + new() + { + Content = "pidContent4", + Type = "BusinessID" + }, + new() + { + Content = "pidContent5", + Type = "PIC" + } + }, + }, + Person = new Person { Name = "personFullName" }, @@ -327,10 +490,17 @@ private static ResearchDataset GetModel() { new() { - Code = "fieldOfScienceFieldId", - NameFi = "fieldOfScienceNameFi", - NameSv = "fieldOfScienceNameSv", - NameEn = "fieldOfScienceNameEn" + Code = "fieldOfScienceFieldId_1", + NameFi = "fieldOfScienceNameFi_1", + NameSv = "fieldOfScienceNameSv_1", + NameEn = "fieldOfScienceNameEn_1" + }, + new() + { + Code = "fieldOfScienceFieldId_2", + NameFi = "fieldOfScienceNameFi_2", + NameSv = "fieldOfScienceNameSv_2", + NameEn = "fieldOfScienceNameEn_2" } }, Languages = new List @@ -362,7 +532,7 @@ private static ResearchDataset GetModel() new() { Value = "keyword1", - Language = "keywordLanguage", + Language = "keywordLanguage1", Scheme = "Avainsana" } }, @@ -371,7 +541,7 @@ private static ResearchDataset GetModel() new() { Value = "subjectHeading1", - Language = "keywordLanguage", + Language = "keywordLanguage2", Scheme = "Theme" } }, @@ -393,45 +563,29 @@ private static ResearchDataset GetModel() SourceId = "researchDataCatalogSourceId", SourceDescription = "researchDataCatalogSourceDescription" }, - IncomingDatasetVersionRelations = new List + DatasetRelations = new List { new() { - DatabaseId = 32410, - DatabaseId2 = 32411, - Id = "7", - Id2 = "8", - Type = "version", - VersionNumber = "123", - VersionNumber2 = "321" + Id = "localIdentifier_3", + Type = "IsPartOf" } }, - OutgoingDatasetRelations = new List + VersionInfo = 1, + VersionSet = new List { new() { - DatabaseId = 32410, - DatabaseId2 = 32410, - Id = "1", - Id2 = "2", - Type = "version", - VersionNumber = "123", - VersionNumber2 = "123" + Identifier = "localIdentifier_1", + VersionNumber = 1 }, new() { - DatabaseId = 32411, - DatabaseId2 = 32411, - Id = "3", - Id2 = "4", - Type = "notVersion", - VersionNumber = "321", - VersionNumber2 = "321" + Identifier = "localIdentifier_2", + VersionNumber = 2, } }, - DatasetRelations = null, - VersionSet = null, IsLatestVersion = null }; } -} +} \ No newline at end of file diff --git a/aspnetcore/test/Interface.Tests/Maps/ResearchDatasetProfileTest.cs b/aspnetcore/test/Interface.Tests/Maps/ResearchDatasetProfileTest.cs index ff882a2..ec8644b 100644 --- a/aspnetcore/test/Interface.Tests/Maps/ResearchDatasetProfileTest.cs +++ b/aspnetcore/test/Interface.Tests/Maps/ResearchDatasetProfileTest.cs @@ -200,12 +200,12 @@ private static ResearchDataset GetServiceModel() new() { Identifier = "45670894-2a22-422e-8858-2fe52938276d", - VersionNumber = "123" + VersionNumber = 123 }, new() { Identifier = "9936fbc2-f043-4c27-9a65-a52472aa94cb", - VersionNumber = "321" + VersionNumber = 321 } }, IsLatestVersion = false diff --git a/aspnetcore/test/Repository.Tests/ResearchDatasetIndexRepositoryTest.cs b/aspnetcore/test/Repository.Tests/ResearchDatasetIndexRepositoryTest.cs index ebe1f09..ee0ff66 100644 --- a/aspnetcore/test/Repository.Tests/ResearchDatasetIndexRepositoryTest.cs +++ b/aspnetcore/test/Repository.Tests/ResearchDatasetIndexRepositoryTest.cs @@ -3,6 +3,7 @@ using CSC.PublicApi.Service.Models.ResearchDataset; using FluentAssertions; using Xunit; +using Version = CSC.PublicApi.Service.Models.ResearchDataset.Version; namespace Repository.Tests; @@ -32,19 +33,8 @@ public void PerformInMemoryOperations_ResearchDataset_IsHandledCorrectly() var researchDatasetObject = researchDatasets.FirstOrDefault(); researchDatasetObject.Should().NotBeNull().And.BeAssignableTo(); var researchDataset = (ResearchDataset)researchDatasetObject!; - - researchDataset.DatasetRelations.Should().NotBeNullOrEmpty(); - var datasetRelation = researchDataset.DatasetRelations!.FirstOrDefault(); - datasetRelation.Should().NotBeNull(); - datasetRelation!.Id.Should().Be("4"); - datasetRelation.Type.Should().Be("notVersion"); - - researchDataset.VersionSet.Should().NotBeNullOrEmpty(); - researchDataset.VersionSet.Should().HaveCount(2); - researchDataset.VersionSet.Should().ContainSingle(v => v.Identifier == "1" && v.VersionNumber == "1"); - researchDataset.VersionSet.Should().ContainSingle(v => v.Identifier == "2" && v.VersionNumber == "2"); - researchDataset.IsLatestVersion.Should().Be(false); + researchDataset.IsLatestVersion.Should().Be(false, "IsLatestVersion should be false"); researchDataset.Contributors.Should().BeNull(); researchDataset.FieldsOfScience.Should().BeNull(); researchDataset.Keywords.Should().BeNull(); @@ -57,13 +47,12 @@ public void PerformInMemoryOperations_ResearchDatasetWithNoVersions_IsLatestVers { // Arrange var researchDataset = GetModel(); - researchDataset.IncomingDatasetVersionRelations = null; - researchDataset.OutgoingDatasetRelations = null; + researchDataset.VersionSet = null; // No versions var researchDatasets = new List { researchDataset }; - + // Act var resultDatasets = _researchDatasetIndexRepository.PerformInMemoryOperations(researchDatasets); @@ -75,7 +64,7 @@ public void PerformInMemoryOperations_ResearchDatasetWithNoVersions_IsLatestVers resultResearchDataset.DatasetRelations.Should().BeNull(); resultResearchDataset.VersionSet.Should().BeNull(); - resultResearchDataset.IsLatestVersion.Should().Be(true); + resultResearchDataset.IsLatestVersion.Should().Be(true, "IsLatestVersion should be true"); } [Fact] @@ -83,7 +72,20 @@ public void PerformInMemoryOperations_ResearchDatasetWithLatestVersion_IsLatestV { // Arrange var researchDataset = GetModel(); - researchDataset.DatabaseId = 101; + researchDataset.VersionInfo = 3; // Set to higher value than any in VersionSet + researchDataset.VersionSet = new List() + { + new Version + { + Identifier = "localIdentifier-1", + VersionNumber = 1 + }, + new Version + { + Identifier = "localIdentifier-1", + VersionNumber = 2 + } + }; var researchDatasets = new List { researchDataset @@ -103,9 +105,9 @@ public void PerformInMemoryOperations_ResearchDatasetWithLatestVersion_IsLatestV // Check that ResearchfiUrl is set correctly in HandleResearchfiUrl resultResearchDataset.ResearchfiUrl.Should().NotBeNull(); - resultResearchDataset.ResearchfiUrl.Fi.Should().Be("https://tiedejatutkimus.fi/fi/results/dataset/localIdentifier"); - resultResearchDataset.ResearchfiUrl.Sv.Should().Be("https://forskning.fi/sv/results/dataset/localIdentifier"); - resultResearchDataset.ResearchfiUrl.En.Should().Be("https://research.fi/en/results/dataset/localIdentifier"); + resultResearchDataset.ResearchfiUrl.Fi.Should().Be("https://tiedejatutkimus.fi/fi/results/dataset/localIdentifier-1"); + resultResearchDataset.ResearchfiUrl.Sv.Should().Be("https://forskning.fi/sv/results/dataset/localIdentifier-1"); + resultResearchDataset.ResearchfiUrl.En.Should().Be("https://research.fi/en/results/dataset/localIdentifier-1"); } private static ResearchDataset GetModel() @@ -113,6 +115,7 @@ private static ResearchDataset GetModel() return new ResearchDataset { DatabaseId = 100, + Id = "localIdentifier-1", NameFi = "nameFi", NameSv = "nameSv", NameEn = "nameEn", @@ -160,7 +163,6 @@ private static ResearchDataset GetModel() }, Keywords = new List(), PersistentIdentifiers = new List(), - Id = "localIdentifier", ResearchDataCatalog = new ResearchDataCatalog { Id = 7, @@ -170,56 +172,26 @@ private static ResearchDataset GetModel() SourceId = "researchDataCatalogSourceId", SourceDescription = "researchDataCatalogSourceDescription" }, - IncomingDatasetVersionRelations = new List - { - new() - { - DatabaseId = 101, - DatabaseId2 = 100, - Id = "2", - Id2 = "1", - Type = "version", - VersionNumber = "2", - VersionNumber2 = "1" - } - }, - OutgoingDatasetRelations = new List + DatasetRelations = null, + VersionSet = new List() { - new() + new Version { - DatabaseId = 100, - DatabaseId2 = 100, - Id = "1", - Id2 = "1", - Type = "version", - VersionNumber = "1", - VersionNumber2 = "1" + Identifier = "localIdentifier-1", + VersionNumber = 1 }, - new() + new Version { - DatabaseId = 100, - DatabaseId2 = 101, - Id = "1", - Id2 = "2", - Type = "version", - VersionNumber = "1", - VersionNumber2 = "2" + Identifier = "localIdentifier-1", + VersionNumber = 2 }, - new() + new Version { - DatabaseId = 100, - DatabaseId2 = 105, - Id = "3", - Id2 = "4", - Type = "notVersion", - VersionNumber = "321", - VersionNumber2 = "321" + Identifier = "localIdentifier-2", + VersionNumber = 1 } }, - DatasetRelations = null, - VersionSet = null, IsLatestVersion = null - // ResearchfiUrl should be set in HandleResearchfiUrl }; } } \ No newline at end of file