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
2b0d6c16
Commit
2b0d6c16
authored
2 years ago
by
Benedikt Heinrichs
Browse files
Options
Downloads
Patches
Plain Diff
Fix: Only migrate users which have the TOS accepted (coscine/issues#1782)
parent
7b438363
No related branches found
No related tags found
1 merge request
!12
Fix: Only migrate users which have the TOS accepted
Pipeline
#786123
passed
2 years ago
Stage: build
Stage: commands
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/SQL2Linked/Implementations/UserStructuralData.cs
+6
-0
6 additions, 0 deletions
src/SQL2Linked/Implementations/UserStructuralData.cs
src/SQL2Linked/StructuralData.cs
+8
-1
8 additions, 1 deletion
src/SQL2Linked/StructuralData.cs
with
14 additions
and
1 deletion
src/SQL2Linked/Implementations/UserStructuralData.cs
+
6
−
0
View file @
2b0d6c16
...
@@ -11,6 +11,12 @@ namespace SQL2Linked.Implementations
...
@@ -11,6 +11,12 @@ namespace SQL2Linked.Implementations
public
readonly
Uri
rdf
=
new
(
"http://www.w3.org/1999/02/22-rdf-syntax-ns#"
);
public
readonly
Uri
rdf
=
new
(
"http://www.w3.org/1999/02/22-rdf-syntax-ns#"
);
public
readonly
Uri
foaf
=
new
(
"http://xmlns.com/foaf/0.1/"
);
public
readonly
Uri
foaf
=
new
(
"http://xmlns.com/foaf/0.1/"
);
// Override to only transform users which have accepted the TOS
public
override
IEnumerable
<
User
>
GetAll
()
{
return
Model
.
GetAllWhere
((
user
)
=>
user
.
Tosaccepteds
.
Any
());
}
public
override
IEnumerable
<
IGraph
>
ConvertToLinkedData
(
IEnumerable
<
User
>
entries
)
public
override
IEnumerable
<
IGraph
>
ConvertToLinkedData
(
IEnumerable
<
User
>
entries
)
{
{
var
graphs
=
new
List
<
IGraph
>();
var
graphs
=
new
List
<
IGraph
>();
...
...
This diff is collapsed.
Click to expand it.
src/SQL2Linked/StructuralData.cs
+
8
−
1
View file @
2b0d6c16
...
@@ -25,11 +25,16 @@ namespace SQL2Linked
...
@@ -25,11 +25,16 @@ namespace SQL2Linked
public
abstract
IEnumerable
<
IGraph
>
ConvertToLinkedData
(
IEnumerable
<
S
>
entries
);
public
abstract
IEnumerable
<
IGraph
>
ConvertToLinkedData
(
IEnumerable
<
S
>
entries
);
public
virtual
IEnumerable
<
S
>
GetAll
()
{
return
Model
.
GetAll
();
}
public
void
Migrate
(
bool
dummyMode
)
public
void
Migrate
(
bool
dummyMode
)
{
{
var
spacer
=
new
string
(
'-'
,
35
);
var
spacer
=
new
string
(
'-'
,
35
);
Console
.
WriteLine
(
$"\n
{
spacer
}
\n
{
typeof
(
T
).
Name
}
\n
{
spacer
}
"
);
Console
.
WriteLine
(
$"\n
{
spacer
}
\n
{
typeof
(
T
).
Name
}
\n
{
spacer
}
"
);
var
graphs
=
ConvertToLinkedData
(
Model
.
GetAll
());
var
graphs
=
ConvertToLinkedData
(
GetAll
());
if
(!
dummyMode
)
if
(!
dummyMode
)
{
{
StoreGraphs
(
graphs
);
StoreGraphs
(
graphs
);
...
@@ -56,6 +61,7 @@ namespace SQL2Linked
...
@@ -56,6 +61,7 @@ namespace SQL2Linked
Console
.
WriteLine
();
Console
.
WriteLine
();
}
}
}
}
public
void
AssertToGraphUriNode
(
IGraph
graph
,
string
graphSubject
,
string
graphPredicate
,
string
graphObject
)
public
void
AssertToGraphUriNode
(
IGraph
graph
,
string
graphSubject
,
string
graphPredicate
,
string
graphObject
)
{
{
graph
.
Assert
(
graph
.
Assert
(
...
@@ -66,6 +72,7 @@ namespace SQL2Linked
...
@@ -66,6 +72,7 @@ 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
)
{
{
graph
.
Assert
(
graph
.
Assert
(
...
...
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