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
No related branches found
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.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'. ");
}
}
graphs.Add(graph);
}
return graphs;
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment