Skip to content
Snippets Groups Projects
Commit b4d74d16 authored by Petar Hristov's avatar Petar Hristov :speech_balloon:
Browse files

Fix: XML Docs

parent df035273
No related branches found
No related tags found
2 merge requests!29Fix: Working new version,!27BREAKING: Migrated SQL2Linked to the APIv2 infrastructure
Pipeline #1202630 passed
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using SQL2Linked.Implementations; using SQL2Linked.Implementations;
using SQL2Linked.Models.ConfigurationModels; using SQL2Linked.Models.ConfigurationModels;
using Winton.Extensions.Configuration.Consul; using Winton.Extensions.Configuration.Consul;
...@@ -14,6 +15,13 @@ public class Program ...@@ -14,6 +15,13 @@ public class Program
{ {
InitializeServices(); InitializeServices();
var sql2LinkedConfiguration = _serviceProvider.GetRequiredService<IOptionsMonitor<SQL2LinkedConfiguration>>().CurrentValue;
if (!sql2LinkedConfiguration.IsEnabled)
{
Console.WriteLine("SQL 2 Linked Data migration is disabled. To enable it, set the \"IsEnabled\" property to \"true\" in the configuration.");
return;
}
var dummyMode = !(args.Length > 0 && args[0] == "--noDryRun"); var dummyMode = !(args.Length > 0 && args[0] == "--noDryRun");
if (dummyMode) if (dummyMode)
{ {
...@@ -44,10 +52,6 @@ public class Program ...@@ -44,10 +52,6 @@ public class Program
private static void InitializeServices() private static void InitializeServices()
{ {
// Register custom layout renderers for NLog
//ConfigurationItemFactory.Default.LayoutRenderers.RegisterDefinition("assembly-name", typeof(AssemblyNameLayoutRenderer));
//ConfigurationItemFactory.Default.LayoutRenderers.RegisterDefinition("assembly-version", typeof(AssemblyVersionLayoutRenderer));
// Create a new instance of ConfigurationBuilder // Create a new instance of ConfigurationBuilder
var configBuilder = new ConfigurationBuilder(); var configBuilder = new ConfigurationBuilder();
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
<PackageReference Include="dotNetRdf" Version="3.1.1" /> <PackageReference Include="dotNetRdf" Version="3.1.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.0" /> <PackageReference Include="Microsoft.Extensions.Options" Version="8.0.0" />
<PackageReference Include="NLog" Version="5.2.7" />
</ItemGroup> </ItemGroup>
</Project> </Project>
...@@ -2,35 +2,68 @@ ...@@ -2,35 +2,68 @@
namespace SQL2Linked; namespace SQL2Linked;
/// <summary>
/// Represents a wrapper around a graph structure that maintains separate graphs for asserted and retracted triples.
/// </summary>
public class WrapperGraph : Graph public class WrapperGraph : Graph
{ {
/// <summary>
/// Gets or sets the graph for storing asserted triples.
/// </summary>
public IGraph AssertGraph { get; set; } public IGraph AssertGraph { get; set; }
/// <summary>
/// Gets or sets the graph for storing retracted triples.
/// </summary>
public IGraph RetractGraph { get; set; } public IGraph RetractGraph { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="WrapperGraph"/> class.
/// </summary>
public WrapperGraph() : base() public WrapperGraph() : base()
{ {
AssertGraph = new Graph(); AssertGraph = new Graph();
RetractGraph = new Graph(); RetractGraph = new Graph();
} }
/// <summary>
/// Asserts a single triple into the graph and records it in the assert graph.
/// </summary>
/// <param name="t">The triple to assert.</param>
/// <returns>Returns <c>true</c> if the assertion was successful.</returns>
public override bool Assert(Triple t) public override bool Assert(Triple t)
{ {
AssertGraph.Assert(t); AssertGraph.Assert(t);
return base.Assert(t); return base.Assert(t);
} }
/// <summary>
/// Asserts a collection of triples into the graph and records them in the assert graph.
/// </summary>
/// <param name="triples">The collection of triples to assert.</param>
/// <returns>Returns <c>true</c> if the assertions were successful.</returns>
public override bool Assert(IEnumerable<Triple> triples) public override bool Assert(IEnumerable<Triple> triples)
{ {
AssertGraph.Assert(triples); AssertGraph.Assert(triples);
return base.Assert(triples); return base.Assert(triples);
} }
/// <summary>
/// Retracts a single triple from the graph and records it in the retract graph.
/// </summary>
/// <param name="t">The triple to retract.</param>
/// <returns>Returns <c>true</c> if the retraction was successful.</returns>
public override bool Retract(Triple t) public override bool Retract(Triple t)
{ {
RetractGraph.Assert(t); RetractGraph.Assert(t);
return base.Retract(t); return base.Retract(t);
} }
/// <summary>
/// Retracts a collection of triples from the graph and records them in the retract graph.
/// </summary>
/// <param name="triples">The collection of triples to retract.</param>
/// <returns>Returns <c>true</c> if the retractions were successful.</returns>
public override bool Retract(IEnumerable<Triple> triples) public override bool Retract(IEnumerable<Triple> triples)
{ {
RetractGraph.Assert(triples); RetractGraph.Assert(triples);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment