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
db5050c6
Commit
db5050c6
authored
2 years ago
by
Hanna Führ
Browse files
Options
Downloads
Patches
Plain Diff
hopefully final fixes
parent
be5306a9
Branches
Branches containing commit
No related tags found
1 merge request
!9
New: Migrate resource structured data to linked data
Pipeline
#778503
skipped
Stage: commands
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/SQL2Linked/Implementations/ResourceStructuralData.cs
+11
-14
11 additions, 14 deletions
src/SQL2Linked/Implementations/ResourceStructuralData.cs
src/SQL2Linked/StructuralData.cs
+1
-1
1 addition, 1 deletion
src/SQL2Linked/StructuralData.cs
with
12 additions
and
15 deletions
src/SQL2Linked/Implementations/ResourceStructuralData.cs
+
11
−
14
View file @
db5050c6
using
Coscine.Database.DataModel
;
using
Coscine.Database.DataModel
;
using
Coscine.Database.Models
;
using
Coscine.Database.Models
;
using
Coscine.Configuration
;
using
VDS.RDF
;
using
VDS.RDF
;
using
VDS.RDF.Query
;
using
VDS.RDF.Query
;
...
@@ -113,27 +112,25 @@ namespace SQL2Linked.Implementations
...
@@ -113,27 +112,25 @@ namespace SQL2Linked.Implementations
Console
.
WriteLine
(
$"For resource '
{
entry
.
DisplayName
}
' will migrate triple '
{
resourceGraphName
}
{
dcat
}
catalog
{
result
[
0
].
ToString
()}
'. "
);
Console
.
WriteLine
(
$"For resource '
{
entry
.
DisplayName
}
' will migrate triple '
{
resourceGraphName
}
{
dcat
}
catalog
{
result
[
0
].
ToString
()}
'. "
);
}
}
var
blankNode
=
graph
.
CreateBlankNode
(
entry
.
Id
.
ToString
());
AssertToGraphBlankAndUriNode
(
graph
,
blankNode
,
rdf
+
"type"
,
acl
+
"Authorization"
);
Console
.
WriteLine
(
$"For resource '
{
entry
.
DisplayName
}
' will migrate triple '
{
blankNode
}
{
rdf
}
type
{
acl
}
Authorization'. "
);
foreach
(
var
projectResource
in
projectResources
)
foreach
(
var
projectResource
in
projectResources
)
{
{
if
(
entry
.
Id
==
projectResource
.
ResourceId
)
if
(
entry
.
Id
==
projectResource
.
ResourceId
)
{
{
var
blankNode
=
graph
.
CreateBlankNode
();
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
}
"
);
AssertToGraphBlankAndUriNode
(
graph
,
blankNode
,
acl
+
"agentGroup"
,
$"
{
resourceUrlPrefix
}
/
{
projectResource
.
ProjectId
}
"
);
Console
.
WriteLine
(
$"For resource '
{
entry
.
DisplayName
}
' will migrate triple '
{
blankNode
}
{
acl
}
agentGroup
{
resourceUrlPrefix
}
/
{
projectResource
.
ProjectId
}
'. "
);
Console
.
WriteLine
(
$"For resource '
{
entry
.
DisplayName
}
' will migrate triple '
{
blankNode
}
{
acl
}
agentGroup
{
resourceUrlPrefix
}
/
{
projectResource
.
ProjectId
}
'. "
);
break
;
}
}
AssertToGraphBlankAndUriNode
(
graph
,
blankNode
,
acl
+
"accessTo"
,
resourceGraphName
);
AssertToGraphBlankAndUriNode
(
graph
,
blankNode
,
acl
+
"accessTo"
,
resourceGraphName
);
Console
.
WriteLine
(
$"For resource '
{
entry
.
DisplayName
}
' will migrate triple '
{
blankNode
}
{
acl
}
accessTo
{
resourceGraphName
}
'. "
);
Console
.
WriteLine
(
$"For resource '
{
entry
.
DisplayName
}
' will migrate triple '
{
blankNode
}
{
acl
}
accessTo
{
resourceGraphName
}
'. "
);
AssertToGraphBlankAndUriNode
(
graph
,
blankNode
,
acl
+
"mode"
,
acl
+
"Control"
);
AssertToGraphBlankAndUriNode
(
graph
,
blankNode
,
acl
+
"mode"
,
acl
+
"Control"
);
Console
.
WriteLine
(
$"For resource '
{
entry
.
DisplayName
}
' will migrate triple '
{
blankNode
}
{
acl
}
accessTo
{
acl
}
Control'. "
);
Console
.
WriteLine
(
$"For resource '
{
entry
.
DisplayName
}
' will migrate triple '
{
blankNode
}
{
acl
}
accessTo
{
acl
}
Control'. "
);
}
}
graphs
.
Add
(
graph
);
graphs
.
Add
(
graph
);
}
}
return
graphs
;
return
graphs
;
...
...
This diff is collapsed.
Click to expand it.
src/SQL2Linked/StructuralData.cs
+
1
−
1
View file @
db5050c6
...
@@ -20,7 +20,7 @@ namespace SQL2Linked
...
@@ -20,7 +20,7 @@ namespace SQL2Linked
RdfStoreConnector
=
new
RdfStoreConnector
(
Configuration
.
GetStringAndWait
(
"coscine/local/virtuoso/additional/url"
));
RdfStoreConnector
=
new
RdfStoreConnector
(
Configuration
.
GetStringAndWait
(
"coscine/local/virtuoso/additional/url"
));
Model
=
new
T
();
Model
=
new
T
();
Prefix
=
Configuration
.
GetStringAndWait
(
"coscine/global/epic/prefix"
);
Prefix
=
Configuration
.
GetStringAndWait
(
"coscine/global/epic/prefix"
);
QueryEndpoint
=
new
SparqlRemoteEndpoint
(
new
Uri
(
string
.
Format
(
"http://localhost:8890/sparq
l"
)));
QueryEndpoint
=
new
SparqlRemoteEndpoint
(
new
Uri
(
Configuration
.
GetStringAndWait
(
"coscine/local/virtuoso/additional/ur
l"
)));
}
}
public
abstract
IEnumerable
<
IGraph
>
ConvertToLinkedData
(
IEnumerable
<
S
>
entries
);
public
abstract
IEnumerable
<
IGraph
>
ConvertToLinkedData
(
IEnumerable
<
S
>
entries
);
...
...
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