Skip to content
Snippets Groups Projects

Fix: Correct encoding

Merged Sirieam Marie Hunke requested to merge dev into master
1 file
+ 6
3
Compare changes
  • Side-by-side
  • Inline
@@ -7,7 +7,6 @@ using VDS.RDF.Parsing;
using VDS.RDF.Query;
using VDS.RDF;
using System.Threading.Tasks;
using System.Web;
namespace Coscine.Metadata
{
@@ -49,7 +48,9 @@ namespace Coscine.Metadata
public List<string> GetDataIds(string? resourceId = null, string? path = null, bool extracted = false, bool includeInvalidated = false)
{
var resourceGraphUri = $"https://purl.org/coscine/resources/{resourceId}";
var pathGraphUri = path != null ? $"{resourceGraphUri}/{HttpUtility.UrlPathEncode(path.StartsWith("/") ? path[1..] : path)}/" : "";
var pathGraphUri = path != null
? new Uri($"{resourceGraphUri}/{(path.StartsWith("/") ? path[1..] : path)}/").AbsoluteUri
: "";
var query = $@"{{
" + ((resourceId != null) ? $"@resource <{Uris.DcatCatalog}>* ?g ." : "") + $@"
@@ -130,7 +131,9 @@ namespace Coscine.Metadata
public List<string> GetMetadataIds(string? resourceId = null, string? path = null, bool extracted = false)
{
var resourceGraphUri = $"https://purl.org/coscine/resources/{resourceId}";
var pathGraphUri = path != null ? $"{resourceGraphUri}/{HttpUtility.UrlPathEncode(path.StartsWith("/") ? path[1..] : path)}/" : "";
var pathGraphUri = path != null
? new Uri($"{resourceGraphUri}/{(path.StartsWith("/") ? path[1..] : path)}/").AbsoluteUri
: "";
var query = $@"{{
" + ((resourceId != null) ? $"@resource <{Uris.DcatCatalog}>* ?g ." : "") + $@"
Loading