Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SQL2Linked
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coscine
backend
scripts
SQL2Linked
Commits
108c0d28
Commit
108c0d28
authored
2 years ago
by
Hanna Führ
Browse files
Options
Downloads
Patches
Plain Diff
adding graph for licenses
parent
db5050c6
Branches
Branches containing commit
No related tags found
1 merge request
!9
New: Migrate resource structured data to linked data
Pipeline
#778574
skipped
Stage: commands
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/SQL2Linked/Implementations/ResourceStructuralData.cs
+15
-4
15 additions, 4 deletions
src/SQL2Linked/Implementations/ResourceStructuralData.cs
with
15 additions
and
4 deletions
src/SQL2Linked/Implementations/ResourceStructuralData.cs
+
15
−
4
View file @
108c0d28
...
@@ -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
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment