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
9bbec544
Commit
9bbec544
authored
2 years ago
by
Benedikt Heinrichs
Committed by
Petar Hristov
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Update: Add Delete Column for resources
parent
b6e5604e
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!14
Release: Sprint/2022 17 :robot:
,
!13
Update: Add Delete Column for resources
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/SQL2Linked/Implementations/ProjectStructuralData.cs
+12
-0
12 additions, 0 deletions
src/SQL2Linked/Implementations/ProjectStructuralData.cs
src/SQL2Linked/Implementations/ResourceStructuralData.cs
+15
-0
15 additions, 0 deletions
src/SQL2Linked/Implementations/ResourceStructuralData.cs
with
27 additions
and
0 deletions
src/SQL2Linked/Implementations/ProjectStructuralData.cs
+
12
−
0
View file @
9bbec544
using
Coscine.Database.DataModel
;
using
Coscine.Database.Models
;
using
Coscine.Database.Util
;
using
VDS.RDF
;
namespace
SQL2Linked.Implementations
...
...
@@ -17,6 +18,17 @@ namespace SQL2Linked.Implementations
private
ProjectRoleModel
ProjectRoleModel
=
new
ProjectRoleModel
();
private
ProjectResourceModel
ProjectResourceModel
=
new
ProjectResourceModel
();
// Override to also receive deleted projects
public
override
IEnumerable
<
Project
>
GetAll
()
{
return
DatabaseConnection
.
ConnectToDatabase
((
db
)
=>
{
return
(
from
tableEntry
in
Model
.
GetITableFromDatabase
(
db
)
select
tableEntry
).
ToList
();
});
}
public
override
IEnumerable
<
IGraph
>
ConvertToLinkedData
(
IEnumerable
<
Project
>
entries
)
{
IEnumerable
<
Visibility
>
visibilities
=
VisibilityModel
.
GetAll
();
...
...
This diff is collapsed.
Click to expand it.
src/SQL2Linked/Implementations/ResourceStructuralData.cs
+
15
−
0
View file @
9bbec544
using
Coscine.Database.DataModel
;
using
Coscine.Database.Models
;
using
Coscine.Database.Util
;
using
VDS.RDF
;
using
VDS.RDF.Query
;
...
...
@@ -19,6 +20,17 @@ namespace SQL2Linked.Implementations
private
ProjectResourceModel
ProjectResourceModel
=
new
ProjectResourceModel
();
private
LicenseModel
LicenseModel
=
new
LicenseModel
();
// Override to also receive deleted resources
public
override
IEnumerable
<
Resource
>
GetAll
()
{
return
DatabaseConnection
.
ConnectToDatabase
((
db
)
=>
{
return
(
from
tableEntry
in
Model
.
GetITableFromDatabase
(
db
)
select
tableEntry
).
ToList
();
});
}
public
override
IEnumerable
<
IGraph
>
ConvertToLinkedData
(
IEnumerable
<
Resource
>
entries
)
{
IEnumerable
<
Visibility
>
visibilities
=
VisibilityModel
.
GetAll
();
...
...
@@ -113,6 +125,9 @@ namespace SQL2Linked.Implementations
AssertToGraphUriNode
(
graph
,
resourceGraphName
,
foaf
+
"homepage"
,
resourceGraphName
);
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"
));
Console
.
WriteLine
(
$"For project '
{
entry
.
DisplayName
}
' will migrate triple '
{
resourceGraphName
}
{
cosc
}
terms/resource#deleted
{
entry
.
Deleted
}
'. "
);
SparqlParameterizedString
cmdString
=
new
SparqlParameterizedString
{
CommandText
=
"SELECT DISTINCT ?g "
+
...
...
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