Skip to content
Snippets Groups Projects
Commit db5050c6 authored by Hanna Führ's avatar Hanna Führ
Browse files

hopefully final fixes

parent be5306a9
Branches
No related tags found
1 merge request!9New: Migrate resource structured data to linked data
Pipeline #778503 skipped
using Coscine.Database.DataModel; using Coscine.Database.DataModel;
using Coscine.Database.Models; using Coscine.Database.Models;
using Coscine.Configuration;
using VDS.RDF; using VDS.RDF;
using VDS.RDF.Query; using VDS.RDF.Query;
...@@ -113,27 +112,25 @@ namespace SQL2Linked.Implementations ...@@ -113,27 +112,25 @@ namespace SQL2Linked.Implementations
Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{resourceGraphName} {dcat}catalog {result[0].ToString()}'. "); 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) foreach (var projectResource in projectResources)
{ {
if (entry.Id == projectResource.ResourceId) 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}"); AssertToGraphBlankAndUriNode(graph, blankNode, acl + "agentGroup", $"{resourceUrlPrefix}/{projectResource.ProjectId}");
Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{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); AssertToGraphBlankAndUriNode(graph, blankNode, acl + "accessTo", resourceGraphName);
Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{blankNode} {acl}accessTo {resourceGraphName}'. "); Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{blankNode} {acl}accessTo {resourceGraphName}'. ");
AssertToGraphBlankAndUriNode(graph, blankNode, acl + "mode", acl + "Control"); AssertToGraphBlankAndUriNode(graph, blankNode, acl + "mode", acl + "Control");
Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{blankNode} {acl}accessTo {acl}Control'. "); Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{blankNode} {acl}accessTo {acl}Control'. ");
}
}
graphs.Add(graph); graphs.Add(graph);
} }
return graphs; return graphs;
......
...@@ -20,7 +20,7 @@ namespace SQL2Linked ...@@ -20,7 +20,7 @@ namespace SQL2Linked
RdfStoreConnector = new RdfStoreConnector(Configuration.GetStringAndWait("coscine/local/virtuoso/additional/url")); RdfStoreConnector = new RdfStoreConnector(Configuration.GetStringAndWait("coscine/local/virtuoso/additional/url"));
Model = new T(); Model = new T();
Prefix = Configuration.GetStringAndWait("coscine/global/epic/prefix"); 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); public abstract IEnumerable<IGraph> ConvertToLinkedData(IEnumerable<S> entries);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment