Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • Fix/v0.1.7-dependencies
  • Hotfix/2212-fixFiles
  • Hotfix/2776-workingNewVersion
  • Hotfix/xxxx-changeUrls
  • Hotfix/xxxx-correctAssignments
  • Hotfix/xxxx-coscineGraph
  • Issue/1321-pidEnquiryOverhaul
  • Issue/1781-sqlToLinked
  • Issue/1782-structualDataIntegration
  • Issue/2081-migrateUserStructuralData
  • Issue/2082-migrateRoleStructuralData
  • Issue/2083-migrateResourceTypeStructuralData
  • Issue/2084-migrateResourceStructuralData
  • Issue/2085-migrateProjectStructuralData
  • Issue/2221-projectDateCreated
  • Issue/2222-resourceDateCreated
  • Issue/2304-virtuosoRoars
  • Issue/2518-docs
  • Issue/2666-adminCronjobs
  • Issue/2666-adminCronjobs-theSequal
  • Issue/2847-reporting
  • Issue/2914-trellisMigrator
  • dev
  • gitkeep
  • main
  • v0.1.0
  • v0.1.1
  • v0.1.10
  • v0.1.11
  • v0.1.12
  • v0.1.13
  • v0.1.14
  • v0.1.15
  • v0.1.16
  • v0.1.17
  • v0.1.18
  • v0.1.19
  • v0.1.2
  • v0.1.20
  • v0.1.21
  • v0.1.22
  • v0.1.23
  • v0.1.24
  • v0.1.3
  • v0.1.4
  • v0.1.5
  • v0.1.6
  • v0.1.7
  • v0.1.8
  • v0.1.9
50 results

Target

Select target project
  • coscine/backend/scripts/sql2linked
1 result
Select Git revision
  • Fix/v0.1.7-dependencies
  • Hotfix/2212-fixFiles
  • Hotfix/2776-workingNewVersion
  • Hotfix/xxxx-changeUrls
  • Hotfix/xxxx-correctAssignments
  • Hotfix/xxxx-coscineGraph
  • Issue/1321-pidEnquiryOverhaul
  • Issue/1781-sqlToLinked
  • Issue/1782-structualDataIntegration
  • Issue/2081-migrateUserStructuralData
  • Issue/2082-migrateRoleStructuralData
  • Issue/2083-migrateResourceTypeStructuralData
  • Issue/2084-migrateResourceStructuralData
  • Issue/2085-migrateProjectStructuralData
  • Issue/2221-projectDateCreated
  • Issue/2222-resourceDateCreated
  • Issue/2304-virtuosoRoars
  • Issue/2518-docs
  • Issue/2666-adminCronjobs
  • Issue/2666-adminCronjobs-theSequal
  • Issue/2847-reporting
  • Issue/2914-trellisMigrator
  • dev
  • gitkeep
  • main
  • v0.1.0
  • v0.1.1
  • v0.1.10
  • v0.1.11
  • v0.1.12
  • v0.1.13
  • v0.1.14
  • v0.1.15
  • v0.1.16
  • v0.1.17
  • v0.1.18
  • v0.1.19
  • v0.1.2
  • v0.1.20
  • v0.1.21
  • v0.1.22
  • v0.1.23
  • v0.1.24
  • v0.1.3
  • v0.1.4
  • v0.1.5
  • v0.1.6
  • v0.1.7
  • v0.1.8
  • v0.1.9
50 results
Show changes
Commits on Source (3)
......@@ -36,11 +36,14 @@ namespace SQL2Linked.Implementations
IEnumerable<ProjectResource> projectResources = ProjectResourceModel.GetAll();
var graphs = new List<IGraph>();
string projectUrlPrefix = "https://hdl.handle.net/" + Prefix;
var projectUrlHandlePrefix = "https://hdl.handle.net/" + Prefix;
var projectUrlPrefix = "https://purl.org/coscine/projects";
var resourceUrlPrefix = "https://purl.org/coscine/resources";
foreach (var entry in entries)
{
var projectGraphName = $"{projectUrlPrefix}/{entry.Id}";
var projectHandleName = $"{projectUrlHandlePrefix}/{entry.Id}";
var graph = new Graph();
graph.BaseUri = new Uri(projectGraphName);
......@@ -107,8 +110,8 @@ namespace SQL2Linked.Implementations
AssertToGraphLiteralNode(graph, projectGraphName, cosc + "terms/project#slug", entry.Slug);
Console.WriteLine($"For project '{entry.DisplayName}' will migrate triple '{projectGraphName} {cosc}terms/project#slug {entry.Slug}'. ");
AssertToGraphUriNode(graph, projectGraphName, foaf + "homepage", projectGraphName);
Console.WriteLine($"For project '{entry.DisplayName}' will migrate triple '{projectGraphName} {foaf}homepage {projectGraphName}'. ");
AssertToGraphUriNode(graph, projectGraphName, foaf + "homepage", projectHandleName);
Console.WriteLine($"For project '{entry.DisplayName}' will migrate triple '{projectGraphName} {foaf}homepage {projectHandleName}'. ");
foreach (var projectRole in projectRoles)
{
......@@ -137,8 +140,8 @@ namespace SQL2Linked.Implementations
{
if (entry.Id == projectResource.ProjectId)
{
AssertToGraphUriNode(graph, projectGraphName, dcat + "catalog", $"{projectUrlPrefix}/{projectResource.ResourceId}");
Console.WriteLine($"For project '{entry.DisplayName}' will migrate triple '{projectGraphName} {dcat}catalog {projectUrlPrefix}/{projectResource.ResourceId}'. ");
AssertToGraphUriNode(graph, projectGraphName, dcat + "catalog", $"{resourceUrlPrefix}/{projectResource.ResourceId}");
Console.WriteLine($"For project '{entry.DisplayName}' will migrate triple '{projectGraphName} {dcat}catalog {resourceUrlPrefix}/{projectResource.ResourceId}'. ");
}
}
......
......@@ -38,11 +38,14 @@ namespace SQL2Linked.Implementations
IEnumerable<License> licenses = LicenseModel.GetAll();
var graphs = new List<IGraph>();
string resourceUrlPrefix = "https://hdl.handle.net/" + Prefix;
var resourceUrlHandlePrefix = "https://hdl.handle.net/" + Prefix;
var projectUrlPrefix = "https://purl.org/coscine/projects";
var resourceUrlPrefix = "https://purl.org/coscine/resources";
foreach (var entry in entries)
{
var resourceGraphName = $"{resourceUrlPrefix}/{entry.Id}";
var resourceHandleName = $"{resourceUrlHandlePrefix}/{entry.Id}";
var graph = new Graph();
graph.BaseUri = new Uri(resourceGraphName);
......@@ -53,8 +56,8 @@ namespace SQL2Linked.Implementations
AssertToGraphUriNode(graph, resourceGraphName, rdf + "type", pim + "Storage");
Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{resourceGraphName} {rdf}type {pim}Storage'. ");
AssertToGraphUriNode(graph, resourceGraphName, dcat + "service", cosc + $"resourcetype/{entry.TypeId}");
Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{resourceGraphName} {dcat}service {cosc}resourcetype/{entry.TypeId}'. ");
AssertToGraphUriNode(graph, resourceGraphName, dcat + "service", cosc + $"resourcetypes/{entry.TypeId}");
Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{resourceGraphName} {dcat}service {cosc}resourcetypes/{entry.TypeId}'. ");
AssertToGraphLiteralNode(graph, resourceGraphName, dcterms + "title", entry.ResourceName);
Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{resourceGraphName} {dcterms}title {entry.ResourceName}'. ");
......@@ -122,7 +125,7 @@ namespace SQL2Linked.Implementations
AssertToGraphLiteralNode(graph, resourceGraphName, cosc + "terms/resource#archived", entry.Archived.ToString().ToLower(), new Uri("http://www.w3.org/2001/XMLSchema#boolean"));
Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{resourceGraphName} {cosc}terms/resource#archived {entry.Archived}'. ");
AssertToGraphUriNode(graph, resourceGraphName, foaf + "homepage", resourceGraphName);
AssertToGraphUriNode(graph, resourceGraphName, foaf + "homepage", resourceHandleName);
Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{resourceGraphName} {foaf}homepage {resourceGraphName}'. ");
AssertToGraphLiteralNode(graph, resourceGraphName, cosc + "terms/resource#deleted", entry.Deleted.ToString().ToLower(), new Uri("http://www.w3.org/2001/XMLSchema#boolean"));
......@@ -154,8 +157,8 @@ namespace SQL2Linked.Implementations
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}'. ");
AssertToGraphBlankAndUriNode(graph, blankNode, acl + "agentGroup", $"{projectUrlPrefix}/{projectResource.ProjectId}");
Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{blankNode} {acl}agentGroup {projectUrlPrefix}/{projectResource.ProjectId}'. ");
AssertToGraphBlankAndUriNode(graph, blankNode, acl + "accessTo", resourceGraphName);
Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{blankNode} {acl}accessTo {resourceGraphName}'. ");
......@@ -163,8 +166,11 @@ namespace SQL2Linked.Implementations
AssertToGraphBlankAndUriNode(graph, blankNode, acl + "default", resourceGraphName);
Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{blankNode} {acl}default {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 + "mode", acl + "Read");
Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{blankNode} {acl}accessTo {acl}Read'. ");
AssertToGraphBlankAndUriNode(graph, blankNode, acl + "mode", acl + "Write");
Console.WriteLine($"For resource '{entry.DisplayName}' will migrate triple '{blankNode} {acl}accessTo {acl}Write'. ");
}
}
......
......@@ -6,7 +6,7 @@ namespace SQL2Linked.Implementations
{
public class ResourceTypeStructuralData : StructuralData<ResourceType, ResourceTypeModel>
{
public readonly string ResourceTypeUrlPrefix = "https://purl.org/coscine/resourcetype";
public readonly string ResourceTypeUrlPrefix = "https://purl.org/coscine/resourcetypes";
public readonly Uri rdf = new("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
public readonly Uri dcat = new("http://www.w3.org/ns/dcat#");
public readonly Uri dcterms = new("http://purl.org/dc/terms/");
......
......@@ -5,7 +5,7 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.1.5</Version></PropertyGroup>
<Version>0.1.6</Version></PropertyGroup>
<ItemGroup>
<PackageReference Include="Coscine.Database" Version="2.*-*" />
......
......@@ -62,7 +62,9 @@ namespace SQL2Linked
}
}
public void AssertToGraphUriNode(IGraph graph, string graphSubject, string graphPredicate, string graphObject)
public void AssertToGraphUriNode(IGraph graph, string graphSubject, string graphPredicate, string? graphObject)
{
if (graphObject != null)
{
graph.Assert(
new Triple(
......@@ -72,8 +74,11 @@ namespace SQL2Linked
)
);
}
}
public void AssertToGraphLiteralNode(IGraph graph, string graphSubject, string graphPredicate, string graphObject, Uri? objectType = null)
public void AssertToGraphLiteralNode(IGraph graph, string graphSubject, string graphPredicate, string? graphObject, Uri? objectType = null)
{
if (graphObject != null)
{
graph.Assert(
new Triple(
......@@ -83,8 +88,11 @@ namespace SQL2Linked
)
);
}
}
public void AssertToGraphBlankAndUriNode(IGraph graph, IBlankNode graphSubject, string graphPredicate, string graphObject)
public void AssertToGraphBlankAndUriNode(IGraph graph, IBlankNode graphSubject, string graphPredicate, string? graphObject)
{
if (graphObject != null)
{
graph.Assert(
new Triple(
......@@ -96,3 +104,4 @@ namespace SQL2Linked
}
}
}
}