Skip to content
Snippets Groups Projects
Commit d7881ff6 authored by Sirieam Marie Hunke's avatar Sirieam Marie Hunke
Browse files

More cleaning

parent 94b8fdae
No related branches found
No related tags found
1 merge request!26New: MigrateSQL2Linked to GD
......@@ -157,7 +157,8 @@ public class Deployer
if (hasChanged)
{
_logger.LogDebug("The graph has changed.");
} else
}
else
{
_logger.LogDebug("The graph has not changed.");
}
......@@ -165,7 +166,9 @@ public class Deployer
if (deployedGraph is null)
{
_logger.LogDebug("Deployed graph is null");
} else {
}
else
{
_logger.LogDebug("Deployed hash: {hash}", string.Join(',', deployedGraph.FileHashes));
}
......@@ -230,8 +233,8 @@ public class Deployer
var resourceTypeStructuralGraphs = _resourceTypeStructuralData.ConvertToLinkedDataAsync(resourceTypeInformations);
_logger.LogInformation("Storing the graphs...");
await StoreGraphs(roleStructuralGraphs);
await StoreGraphs(resourceTypeStructuralGraphs);
await StoreSql2LinkedGraphs(roleStructuralGraphs);
await StoreSql2LinkedGraphs(resourceTypeStructuralGraphs);
_logger.LogInformation("All structural graphs stored successfully.\n");
_logger.LogInformation("SQL to Linked Data migration completed successfully.");
......@@ -334,14 +337,14 @@ public class Deployer
/// </summary>
/// <param name="graphs">An asynchronous enumerable of RDF graphs (<see cref="IAsyncEnumerable{IGraph}"/>) to be stored.</param>
/// <returns>A task representing the asynchronous operation of storing the graphs.</returns>
public async Task StoreGraphs(IAsyncEnumerable<IGraph> graphs)
public async Task StoreSql2LinkedGraphs(IAsyncEnumerable<IGraph> graphs)
{
var formatEnum = RdfFormat.TextTurtle;
var format = "text/turtle";
await foreach (var graph in graphs)
{
Console.WriteLine($" ({graph.BaseUri})");
_logger.LogInformation($"Processing graph: {graph.BaseUri}");
try
{
......@@ -368,15 +371,11 @@ public class Deployer
);
}
Console.WriteLine($" - Graph {graph.BaseUri} added successfully");
Console.WriteLine();
_logger.LogInformation($"Graph {graph.BaseUri} added successfully.");
}
catch (Exception e)
{
Console.Error.WriteLine($"Error on ({graph.BaseUri}):");
Console.Error.WriteLine(e);
Console.Error.WriteLine(e.InnerException);
Console.Error.WriteLine();
_logger.LogError(e, $"Error on processing graph: {graph.BaseUri}");
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment