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
Loading items

Target

Select target project
  • coscine/backend/apis/coscine
1 result
Select Git revision
Loading items
Show changes
Commits on Source (7)
Showing
with 356 additions and 248 deletions
{
"metrics": {
"http_reqs": {
"count": 300,
"rate": 4.4762444205701275
},
"http_req_tls_handshaking": {
"p(90)": 0,
"p(95)": 0,
"avg": 4.401774746666667,
"min": 0,
"med": 0,
"max": 275.919765
},
"http_req_duration{expected_response:true}": {
"p(90)": 72.12610670000008,
"p(95)": 140.51680450000035,
"avg": 35.58199907666662,
"min": 1.546874,
"med": 2.582121,
"max": 1094.595522
},
"http_req_connecting": {
"med": 0,
"max": 0.858071,
"p(90)": 0,
"p(95)": 0,
"avg": 0.009298450000000002,
"min": 0
},
"http_req_blocked": {
"max": 282.099224,
"p(90)": 0.0006356000000000004,
"p(95)": 0.0008454000000000002,
"avg": 4.507804986666669,
"min": 0.000233,
"med": 0.000451
},
"data_sent": {
"count": 19720,
"rate": 294.2384665788097
},
"data_received": {
"count": 325350,
"rate": 4854.487074108303
},
"http_req_waiting": {
"avg": 34.124514629999986,
"min": 1.409204,
"med": 2.332399,
"max": 1094.434262,
"p(90)": 72.02210490000009,
"p(95)": 138.1861074
},
"http_req_receiving": {
"avg": 1.3509045733333336,
"min": 0.017018,
"med": 0.050234,
"max": 236.993648,
"p(90)": 0.34432190000000007,
"p(95)": 2.9099318000000016
},
"vus": {
"value": 1,
"min": 1,
"max": 5
},
"group_duration": {
"avg": 40.217296223333335,
"min": 1.668113,
"med": 2.7076314999999997,
"max": 1094.735179,
"p(90)": 75.48487830000003,
"p(95)": 190.9777585
},
"iterations": {
"count": 20,
"rate": 0.2984162947046752
},
"http_req_failed": {
"fails": 300,
"passes": 0,
"thresholds": {
"rate<0.01": false
},
"value": 0
},
"iteration_duration": {
"p(95)": 18723.84871585,
"avg": 15105.557983045454,
"min": 0.002336,
"med": 16056.325516,
"max": 18854.414839,
"p(90)": 18095.896551899998
},
"http_req_sending": {
"p(95)": 0.14948320000000007,
"avg": 0.10657987333333342,
"min": 0.031869,
"med": 0.1054615,
"max": 0.222895,
"p(90)": 0.1383043
},
"vus_max": {
"value": 5,
"min": 5,
"max": 5
},
"checks": {
"fails": 0,
"passes": 300,
"value": 1
},
"http_req_duration": {
"min": 1.546874,
"med": 2.582121,
"max": 1094.595522,
"p(90)": 72.12610670000008,
"p(95)": 140.51680450000035,
"avg": 35.58199907666662,
"thresholds": {
"p(95)<200": false
}
}
},
"setup_data": {
"ENVIRONMENT": {
"execution": "d-sp10",
"optionsSet": ".load"
"optionsSet": ".load",
"execution": "d-sp10"
},
"IDS": {
"projectId": "k6-test-50373811",
"projectInvitationId": "279e4bbe-32b1-45af-9fe5-949970cab09d",
"resourceTypeId": "2629a6f9-2129-432a-9304-123dbbfa7685",
"visibilityId": "8ab9c883-eb0d-4402-aaad-2e4007badce6",
"vocabularyInstance": "",
"disciplineId": "cfd6b656-f4ba-48c6-b5d8-2f98a7b60d1f",
"languageId": "922c0fef-d9ab-4f36-bd77-eed0384d19b9",
"projectId": "k6-test-50373811"
"languageId": "922c0fef-d9ab-4f36-bd77-eed0384d19b9"
},
"SETTINGS": {
"baseUrl": "https://d-sp10.devlef.campus.rwth-aachen.de"
},
"TEST_FILTERS": {
"endsWith": null,
"regex": null,
"startsWith": null,
"contains": null,
"enabled": false
"enabled": false,
"endsWith": null
},
"options": {
"headers": {
......@@ -154,16 +30,13 @@
}
},
"root_group": {
"name": "",
"path": "",
"id": "d41d8cd98f00b204e9800998ecf8427e",
"groups": {
"setup": {
"name": "setup",
"path": "::setup",
"id": "5c0f8025f7e0b6654089e5b00e950f1a",
"groups": {},
"checks": {},
"name": "setup"
"checks": {}
},
"/api/v2/disciplines": {
"name": "/api/v2/disciplines",
......@@ -181,19 +54,19 @@
}
},
"/api/v2/disciplines/{disciplineId}": {
"name": "/api/v2/disciplines/{disciplineId}",
"path": "::/api/v2/disciplines/{disciplineId}",
"id": "f36324074a7c500cfd9ef62a50033645",
"groups": {},
"checks": {
"Returns the discipline.": {
"name": "Returns the discipline.",
"path": "::/api/v2/disciplines/{disciplineId}::Returns the discipline.",
"id": "51bf12dd4bdd997d973a099f18bcf23b",
"passes": 20,
"fails": 0,
"name": "Returns the discipline.",
"path": "::/api/v2/disciplines/{disciplineId}::Returns the discipline."
"fails": 0
}
}
},
"name": "/api/v2/disciplines/{disciplineId}",
"path": "::/api/v2/disciplines/{disciplineId}",
"id": "f36324074a7c500cfd9ef62a50033645",
"groups": {}
},
"/api/v2/languages/{languageId}": {
"name": "/api/v2/languages/{languageId}",
......@@ -202,45 +75,47 @@
"groups": {},
"checks": {
"Returns the language.": {
"passes": 20,
"fails": 0,
"name": "Returns the language.",
"path": "::/api/v2/languages/{languageId}::Returns the language.",
"id": "d38e9af09e3ce48933353ede0fb217d5"
"id": "d38e9af09e3ce48933353ede0fb217d5",
"passes": 20
}
}
},
"/api/v2/languages": {
"name": "/api/v2/languages",
"path": "::/api/v2/languages",
"id": "2118d4ecae2c13f0f6d783c0a6f84005",
"groups": {},
"checks": {
"Returns the languages.": {
"passes": 20,
"fails": 0,
"name": "Returns the languages.",
"path": "::/api/v2/languages::Returns the languages.",
"id": "8bcdf2faa4105ccd823d06d1d84bd002"
"id": "8bcdf2faa4105ccd823d06d1d84bd002",
"passes": 20,
"fails": 0
}
}
},
"name": "/api/v2/languages",
"path": "::/api/v2/languages"
},
"/api/v2/projects/{projectId}/invitations": {
"name": "/api/v2/projects/{projectId}/invitations",
"path": "::/api/v2/projects/{projectId}/invitations",
"id": "8a0c8fee7c82df2c742c9b9c6bd3f841",
"groups": {},
"checks": {
"Returns the project invitations.": {
"name": "Returns the project invitations.",
"path": "::/api/v2/projects/{projectId}/invitations::Returns the project invitations.",
"id": "f1f183a26a2a71ce18b246f31f164455",
"passes": 20,
"fails": 0
"fails": 0,
"name": "Returns the project invitations."
}
}
},
"name": "/api/v2/projects/{projectId}/invitations",
"path": "::/api/v2/projects/{projectId}/invitations",
"id": "8a0c8fee7c82df2c742c9b9c6bd3f841",
"groups": {}
},
"/api/v2/projects/{projectId}/invitations/{projectInvitationId}": {
"name": "/api/v2/projects/{projectId}/invitations/{projectInvitationId}",
"path": "::/api/v2/projects/{projectId}/invitations/{projectInvitationId}",
"id": "1680904f72a040b30c78520ef607f08b",
"groups": {},
"checks": {
......@@ -251,49 +126,50 @@
"passes": 20,
"fails": 0
}
},
"name": "/api/v2/projects/{projectId}/invitations/{projectInvitationId}",
"path": "::/api/v2/projects/{projectId}/invitations/{projectInvitationId}"
}
},
"/api/v2/resource-types/types/{resourceTypeId}": {
"path": "::/api/v2/resource-types/types/{resourceTypeId}",
"id": "878da300455fc27d4ec3c69fcba346aa",
"groups": {},
"checks": {
"Returns the resource type information.": {
"passes": 20,
"fails": 0,
"name": "Returns the resource type information.",
"path": "::/api/v2/resource-types/types/{resourceTypeId}::Returns the resource type information.",
"id": "3860f7fdfa6a5767632dc1bf8ab230c2"
"id": "3860f7fdfa6a5767632dc1bf8ab230c2",
"passes": 20
}
},
"name": "/api/v2/resource-types/types/{resourceTypeId}"
"name": "/api/v2/resource-types/types/{resourceTypeId}",
"path": "::/api/v2/resource-types/types/{resourceTypeId}",
"id": "878da300455fc27d4ec3c69fcba346aa",
"groups": {}
},
"/api/v2/resource-types/types": {
"name": "/api/v2/resource-types/types",
"path": "::/api/v2/resource-types/types",
"id": "ad3e820302f4decffcfbbdbdac1b9bd8",
"groups": {},
"checks": {
"Returns the entire global resource types information.": {
"path": "::/api/v2/resource-types/types::Returns the entire global resource types information.",
"id": "a1cad3191f104b051ad66f4dd55cbaa4",
"passes": 20,
"fails": 0,
"name": "Returns the entire global resource types information."
}
"name": "Returns the entire global resource types information.",
"path": "::/api/v2/resource-types/types::Returns the entire global resource types information.",
"id": "a1cad3191f104b051ad66f4dd55cbaa4"
}
},
"name": "/api/v2/resource-types/types",
"path": "::/api/v2/resource-types/types",
"id": "ad3e820302f4decffcfbbdbdac1b9bd8"
},
"/api/v2/users": {
"name": "/api/v2/users",
"path": "::/api/v2/users",
"id": "896a4f2ca6897689d0f4be51626bbda2",
"groups": {},
"checks": {
"Success": {
"id": "70e29d5f8b2b68ac87d6c2de6513cd3c",
"passes": 20,
"fails": 0,
"name": "Success",
"path": "::/api/v2/users::Success",
"id": "70e29d5f8b2b68ac87d6c2de6513cd3c",
"passes": 20
"path": "::/api/v2/users::Success"
},
"Returns the users.": {
"name": "Returns the users.",
......@@ -302,25 +178,22 @@
"passes": 20,
"fails": 0
}
},
"name": "/api/v2/users",
"path": "::/api/v2/users",
"id": "896a4f2ca6897689d0f4be51626bbda2"
}
},
"/api/v2/visibilities/{visibilityId}": {
"id": "03c19d44f60b7cc2614029b12258a3f2",
"groups": {},
"checks": {
"Returns the visibility.": {
"name": "Returns the visibility.",
"path": "::/api/v2/visibilities/{visibilityId}::Returns the visibility.",
"id": "d04fa19a1f9ec3bfa4271163aa08ccc2",
"passes": 20,
"fails": 0,
"name": "Returns the visibility."
"fails": 0
}
},
"name": "/api/v2/visibilities/{visibilityId}",
"path": "::/api/v2/visibilities/{visibilityId}",
"id": "03c19d44f60b7cc2614029b12258a3f2"
"path": "::/api/v2/visibilities/{visibilityId}"
},
"/api/v2/visibilities": {
"name": "/api/v2/visibilities",
......@@ -329,58 +202,58 @@
"groups": {},
"checks": {
"Returns the visibilities.": {
"passes": 20,
"fails": 0,
"name": "Returns the visibilities.",
"path": "::/api/v2/visibilities::Returns the visibilities.",
"id": "fb0dd252406bef802fcc9a6128b76442"
"id": "fb0dd252406bef802fcc9a6128b76442",
"passes": 20,
"fails": 0
}
}
},
"/api/v2/vocabularies": {
"name": "/api/v2/vocabularies",
"path": "::/api/v2/vocabularies",
"id": "c7e1838c7fd580dc1960e102095f6ffc",
"groups": {},
"checks": {
"Returns the top-level vocabularies.": {
"name": "Returns the top-level vocabularies.",
"path": "::/api/v2/vocabularies::Returns the top-level vocabularies.",
"id": "c6a8d1f309c9ea0c3ca87fb57bf365d4",
"passes": 20,
"fails": 0,
"name": "Returns the top-level vocabularies.",
"path": "::/api/v2/vocabularies::Returns the top-level vocabularies."
"fails": 0
}
}
},
"name": "/api/v2/vocabularies",
"path": "::/api/v2/vocabularies",
"id": "c7e1838c7fd580dc1960e102095f6ffc",
"groups": {}
},
"/api/v2/maintenances": {
"id": "08d1836f1ea48078fa93c26491d28c3f",
"groups": {},
"checks": {
"Returns the maintenances.": {
"name": "Returns the maintenances.",
"path": "::/api/v2/maintenances::Returns the maintenances.",
"id": "1301ad3d900bc359a73b871486885717",
"passes": 20,
"fails": 0
"fails": 0,
"name": "Returns the maintenances."
}
},
"name": "/api/v2/maintenances",
"path": "::/api/v2/maintenances"
"path": "::/api/v2/maintenances",
"id": "08d1836f1ea48078fa93c26491d28c3f"
},
"/api/v2/self": {
"id": "69808839e3605a4f14dd28c5ba6c9f0a",
"groups": {},
"checks": {
"Returns the current authenticated user.": {
"fails": 0,
"name": "Returns the current authenticated user.",
"path": "::/api/v2/self::Returns the current authenticated user.",
"id": "edd6c7652f6a800afa982554e68b95b5",
"passes": 20,
"fails": 0
"passes": 20
}
},
"name": "/api/v2/self",
"path": "::/api/v2/self",
"id": "69808839e3605a4f14dd28c5ba6c9f0a",
"groups": {}
"path": "::/api/v2/self"
},
"teardown": {
"name": "teardown",
......@@ -390,6 +263,133 @@
"checks": {}
}
},
"checks": {}
"checks": {},
"name": "",
"path": "",
"id": "d41d8cd98f00b204e9800998ecf8427e"
},
"metrics": {
"data_sent": {
"count": 19720,
"rate": 286.9989298699864
},
"http_req_duration{expected_response:true}": {
"avg": 69.51347459000003,
"min": 1.475262,
"med": 2.888408,
"max": 2763.628765,
"p(90)": 104.25559070000008,
"p(95)": 199.02731450000002
},
"http_req_waiting": {
"avg": 69.09920088000005,
"min": 1.38027,
"med": 2.6219585,
"max": 2763.54489,
"p(90)": 104.1045573000001,
"p(95)": 195.31751010000005
},
"http_req_tls_handshaking": {
"p(95)": 0,
"avg": 2.3655032066666664,
"min": 0,
"med": 0,
"max": 150.231511,
"p(90)": 0
},
"http_req_connecting": {
"max": 0.957156,
"p(90)": 0,
"p(95)": 0,
"avg": 0.010956376666666667,
"min": 0,
"med": 0
},
"http_req_receiving": {
"avg": 0.32632093666666667,
"min": 0.01362,
"med": 0.048505,
"max": 13.347991,
"p(90)": 0.19697570000000053,
"p(95)": 1.8268019000000006
},
"iteration_duration": {
"avg": 15542.400205454545,
"min": 0.005506,
"med": 16090.1770395,
"max": 20295.563856,
"p(90)": 20105.521806200002,
"p(95)": 20209.385726
},
"vus_max": {
"value": 5,
"min": 5,
"max": 5
},
"http_req_sending": {
"max": 0.197215,
"p(90)": 0.1204158,
"p(95)": 0.13077840000000002,
"avg": 0.08795277333333333,
"min": 0.026245,
"med": 0.089615
},
"vus": {
"value": 4,
"min": 4,
"max": 5
},
"http_req_duration": {
"avg": 69.51347459000003,
"min": 1.475262,
"med": 2.888408,
"max": 2763.628765,
"p(90)": 104.25559070000008,
"p(95)": 199.02731450000002,
"thresholds": {
"p(95)<200": false
}
},
"data_received": {
"count": 325450,
"rate": 4736.501101733624
},
"iterations": {
"count": 20,
"rate": 0.2910739653853817
},
"http_req_failed": {
"passes": 0,
"fails": 300,
"thresholds": {
"rate<0.01": false
},
"value": 0
},
"http_reqs": {
"count": 300,
"rate": 4.366109480780726
},
"http_req_blocked": {
"avg": 2.396350746666666,
"min": 0.000167,
"med": 0.0004145,
"max": 151.478196,
"p(90)": 0.0005468000000000002,
"p(95)": 0.0006992
},
"checks": {
"passes": 300,
"fails": 0,
"value": 1
},
"group_duration": {
"avg": 72.02987269999998,
"min": 1.568767,
"med": 2.9994389999999997,
"max": 2763.682461,
"p(90)": 104.39005250000008,
"p(95)": 199.16959900000003
}
}
}
\ No newline at end of file
......@@ -10,9 +10,9 @@ public class ConnectionConfiguration
/// </summary>
public static readonly string Section = "ConnectionConfiguration";
[JsonPropertyName("ProxyUrl")]
[JsonPropertyName("ServiceUrl")]
[Required]
public required string ProxyUrl { get; set; }
public required string ServiceUrl { get; set; }
[JsonPropertyName("ApplicationProfiles")]
[Required]
......
......@@ -4,7 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>1.9.2</Version>
<Version>1.10.0</Version>
</PropertyGroup>
<ItemGroup>
......
......@@ -10,7 +10,7 @@ namespace Coscine.Api.Core.Entities.Models.QuadStore;
[RdfClass(LDP.Container)]
[RdfClass(LDP.BasicContainer)]
[RdfClass(FDP_O.MetadataService)]
public class DataCatalog(UriRef uri) : Semiodesk.Trinity.Resource(uri)
public class DataCatalog(Uri uri) : Semiodesk.Trinity.Resource(uri)
{
/// <summary>
/// Gets or sets the ID of the associated metadata catalog.
......
using Semiodesk.Trinity;
namespace Coscine.Api.Core.Entities.Models.QuadStore;
[RdfClass("http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#hashType")]
public class HashEntity(Uri uri) : Semiodesk.Trinity.Resource(uri)
{
[RdfProperty("http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#hashFunction")]
public string? HashFunction { get; set; }
[RdfProperty("http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#hashValue")]
public string? HashValue { get; set; }
}
......@@ -7,7 +7,7 @@ namespace Coscine.Api.Core.Entities.Models.QuadStore;
/// Represents a catalog of metadata entries within the data catalog.
/// </summary>
[RdfClass(DCAT.Catalog)]
public class MetadataCatalog(UriRef uri) : Semiodesk.Trinity.Resource(uri)
public class MetadataCatalog(Uri uri) : Semiodesk.Trinity.Resource(uri)
{
/// <summary>
/// Gets or sets the list of entity URIs in the metadata catalog.
......
......@@ -7,7 +7,7 @@ namespace Coscine.Api.Core.Entities.Models.QuadStore;
/// Represents a metadata entry within the metadata catalog.
/// </summary>
[RdfClass("http://www.w3.org/ns/prov#Entity")]
public class MetadataEntity(UriRef uri) : Semiodesk.Trinity.Resource(uri)
public class MetadataEntity(Uri uri) : Semiodesk.Trinity.Resource(uri)
{
/// <summary>
/// Gets or sets the date and time when the metadata was generated.
......@@ -27,7 +27,22 @@ public class MetadataEntity(UriRef uri) : Semiodesk.Trinity.Resource(uri)
/// </summary>
/// <remarks>Corresponds to the <see cref="MetadataEntity"/> class.</remarks>
[RdfProperty("http://www.w3.org/ns/prov#wasRevisionOf")]
public Uri? WasRevisionOf { get; set; }
public List<Uri> WasRevisionOf { get; set; } = [];
/// <summary>
/// Gets or sets the URI of the entity that this one is a revision of.
/// </summary>
/// <remarks>Corresponds to the <see cref="MetadataEntity"/> class.</remarks>
[RdfProperty("https://purl.org/coscine/terms/metadatatracker#hasVariant")]
public List<Uri> HasVariant { get; set; } = [];
/// <summary>
/// Gets or sets the similarity to the last version.
/// String because of compatibility issues with Virtuoso.
/// </summary>
/// <remarks>Corresponds to the <see cref="MetadataEntity"/> class.</remarks>
[RdfProperty("https://purl.org/coscine/terms/metadatatracker#similarityToLastVersion")]
public string? SimilarityToLastVersion { get; set; }
/// <summary>
/// Gets or sets the URI of the extracted data related to this entity.
......
......@@ -6,7 +6,7 @@ namespace Coscine.Api.Core.Entities.Models.QuadStore;
/// Represents extracted metadata information.
/// </summary>
[RdfClass("https://purl.org/coscine/terms/metatadataextraction#Entity")]
public class MetadataExtractedEntity(UriRef uri) : Semiodesk.Trinity.Resource(uri)
public class MetadataExtractedEntity(Uri uri) : Semiodesk.Trinity.Resource(uri)
{
/// <summary>
/// Gets or sets the version of the extracted metadata.
......
......@@ -9,7 +9,7 @@ namespace Coscine.Api.Core.Entities.Models.QuadStore;
[RdfClass(ORG.OrganizationalCollaboration)]
[RdfClass(VCARD.Group)]
[RdfClass(LDP.Container)]
public class ProjectRdf(UriRef uri) : Semiodesk.Trinity.Resource(uri)
public class ProjectRdf(Uri uri) : Semiodesk.Trinity.Resource(uri)
{
[RdfProperty(DCTERMS.title)]
public string? ProjectName { get; set; }
......
......@@ -4,7 +4,7 @@ using Semiodesk.Trinity;
namespace Coscine.Api.Core.Entities.Models.QuadStore;
[RdfClass(DCAT.Catalog)]
public class RawDataCatalog(UriRef uri) : Semiodesk.Trinity.Resource(uri)
public class RawDataCatalog(Uri uri) : Semiodesk.Trinity.Resource(uri)
{
[RdfProperty("http://www.w3.org/ns/ldp#describedBy")]
public Uri? DescribedBy { get; set; }
......@@ -15,4 +15,11 @@ public class RawDataCatalog(UriRef uri) : Semiodesk.Trinity.Resource(uri)
/// <remarks>Corresponds to the <see cref="RawDataEntity"/> class.</remarks>
[RdfProperty("http://www.w3.org/ns/dcat#dataset")]
public List<Uri> EntityIds { get; set; } = [];
/// <summary>
/// Gets or sets the list of extracted URIs in the metadata catalog.
/// </summary>
/// <remarks>Corresponds to the <see cref="RawDataEntity"/> class.</remarks>
[RdfProperty("http://www.w3.org/ns/dcat#distribution")]
public List<Uri> ExtractedIds { get; set; } = [];
}
......@@ -4,7 +4,7 @@ using Semiodesk.Trinity;
namespace Coscine.Api.Core.Entities.Models.QuadStore;
[RdfClass("http://www.w3.org/ns/prov#Entity")]
public class RawDataEntity(UriRef uri) : Semiodesk.Trinity.Resource(uri)
public class RawDataEntity(Uri uri) : Semiodesk.Trinity.Resource(uri)
{
[RdfProperty("http://www.w3.org/ns/prov#generatedAtTime")]
public DateTime? GeneratedAt { get; set; }
......@@ -13,11 +13,14 @@ public class RawDataEntity(UriRef uri) : Semiodesk.Trinity.Resource(uri)
public Uri? InvalidatedBy { get; set; }
[RdfProperty("http://www.w3.org/ns/prov#wasRevisionOf")]
public Uri? WasRevisionOf { get; set; }
public List<Uri> WasRevisionOf { get; set; } = [];
[RdfProperty("https://purl.org/coscine/terms/metatadataextraction#extracted")]
public Uri? ExtractedId { get; set; }
[RdfProperty("http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#hash")]
public Uri? Hash { get; set; }
/// <summary>
/// Gets the Version of this entity.
/// </summary>
......
......@@ -3,7 +3,7 @@
namespace Coscine.Api.Core.Entities.Models.QuadStore;
[RdfClass("https://purl.org/coscine/terms/metatadataextraction#Entity")]
public class RawDataExtractedEntity(UriRef uri) : Semiodesk.Trinity.Resource(uri)
public class RawDataExtractedEntity(Uri uri) : Semiodesk.Trinity.Resource(uri)
{
[RdfProperty("https://purl.org/coscine/terms/metatadataextraction#version")]
public string? ExtractedVersion { get; set; }
......
......@@ -6,7 +6,7 @@ using Semiodesk.Trinity;
namespace Coscine.Api.Core.Entities.Models.QuadStore;
[RdfClass(DCAT.Catalog)]
public class ResourceRdf(UriRef uri) : Semiodesk.Trinity.Resource(uri)
public class ResourceRdf(Uri uri) : Semiodesk.Trinity.Resource(uri)
{
[RdfProperty(DCAT.service)]
public Uri? TypeId { get; set; }
......
using Semiodesk.Trinity;
namespace Coscine.Api.Core.Entities.Models.QuadStore;
/// <summary>
/// Represents a variant within the metadata catalog.
/// </summary>
[RdfClass("https://purl.org/coscine/terms/metadatatracker#Variant")]
public class Variant(Uri uri) : Semiodesk.Trinity.Resource(uri)
{
/// <summary>
/// Gets or sets the URI of the entity that it is a variant of.
/// </summary>
/// <remarks>Corresponds to the <see cref="Variant"/> class.</remarks>
[RdfProperty("https://purl.org/coscine/terms/metadatatracker#isVariantOf")]
public Uri? VariantOf { get; set; }
/// <summary>
/// Gets or sets the similarity value.
/// String because of compatibility issues with Virtuoso.
/// </summary>
/// <remarks>Corresponds to the <see cref="Variant"/> class.</remarks>
[RdfProperty("https://purl.org/coscine/terms/metadatatracker#similarity")]
public string? Similarity { get; set; }
}
......@@ -6,18 +6,23 @@ public static class ResourceOperations
{
public static OperationAuthorizationRequirement Create { get; } = new() { Name = nameof(Create) };
public static OperationAuthorizationRequirement CreateBlob { get; } = new() { Name = nameof(CreateBlob) };
public static OperationAuthorizationRequirement CreateExtractionTree { get; } = new() { Name = nameof(CreateExtractionTree) };
public static OperationAuthorizationRequirement CreateTree { get; } = new() { Name = nameof(CreateTree) };
public static OperationAuthorizationRequirement Read { get; } = new() { Name = nameof(Read) };
public static OperationAuthorizationRequirement ReadBlob { get; } = new() { Name = nameof(ReadBlob) };
public static OperationAuthorizationRequirement ReadProvenance { get; } = new() { Name = nameof(ReadProvenance) };
public static OperationAuthorizationRequirement ReadTree { get; } = new() { Name = nameof(ReadTree) };
public static OperationAuthorizationRequirement ReadQuota { get; } = new() { Name = nameof(ReadQuota) };
public static OperationAuthorizationRequirement ReadOptions { get; } = new() { Name = nameof(ReadOptions) };
public static OperationAuthorizationRequirement Update { get; } = new() { Name = nameof(Update) };
public static OperationAuthorizationRequirement UpdateBlob { get; } = new() { Name = nameof(UpdateBlob) };
public static OperationAuthorizationRequirement UpdateExtractionTree { get; } = new() { Name = nameof(UpdateExtractionTree) };
public static OperationAuthorizationRequirement UpdateProvenance { get; } = new() { Name = nameof(UpdateProvenance) };
public static OperationAuthorizationRequirement UpdateTree { get; } = new() { Name = nameof(UpdateTree) };
public static OperationAuthorizationRequirement Delete { get; } = new() { Name = nameof(Delete) };
public static OperationAuthorizationRequirement DeleteBlob { get; } = new() { Name = nameof(DeleteBlob) };
public static OperationAuthorizationRequirement DeleteTree { get; } = new() { Name = nameof(DeleteTree) };
}
\ No newline at end of file
using System.Security.Cryptography;
namespace Coscine.Api.Core.Entities.OtherModels;
public class HashParameters
{
public required HashAlgorithmName AlgorithmName { get; init; }
public required string Value { get; init; }
}
......@@ -4,10 +4,13 @@ namespace Coscine.Api.Core.Entities.OtherModels;
public class MetadataTree : Tree
{
public Uri Id { get; init; } = null!;
public Uri? Id { get; init; }
public string Version { get; init; } = null!;
public IEnumerable<string> AvailableVersions { get; init; } = new List<string>();
public string Definition { get; init; } = null!;
public string? Definition { get; init; } = null!;
public RdfFormat Format { get; init; }
public bool SkipValidation { get; init; } = false;
public bool ForceNewMetadataVersion { get; init; } = false;
public MetadataTreeExtracted? Extracted { get; init; }
public Provenance? Provenance { get; init; }
}
namespace Coscine.Api.Core.Entities.OtherModels;
public class Provenance
{
public required Uri Id { get; init; }
public DateTime? GeneratedAt { get; init; }
public required IEnumerable<Uri> WasRevisionOf { get; init; }
public required IEnumerable<Variant> Variants { get; init; }
public Uri? WasInvalidatedBy { get; init; }
public string? MetadataExtractorVersion { get; init; }
public decimal? SimilarityToLastVersion { get; init; }
public HashParameters? HashParameters { get; init; }
/// <summary>
/// Represents the variants of this specific metadata tree.
/// </summary>
/// <param name="GraphName">Name of the graph.</param>
/// <param name="Similarity">Similarity value 0-1</param>
public record Variant(Uri GraphName, double Similarity);
}
using System.Text.RegularExpressions;
using System.Web;
namespace Coscine.Api.Core.Entities.OtherModels;
......@@ -20,7 +21,7 @@ public partial class TreeUriResolver
/// <summary>
/// The tree graph data path (file and folder).
/// URL Encoded!
/// URL Decoded!
/// </summary>
/// <remarks>
/// Does not start nor end with a slash '<c>/</c>'.
......@@ -67,6 +68,18 @@ public partial class TreeUriResolver
var typeMatch = TypeRegex().Match(absoluteUri);
Type = typeMatch.Groups[1].Value;
GraphId = CreateGraphUri(uri);
// Extract Path as string (everything after the ResourceId)
var pathStartIndex =
GraphId.AbsoluteUri.IndexOf(ResourceId.ToString(), StringComparison.Ordinal) + ResourceId.ToString().Length + 1; // + 1 is '/'
Path = HttpUtility.UrlDecode(GraphId.AbsoluteUri[pathStartIndex..]); // Will never start or end with a '/'
}
public static Uri CreateGraphUri(Uri uri)
{
var absoluteUri = uri.AbsoluteUri;
// Extract General Graph Name as Uri (URL without query parameters and /@type)
var uriWithoutQueryAndType = absoluteUri[..absoluteUri.LastIndexOf('/')];
......@@ -78,11 +91,6 @@ public partial class TreeUriResolver
uriWithoutQueryAndType = uriWithoutQueryAndType[..typeIndex];
}
GraphId = new Uri(uriWithoutQueryAndType); // Without trailing '/'
// Extract Path as string (everything after the ResourceId)
var pathStartIndex =
GraphId.AbsoluteUri.IndexOf(ResourceId.ToString(), StringComparison.Ordinal) + ResourceId.ToString().Length + 1; // + 1 is '/'
Path = GraphId.AbsoluteUri[pathStartIndex..]; // Will never start or end with a '/'
return new Uri(uriWithoutQueryAndType); // Without trailing '/'
}
}
......@@ -4,7 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>1.9.2</Version>
<Version>1.10.0</Version>
</PropertyGroup>
<ItemGroup>
......