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

adding graph for licenses

parent db5050c6
Branches
No related tags found
1 merge request!9New: Migrate resource structured data to linked data
Pipeline #778574 skipped
...@@ -17,11 +17,13 @@ namespace SQL2Linked.Implementations ...@@ -17,11 +17,13 @@ namespace SQL2Linked.Implementations
public readonly Uri cosc = new("https://purl.org/coscine/"); public readonly Uri cosc = new("https://purl.org/coscine/");
private VisibilityModel VisibilityModel = new VisibilityModel(); private VisibilityModel VisibilityModel = new VisibilityModel();
private ProjectResourceModel ProjectResourceModel = new ProjectResourceModel(); private ProjectResourceModel ProjectResourceModel = new ProjectResourceModel();
private LicenseModel LicenseModel = new LicenseModel();
public override IEnumerable<IGraph> ConvertToLinkedData(IEnumerable<Resource> entries) public override IEnumerable<IGraph> ConvertToLinkedData(IEnumerable<Resource> entries)
{ {
IEnumerable<Visibility> visibilities = VisibilityModel.GetAll(); IEnumerable<Visibility> visibilities = VisibilityModel.GetAll();
IEnumerable<ProjectResource> projectResources = ProjectResourceModel.GetAll(); IEnumerable<ProjectResource> projectResources = ProjectResourceModel.GetAll();
IEnumerable<License> licenses = LicenseModel.GetAll();
var graphs = new List<IGraph>(); var graphs = new List<IGraph>();
string resourceUrlPrefix = "https://hdl.handle.net/" + Prefix; string resourceUrlPrefix = "https://hdl.handle.net/" + Prefix;
...@@ -64,6 +66,15 @@ namespace SQL2Linked.Implementations ...@@ -64,6 +66,15 @@ namespace SQL2Linked.Implementations
} }
} }
foreach (var license in licenses)
{
if (entry.LicenseId == license.Id)
{
AssertToGraphLiteralNode(graph, resourceGraphName, dcterms + "license", license.DisplayName);
Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{resourceGraphName} {dcterms}license {license.DisplayName}'. ");
}
}
if (entry.Keywords.Any()) if (entry.Keywords.Any())
{ {
var listKeywords = entry.Keywords.Split(';').ToList(); var listKeywords = entry.Keywords.Split(';').ToList();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment