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

Merge branch 'master' into 'dev'

Hotfix#2615

See merge request !15
parents a4285bf1 ca1f39ce
No related branches found
No related tags found
2 merge requests!18merge dev into master,!15Hotfix#2615
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<AssemblyName>Coscine.GraphDeployer</AssemblyName> <AssemblyName>Coscine.GraphDeployer</AssemblyName>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<Version>1.2.7</Version> <Version>1.2.8</Version>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
... ...
......
...@@ -114,11 +114,12 @@ public class Program ...@@ -114,11 +114,12 @@ public class Program
var currentGraph = Helpers.WrapRequest(() => _rdfStoreConnector.GetGraph(graphName)); var currentGraph = Helpers.WrapRequest(() => _rdfStoreConnector.GetGraph(graphName));
// Project the triples for easier comparison
var projectedGraph = graph.Triples.Select(ProjectTriple).ToList();
var projectedCurrentGraph = currentGraph.Triples.Select(ProjectTriple).ToList();
var graphWasChanged = graph.Triples.Count != currentGraph.Triples.Count var graphWasChanged = graph.Triples.Count != currentGraph.Triples.Count
|| graph.Triples.Any((triple) => !currentGraph.Triples.Any((currentTriple) => || projectedGraph.Except(projectedCurrentGraph).Any();
(triple.Subject.Equals(currentTriple.Subject) || (triple.Subject.NodeType == NodeType.Blank && currentTriple.Subject.NodeType == NodeType.Blank)
&& triple.Predicate.Equals(currentTriple.Predicate)
&& triple.Object.Equals(currentTriple.Object) || (triple.Object.NodeType == NodeType.Blank && currentTriple.Object.NodeType == NodeType.Blank))));
if (graphWasChanged) if (graphWasChanged)
{ {
...@@ -141,9 +142,9 @@ public class Program ...@@ -141,9 +142,9 @@ public class Program
else else
{ {
_logger.LogInformation("Skipping {graphName}", graphName); _logger.LogInformation("Skipping {graphName}", graphName);
} }
} }
queries.Add($"rdf_loader_run ();"); queries.Add($"rdf_loader_run ();");
queries.Add($"DELETE from DB.DBA.load_list where 1=1;"); queries.Add($"DELETE from DB.DBA.load_list where 1=1;");
...@@ -233,4 +234,11 @@ public class Program ...@@ -233,4 +234,11 @@ public class Program
LogInnerException(ex.InnerException); LogInnerException(ex.InnerException);
} }
} }
private static string ProjectTriple(Triple triple)
{
return $"{(triple.Subject.NodeType == NodeType.Blank ? "BLANK" : triple.Subject.ToString())}," +
$"{triple.Predicate.ToString()}," +
$"{(triple.Object.NodeType == NodeType.Blank ? "BLANK" : triple.Object.ToString())}";
}
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment