Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metadata
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Coscine
backend
libraries
Metadata
Merge requests
!73
Release: Sprint/2023 07
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Release: Sprint/2023 07
dev
into
master
Overview
0
Commits
4
Pipelines
1
Changes
1
Merged
CoscineBot
requested to merge
dev
into
master
2 years ago
Overview
0
Commits
4
Pipelines
1
Changes
1
Expand
This Merge Request is automatically created
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
5fc20d63
4 commits,
2 years ago
1 file
+
30
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/Metadata/MetadataRdfStoreConnector.cs
+
30
−
1
Options
@@ -138,7 +138,7 @@ namespace Coscine.Metadata
?
g
<{
Uris
.
FdpHasMetadata
}>
?
m
.
?
m
<{
Uris
.
FdpHasMetadata
}>
?
v
.
" + ((path != null) ? "
FILTER
(
contains
(
str
(?
m
),
@path
))
.
" : "") + $@"
" + (extracted ? "
FILTER
(
contains
(
str
(?
v
),
'
&
extracted
=
true
'
))
.
" : "") + $@"
" + (extracted ? "
FILTER
(
contains
(
str
(?
v
),
'
&
extracted
=
true
'
))
.
" : "
FILTER
(!
contains
(
str
(?
v
),
'
&
extracted
=
true
'
))
.
") + $@"
}}
"
;
var
cmdString
=
new
SparqlParameterizedString
@@ -354,5 +354,34 @@ namespace Coscine.Metadata
}
await
AddGraphAsync
(
provenanceGraph
);
}
/// <summary>
/// Invalidates a metadata set in the given provenance graph
/// </summary>
/// <param name="resourceId"></param>
/// <param name="path"></param>
/// <param name="type"></param>
/// <param name="responsibleAgent"></param>
public
void
SetInvalidation
(
string
resourceId
,
string
path
,
string
type
=
"metadata"
,
Uri
?
responsibleAgent
=
null
)
{
if
(!
path
.
StartsWith
(
"/"
))
{
path
=
"/"
+
path
;
}
if
(
responsibleAgent
is
null
)
{
responsibleAgent
=
Uris
.
CoscineUserAgent
;
}
var
urlId
=
new
CoscineLDPHelper
(
this
).
GetId
(
resourceId
,
path
,
true
,
false
,
type
);
var
provenanceGraph
=
GetEmptySmallUpdateGraph
(
$"https://purl.org/coscine/resources/
{
resourceId
}{
path
}
/@type=
{
type
}
"
);
MetadataUtil
.
AssertToGraph
(
provenanceGraph
,
urlId
,
Uris
.
ProvWasInvalidatedBy
,
responsibleAgent
);
AddGraph
(
provenanceGraph
);
}
}
}
Loading