Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • Hotfix/1357-ymlFile
  • Hotfix/1370-swaggerDescription
  • Hotfix/1917-vocabCheck
  • Hotfix/2087-efNet6
  • Hotfix/2097-fixTimeFormat
  • Hotfix/82-updateDepsOfAPIs
  • Hotfix/xxxx-notExposedGraphs
  • Issue/1746-ApplicationProfileStoringMethod
  • Issue/1804-fixedValueFix
  • Issue/1826-versioning
  • Issue/1910-MigrationtoNET6.0
  • Issue/1938-internalHandling
  • Issue/2158-emailServicedesk
  • Issue/2309-docs
  • Product/1287-dotnet5Sharepoint
  • Product/1549-speedupQuerying
  • Product/934-documantationOfMetadataAPI
  • Sprint/2020-20
  • Sprint/2020-21
  • Sprint/2020-22
  • Sprint/2021-03
  • Sprint/2021-05
  • Sprint/2021-08
  • Sprint/2021-11
  • Sprint/2021-12
  • Sprint/2021-23
  • Sprint/2022-01
  • Topic/1082-documantationOfMetadatAPI
  • Topic/1335-dotnet5Apis
  • Topic/1598-speedupQuerying
  • dev
  • devops-aczepiel
  • gitkeep
  • master
  • v1.1.0
  • v1.1.1
  • v1.2.0
  • v1.2.1
  • v1.3.0
  • v1.3.1
  • v1.3.2
  • v1.4.0
  • v1.5.0
  • v1.5.1
  • v1.6.0
  • v1.7.0
  • v1.7.1
  • v2.0.0
  • v2.0.1
  • v2.0.2
  • v2.0.3
  • v2.0.4
  • v2.1.0
  • v2.1.1
  • v2.2.0
  • v2.2.1
  • v3.0.0
  • v3.0.1
  • v3.0.2
  • v3.1.0
  • v3.1.1
  • v3.1.2
  • v3.2.0
  • v3.2.1
  • v3.2.2
  • v3.2.3
66 results

Target

Select target project
  • coscine/backend/apis/metadata
1 result
Select Git revision
  • Hotfix/1357-ymlFile
  • Hotfix/1370-swaggerDescription
  • Hotfix/1917-vocabCheck
  • Hotfix/2087-efNet6
  • Hotfix/2097-fixTimeFormat
  • Hotfix/82-updateDepsOfAPIs
  • Hotfix/xxxx-notExposedGraphs
  • Issue/1746-ApplicationProfileStoringMethod
  • Issue/1804-fixedValueFix
  • Issue/1826-versioning
  • Issue/1910-MigrationtoNET6.0
  • Issue/1938-internalHandling
  • Issue/2158-emailServicedesk
  • Issue/2309-docs
  • Product/1287-dotnet5Sharepoint
  • Product/1549-speedupQuerying
  • Product/934-documantationOfMetadataAPI
  • Sprint/2020-20
  • Sprint/2020-21
  • Sprint/2020-22
  • Sprint/2021-03
  • Sprint/2021-05
  • Sprint/2021-08
  • Sprint/2021-11
  • Sprint/2021-12
  • Sprint/2021-23
  • Sprint/2022-01
  • Topic/1082-documantationOfMetadatAPI
  • Topic/1335-dotnet5Apis
  • Topic/1598-speedupQuerying
  • dev
  • devops-aczepiel
  • gitkeep
  • master
  • v1.1.0
  • v1.1.1
  • v1.2.0
  • v1.2.1
  • v1.3.0
  • v1.3.1
  • v1.3.2
  • v1.4.0
  • v1.5.0
  • v1.5.1
  • v1.6.0
  • v1.7.0
  • v1.7.1
  • v2.0.0
  • v2.0.1
  • v2.0.2
  • v2.0.3
  • v2.0.4
  • v2.1.0
  • v2.1.1
  • v2.2.0
  • v2.2.1
  • v3.0.0
  • v3.0.1
  • v3.0.2
  • v3.1.0
  • v3.1.1
  • v3.1.2
  • v3.2.0
  • v3.2.1
  • v3.2.2
  • v3.2.3
66 results
Show changes
Commits on Source (4)
using Coscine.Action;
using Coscine.Action.EventArgs;
using Coscine.Api.Metadata.ParameterObjects;
using Coscine.Api.Metadata.Util;
using Coscine.ApiCommons;
using Coscine.Configuration;
using Coscine.Database.Models;
......@@ -19,6 +20,7 @@ using System.Net;
using System.Threading.Tasks;
using System.Web;
using VDS.RDF;
using VDS.RDF.Parsing;
using VDS.RDF.Writing;
namespace Coscine.Api.Metadata.Controllers
......@@ -215,6 +217,10 @@ namespace Coscine.Api.Metadata.Controllers
return BadRequest("The mime type has to be text/turtle");
}
var graph = new Graph();
graph.LoadFromString(applicationProfile.Definition, new TurtleParser());
graph.BaseUri = new CustomUri(applicationProfile.BaseURL);
await gitLabClient.Branches.CreateAsync(ApplicationProfileProjectURL, new CreateBranchRequest(newBranchName, "master"));
var folderName = applicationProfile.BaseURL.Replace(ApplicationProfileUrl, "");
......@@ -223,12 +229,14 @@ namespace Coscine.Api.Metadata.Controllers
folderName = folderName[..(folderName.Length - 1)];
}
var serialization = StringWriter.Write(graph, new CompressingTurtleWriter());
var actions = new List<CreateCommitRequestAction>
{
new CreateCommitRequestAction(
new CreateCommitRequestActionType(),
$"profiles/{folderName}/index.ttl") {
Content = applicationProfile.Definition
Content = serialization
}
};
......
......@@ -5,7 +5,7 @@
<AssemblyName>Coscine.Api.Metadata</AssemblyName>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TargetFramework>net5.0</TargetFramework>
<Version>3.0.0</Version>
<Version>3.0.1</Version>
</PropertyGroup>
<PropertyGroup>
<Authors>RWTH Aachen University</Authors>
......
using System;
namespace Coscine.Api.Metadata.Util
{
/// <summary>
/// Adapts the returned ToString of a Uri
/// </summary>
public class CustomUri : Uri
{
/// <summary>
/// Constructs a Custom Uri
/// </summary>
/// <param name="uri"></param>
public CustomUri(string uri) : base(uri)
{
}
/// <summary>
/// Overwrites the ToString for returning the AbsoluteUri (for dotNetRDF)
/// </summary>
/// <returns></returns>
public override string ToString()
{
return AbsoluteUri;
}
}
}
\ No newline at end of file