diff --git a/src/SQL2Linked/Implementations/ResourceStructuralData.cs b/src/SQL2Linked/Implementations/ResourceStructuralData.cs index 891ff8a207693a67770449627ea31ee282280460..6a4ed8fdc16fcae45aae9a952ed3d88e2dc17114 100644 --- a/src/SQL2Linked/Implementations/ResourceStructuralData.cs +++ b/src/SQL2Linked/Implementations/ResourceStructuralData.cs @@ -1,6 +1,5 @@ using Coscine.Database.DataModel; using Coscine.Database.Models; -using Coscine.Configuration; using VDS.RDF; using VDS.RDF.Query; @@ -113,27 +112,25 @@ namespace SQL2Linked.Implementations Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{resourceGraphName} {dcat}catalog {result[0].ToString()}'. "); } - var blankNode= graph.CreateBlankNode(entry.Id.ToString()); - - AssertToGraphBlankAndUriNode(graph, blankNode, rdf + "type", acl + "Authorization"); - Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{blankNode} {rdf}type {acl}Authorization'. "); - foreach (var projectResource in projectResources) { if (entry.Id == projectResource.ResourceId) { + var blankNode = graph.CreateBlankNode(); + + AssertToGraphBlankAndUriNode(graph, blankNode, rdf + "type", acl + "Authorization"); + Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{blankNode} {rdf}type {acl}Authorization'. "); + AssertToGraphBlankAndUriNode(graph, blankNode, acl + "agentGroup", $"{resourceUrlPrefix}/{projectResource.ProjectId}"); Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{blankNode} {acl}agentGroup {resourceUrlPrefix}/{projectResource.ProjectId}'. "); - break; - } - } - - AssertToGraphBlankAndUriNode(graph, blankNode, acl + "accessTo", resourceGraphName); - Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{blankNode} {acl}accessTo {resourceGraphName}'. "); - AssertToGraphBlankAndUriNode(graph, blankNode, acl + "mode", acl + "Control"); - Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{blankNode} {acl}accessTo {acl}Control'. "); + AssertToGraphBlankAndUriNode(graph, blankNode, acl + "accessTo", resourceGraphName); + Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{blankNode} {acl}accessTo {resourceGraphName}'. "); + AssertToGraphBlankAndUriNode(graph, blankNode, acl + "mode", acl + "Control"); + Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{blankNode} {acl}accessTo {acl}Control'. "); + } + } graphs.Add(graph); } return graphs; diff --git a/src/SQL2Linked/StructuralData.cs b/src/SQL2Linked/StructuralData.cs index a9c9ec01326c59d365c678948bd1f2fcc9093fbf..4d2e231cd558ffd42b71463673b1b671e4a49fc3 100644 --- a/src/SQL2Linked/StructuralData.cs +++ b/src/SQL2Linked/StructuralData.cs @@ -20,7 +20,7 @@ namespace SQL2Linked RdfStoreConnector = new RdfStoreConnector(Configuration.GetStringAndWait("coscine/local/virtuoso/additional/url")); Model = new T(); Prefix = Configuration.GetStringAndWait("coscine/global/epic/prefix"); - QueryEndpoint = new SparqlRemoteEndpoint(new Uri(string.Format("http://localhost:8890/sparql"))); + QueryEndpoint = new SparqlRemoteEndpoint(new Uri(Configuration.GetStringAndWait("coscine/local/virtuoso/additional/url"))); } public abstract IEnumerable<IGraph> ConvertToLinkedData(IEnumerable<S> entries);