Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Project
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
apis
Project
Merge requests
!53
New: Included metadata in the resource view
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
New: Included metadata in the resource view
Topic/566-metadataResourceView
into
Product/554-metadataResourceView
Overview
0
Commits
2
Pipelines
1
Changes
5
Merged
Benedikt Heinrichs
requested to merge
Topic/566-metadataResourceView
into
Product/554-metadataResourceView
5 years ago
Overview
0
Commits
2
Pipelines
1
Changes
5
Expand
coscine/issues#566
0
0
Merge request reports
Compare
Product/554-metadataResourceView
Product/554-metadataResourceView (base)
and
latest version
latest version
c32d1e7d
2 commits,
5 years ago
5 files
+
25
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
src/Project/Controllers/MetadataController.cs
+
19
−
0
Options
@@ -140,6 +140,25 @@ namespace Coscine.Api.Project.Controllers
var
resource
=
_resourceModel
.
GetById
(
Guid
.
Parse
(
resourceId
));
if
(
_metadataModel
.
IsProjectMember
(
user
,
resource
))
{
json
[
graphName
][
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
]
=
new
JArray
{
new
JObject
{
[
"value"
]
=
resource
.
ApplicationProfile
.
Substring
(
0
,
resource
.
ApplicationProfile
.
Length
-
1
),
[
"type"
]
=
"uri"
}
};
// throw bad request if empty node value is detected
JToken
root
=
json
.
First
.
First
;
foreach
(
var
node
in
root
)
{
string
nodeValue
=
node
.
First
.
First
[
"value"
].
ToString
().
ToLower
();
if
(
String
.
IsNullOrEmpty
(
nodeValue
))
{
throw
new
ArgumentException
(
"Empty values in application profile are not accepted."
);
}
}
var
graph
=
new
Graph
();
graph
.
LoadFromString
(
json
.
ToString
(),
new
RdfJsonParser
());
Loading