Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • Fix/v0.1.7-dependencies
  • Hotfix/2212-fixFiles
  • Hotfix/2776-workingNewVersion
  • Hotfix/xxxx-changeUrls
  • Hotfix/xxxx-correctAssignments
  • Hotfix/xxxx-coscineGraph
  • Issue/1321-pidEnquiryOverhaul
  • Issue/1781-sqlToLinked
  • Issue/1782-structualDataIntegration
  • Issue/2081-migrateUserStructuralData
  • Issue/2082-migrateRoleStructuralData
  • Issue/2083-migrateResourceTypeStructuralData
  • Issue/2084-migrateResourceStructuralData
  • Issue/2085-migrateProjectStructuralData
  • Issue/2221-projectDateCreated
  • Issue/2222-resourceDateCreated
  • Issue/2304-virtuosoRoars
  • Issue/2518-docs
  • Issue/2666-adminCronjobs
  • Issue/2666-adminCronjobs-theSequal
  • Issue/2847-reporting
  • Issue/2914-trellisMigrator
  • dev
  • gitkeep
  • main
  • v0.1.0
  • v0.1.1
  • v0.1.10
  • v0.1.11
  • v0.1.12
  • v0.1.13
  • v0.1.14
  • v0.1.15
  • v0.1.16
  • v0.1.17
  • v0.1.18
  • v0.1.19
  • v0.1.2
  • v0.1.20
  • v0.1.21
  • v0.1.22
  • v0.1.23
  • v0.1.24
  • v0.1.3
  • v0.1.4
  • v0.1.5
  • v0.1.6
  • v0.1.7
  • v0.1.8
  • v0.1.9
50 results

Target

Select target project
  • coscine/backend/scripts/sql2linked
1 result
Select Git revision
  • Fix/v0.1.7-dependencies
  • Hotfix/2212-fixFiles
  • Hotfix/2776-workingNewVersion
  • Hotfix/xxxx-changeUrls
  • Hotfix/xxxx-correctAssignments
  • Hotfix/xxxx-coscineGraph
  • Issue/1321-pidEnquiryOverhaul
  • Issue/1781-sqlToLinked
  • Issue/1782-structualDataIntegration
  • Issue/2081-migrateUserStructuralData
  • Issue/2082-migrateRoleStructuralData
  • Issue/2083-migrateResourceTypeStructuralData
  • Issue/2084-migrateResourceStructuralData
  • Issue/2085-migrateProjectStructuralData
  • Issue/2221-projectDateCreated
  • Issue/2222-resourceDateCreated
  • Issue/2304-virtuosoRoars
  • Issue/2518-docs
  • Issue/2666-adminCronjobs
  • Issue/2666-adminCronjobs-theSequal
  • Issue/2847-reporting
  • Issue/2914-trellisMigrator
  • dev
  • gitkeep
  • main
  • v0.1.0
  • v0.1.1
  • v0.1.10
  • v0.1.11
  • v0.1.12
  • v0.1.13
  • v0.1.14
  • v0.1.15
  • v0.1.16
  • v0.1.17
  • v0.1.18
  • v0.1.19
  • v0.1.2
  • v0.1.20
  • v0.1.21
  • v0.1.22
  • v0.1.23
  • v0.1.24
  • v0.1.3
  • v0.1.4
  • v0.1.5
  • v0.1.6
  • v0.1.7
  • v0.1.8
  • v0.1.9
50 results
Show changes
Commits on Source (4)
......@@ -26,9 +26,10 @@ publish:
migration:
rules:
- if: $CI_MERGE_REQUEST_ID
when: never # Ignore detached head jobs created by merge requests.
- if: $CI_PIPELINE_SOURCE != "schedule"
when: manual
stage: commands
script:
- dotnet run --project .\src\$DOTNET_MAIN_PROJECT_FOLDER -- --noDryRun
\ No newline at end of file
when: manual
\ No newline at end of file
......@@ -14,9 +14,11 @@ namespace SQL2Linked.Implementations
public readonly Uri vcard = new("http://www.w3.org/2006/vcard/ns#");
public readonly Uri rdf = new("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
public readonly Uri cosc = new("https://purl.org/coscine/");
private VisibilityModel VisibilityModel = new VisibilityModel();
private ProjectRoleModel ProjectRoleModel = new ProjectRoleModel();
private ProjectResourceModel ProjectResourceModel = new ProjectResourceModel();
private readonly VisibilityModel VisibilityModel = new();
private readonly ProjectRoleModel ProjectRoleModel = new();
private readonly ProjectResourceModel ProjectResourceModel = new();
private readonly ProjectInstituteModel ProjectInstituteModel = new();
// Override to also receive deleted projects
public override IEnumerable<Project> GetAll()
......@@ -34,6 +36,7 @@ namespace SQL2Linked.Implementations
IEnumerable<Visibility> visibilities = VisibilityModel.GetAll();
IEnumerable<ProjectRole> projectRoles = ProjectRoleModel.GetAll();
IEnumerable<ProjectResource> projectResources = ProjectResourceModel.GetAll();
IEnumerable<ProjectInstitute> projectInstitutes = ProjectInstituteModel.GetAll();
var graphs = new List<IGraph>();
var projectUrlHandlePrefix = "https://hdl.handle.net/" + Prefix;
......@@ -45,8 +48,10 @@ namespace SQL2Linked.Implementations
var projectGraphName = $"{projectUrlPrefix}/{entry.Id}";
var projectHandleName = $"{projectUrlHandlePrefix}/{entry.Id}";
var graph = new Graph();
graph.BaseUri = new Uri(projectGraphName);
var graph = new Graph
{
BaseUri = new Uri(projectGraphName)
};
AssertToGraphUriNode(graph, projectGraphName, rdf + "type", dcat + "Catalog");
Console.WriteLine($"For project '{entry.DisplayName}' will migrate triple '{projectGraphName} {rdf}type {dcat}Catalog'. ");
......@@ -113,9 +118,7 @@ namespace SQL2Linked.Implementations
AssertToGraphUriNode(graph, projectGraphName, foaf + "homepage", projectHandleName);
Console.WriteLine($"For project '{entry.DisplayName}' will migrate triple '{projectGraphName} {foaf}homepage {projectHandleName}'. ");
foreach (var projectRole in projectRoles)
{
if (entry.Id == projectRole.ProjectId)
foreach (var projectRole in projectRoles.Where(p => p.ProjectId.Equals(entry.Id)))
{
AssertToGraphUriNode(graph, projectGraphName, vcard + "hasMember", cosc + "users/" + projectRole.UserId);
Console.WriteLine($"For project '{entry.DisplayName}' will migrate triple '{projectGraphName} {vcard}hasMember {cosc}users/{projectRole.UserId}'. ");
......@@ -134,15 +137,17 @@ namespace SQL2Linked.Implementations
AssertToGraphBlankAndUriNode(graph, blankNode, org + "member", cosc + "users/" + projectRole.UserId);
Console.WriteLine($"For project '{entry.DisplayName}' will migrate triple '{blankNode} {org}member {cosc}users/{projectRole.UserId}'. ");
}
}
foreach (var projectResource in projectResources)
{
if (entry.Id == projectResource.ProjectId)
foreach (var projectResource in projectResources.Where(p => p.ProjectId.Equals(entry.Id)))
{
AssertToGraphUriNode(graph, projectGraphName, dcat + "catalog", $"{resourceUrlPrefix}/{projectResource.ResourceId}");
Console.WriteLine($"For project '{entry.DisplayName}' will migrate triple '{projectGraphName} {dcat}catalog {resourceUrlPrefix}/{projectResource.ResourceId}'. ");
}
foreach (var projectInstitute in projectInstitutes.Where(p => p.ProjectId.Equals(entry.Id)))
{
AssertToGraphUriNode(graph, projectGraphName, org + "organization", projectInstitute.OrganizationUrl);
Console.WriteLine($"For project '{entry.DisplayName}' will migrate triple '{projectGraphName} {org}organization {projectInstitute.OrganizationUrl}'. ");
}
if (entry.Creator is not null)
......
......@@ -5,7 +5,7 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.1.13</Version></PropertyGroup>
<Version>0.1.14</Version></PropertyGroup>
<ItemGroup>
<PackageReference Include="Coscine.Database" Version="2.*-*" />
......
using Polly;
using Coscine.Configuration;
using Coscine.Configuration;
using Coscine.Database.Models;
using Coscine.Metadata;
using Polly;
using VDS.RDF;
namespace SQL2Linked
......