diff --git a/src/SQL2Linked/Implementations/ProjectStructuralData.cs b/src/SQL2Linked/Implementations/ProjectStructuralData.cs index da1d4cd0f0bfe29e3f4ae85f82a882a2165cf8dd..6b5a7a6f28ff1d6259a348532bed237f2fbadadd 100644 --- a/src/SQL2Linked/Implementations/ProjectStructuralData.cs +++ b/src/SQL2Linked/Implementations/ProjectStructuralData.cs @@ -63,10 +63,10 @@ namespace SQL2Linked.Implementations AssertToGraphLiteralNode(graph, projectGraphName, dcterms + "description", entry.Description); Console.WriteLine($"For project '{entry.DisplayName}' will migrate triple '{projectGraphName} {dcterms}description {entry.Description}'. "); - AssertToGraphLiteralNode(graph, projectGraphName, dcat + "startDate", entry.StartDate.ToString()); + AssertToGraphLiteralNode(graph, projectGraphName, dcat + "startDate", entry.StartDate.ToString(), new Uri("http://www.w3.org/2001/XMLSchema#dateTime")); Console.WriteLine($"For project '{entry.DisplayName}' will migrate triple '{projectGraphName} {dcat}startDate {entry.StartDate}'. "); - AssertToGraphLiteralNode(graph, projectGraphName, dcat + "endDate", entry.EndDate.ToString()); + AssertToGraphLiteralNode(graph, projectGraphName, dcat + "endDate", entry.EndDate.ToString(), new Uri("http://www.w3.org/2001/XMLSchema#dateTime")); Console.WriteLine($"For project '{entry.DisplayName}' will migrate triple '{projectGraphName} {dcat}endDate {entry.EndDate}'. "); if (!string.IsNullOrWhiteSpace(entry.Keywords)) @@ -145,6 +145,19 @@ namespace SQL2Linked.Implementations } } + if (entry.Creator is not null) + { + AssertToGraphUriNode(graph, projectGraphName, dcterms + "creator", cosc + $"users/{entry.Creator}"); + Console.WriteLine($"For project '{entry.DisplayName}' will migrate triple '{projectGraphName} {dcterms}creator {cosc}users/{entry.Creator}'. "); + } + + + if (entry.DateCreated is not null && entry.DateCreated.HasValue) + { + AssertToGraphLiteralNode(graph, projectGraphName, dcterms + "created", entry.DateCreated.Value.ToString(), new Uri("http://www.w3.org/2001/XMLSchema#dateTime")); + Console.WriteLine($"For project '{entry.DisplayName}' will migrate triple '{projectGraphName} {dcterms}created {entry.DateCreated}'. "); + } + graphs.Add(graph); } return graphs; diff --git a/src/SQL2Linked/Implementations/ResourceStructuralData.cs b/src/SQL2Linked/Implementations/ResourceStructuralData.cs index 18f4d0c668c7c83900ebef7a2cc670e34247fb62..8ae9f0ec5918a5dd6464b31fb5fd6c10c1325001 100644 --- a/src/SQL2Linked/Implementations/ResourceStructuralData.cs +++ b/src/SQL2Linked/Implementations/ResourceStructuralData.cs @@ -119,8 +119,11 @@ namespace SQL2Linked.Implementations AssertToGraphLiteralNode(graph, resourceGraphName, cosc + "terms/resource#fixedValues", entry.FixedValues); Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{resourceGraphName} {cosc}terms/resource#fixedValues {entry.FixedValues}'. "); - AssertToGraphUriNode(graph, resourceGraphName, dcterms + "creator", cosc + $"users/{entry.Creator}"); - Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{resourceGraphName} {dcterms}creator {cosc}users/{entry.Creator}'. "); + if (entry.Creator is not null) + { + AssertToGraphUriNode(graph, resourceGraphName, dcterms + "creator", cosc + $"users/{entry.Creator}"); + Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{resourceGraphName} {dcterms}creator {cosc}users/{entry.Creator}'. "); + } AssertToGraphLiteralNode(graph, resourceGraphName, cosc + "terms/resource#archived", entry.Archived.ToString().ToLower(), new Uri("http://www.w3.org/2001/XMLSchema#boolean")); Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{resourceGraphName} {cosc}terms/resource#archived {entry.Archived}'. "); @@ -174,6 +177,12 @@ namespace SQL2Linked.Implementations } } + if (entry.DateCreated is not null && entry.DateCreated.HasValue) + { + AssertToGraphLiteralNode(graph, resourceGraphName, dcterms + "created", entry.DateCreated.Value.ToString(), new Uri("http://www.w3.org/2001/XMLSchema#dateTime")); + Console.WriteLine($"For project '{entry.DisplayName}' will migrate triple '{resourceGraphName} {dcterms}created {entry.DateCreated}'. "); + } + graphs.Add(graph); }