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
  • Fix/xxxx-indexOutOfRange
  • Fix/xxxx-minorFixes
  • Fix/xxxx-organization
  • Fix/xxxx-wrap
  • Hotfix/2332-userInstitutesInReporting
  • Hotfix/2388-sensitive
  • Hotfix/3115-userReportingEmpty
  • Hotfix/3115-userReportingEmpty2
  • Hotfix/xxxx-rors
  • Issue/2181-kpiGeneratorBase
  • Issue/2182-kpiGeneratorUser
  • Issue/2183-kpiGeneratorResource
  • Issue/2184-kpiGeneratorProject
  • Issue/2185-kpiGeneratorAP
  • Issue/2186-systemStatusReporting
  • Issue/2283-activityFix
  • Issue/2304-virtuosoRoars
  • Issue/2330-fixNaNQuotainAdmin
  • Issue/2432-publicationKpi
  • Issue/2492-respOrg
  • Issue/2518-docs
  • Issue/2568-betterLogging
  • Issue/2666-adminCronjobs
  • Issue/2666-adminCronjobs-theSequal
  • Issue/2847-reporting
  • Issue/2850-removeGrantId
  • Issue/2982-kpiDataPub
  • Issue/3005-kpiReportingBroken
  • Issue/3073-kpi
  • Issue/3142-kpiGenerator
  • dev
  • gitkeep
  • main
  • v0.1.0
  • v0.1.1
  • v0.1.10
  • v0.1.11
  • v0.1.12
  • v0.1.13
  • v0.1.14
  • v0.1.15
  • v0.1.16
  • v0.1.17
  • v0.1.18
  • v0.1.19
  • v0.1.2
  • v0.1.20
  • v0.1.21
  • v0.1.22
  • v0.1.23
  • v0.1.3
  • v0.1.4
  • v0.1.5
  • v0.1.6
  • v0.1.7
  • v0.1.8
  • v0.1.9
  • v1.0.1
  • v1.0.2
  • v1.0.3
  • v1.0.4
  • v1.0.5
  • v1.0.6
  • v1.0.7
  • v1.0.8
  • v1.0.9
  • v1.1.0
  • v1.1.1
  • v1.2.0
  • v1.2.1
  • v1.2.10
  • v1.2.2
  • v1.2.3
  • v1.2.4
  • v1.2.5
  • v1.2.6
  • v1.2.7
  • v1.2.8
  • v1.2.9
79 results

Target

Select target project
  • coscine/backend/scripts/kpi-generator
1 result
Select Git revision
  • Fix/xxxx-indexOutOfRange
  • Fix/xxxx-minorFixes
  • Fix/xxxx-organization
  • Fix/xxxx-wrap
  • Hotfix/2332-userInstitutesInReporting
  • Hotfix/2388-sensitive
  • Hotfix/3115-userReportingEmpty
  • Hotfix/3115-userReportingEmpty2
  • Hotfix/xxxx-rors
  • Issue/2181-kpiGeneratorBase
  • Issue/2182-kpiGeneratorUser
  • Issue/2183-kpiGeneratorResource
  • Issue/2184-kpiGeneratorProject
  • Issue/2185-kpiGeneratorAP
  • Issue/2186-systemStatusReporting
  • Issue/2283-activityFix
  • Issue/2304-virtuosoRoars
  • Issue/2330-fixNaNQuotainAdmin
  • Issue/2432-publicationKpi
  • Issue/2492-respOrg
  • Issue/2518-docs
  • Issue/2568-betterLogging
  • Issue/2666-adminCronjobs
  • Issue/2666-adminCronjobs-theSequal
  • Issue/2847-reporting
  • Issue/2850-removeGrantId
  • Issue/2982-kpiDataPub
  • Issue/3005-kpiReportingBroken
  • Issue/3073-kpi
  • Issue/3142-kpiGenerator
  • dev
  • gitkeep
  • main
  • v0.1.0
  • v0.1.1
  • v0.1.10
  • v0.1.11
  • v0.1.12
  • v0.1.13
  • v0.1.14
  • v0.1.15
  • v0.1.16
  • v0.1.17
  • v0.1.18
  • v0.1.19
  • v0.1.2
  • v0.1.20
  • v0.1.21
  • v0.1.22
  • v0.1.23
  • v0.1.3
  • v0.1.4
  • v0.1.5
  • v0.1.6
  • v0.1.7
  • v0.1.8
  • v0.1.9
  • v1.0.1
  • v1.0.2
  • v1.0.3
  • v1.0.4
  • v1.0.5
  • v1.0.6
  • v1.0.7
  • v1.0.8
  • v1.0.9
  • v1.1.0
  • v1.1.1
  • v1.2.0
  • v1.2.1
  • v1.2.10
  • v1.2.2
  • v1.2.3
  • v1.2.4
  • v1.2.5
  • v1.2.6
  • v1.2.7
  • v1.2.8
  • v1.2.9
79 results
Show changes
Commits on Source (8)
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<AssemblyName>Coscine.KpiGenerator</AssemblyName> <AssemblyName>Coscine.KpiGenerator</AssemblyName>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<Version>0.1.6</Version> <Version>0.1.7</Version>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
......
...@@ -175,8 +175,9 @@ public abstract class Reporting<O> where O : class ...@@ -175,8 +175,9 @@ public abstract class Reporting<O> where O : class
else else
{ {
result = _otherOrganization; result = _otherOrganization;
result.RorUrl = rorUrl; // Don't overwrite the RoR of the entry found, just use "Other" as name.
Console.ForegroundColor = ConsoleColor.Yellow; Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine($" WARNING!: Organization with ROR \"{rorUrl}\" could not be correctly identified. Will use \"{result.RorUrl}\" and \"{result.Name}\"."); Console.WriteLine($" WARNING!: Organization with ROR \"{rorUrl}\" could not be correctly identified. Will use \"{result.RorUrl}\" as RoR and \"{result.Name}\" as name.");
Console.ResetColor(); Console.ResetColor();
} }
} }
...@@ -289,11 +290,11 @@ public abstract class Reporting<O> where O : class ...@@ -289,11 +290,11 @@ public abstract class Reporting<O> where O : class
using var results = RdfStoreConnector.QueryEndpoint.QueryWithResultSet(_queryString.ToString()); using var results = RdfStoreConnector.QueryEndpoint.QueryWithResultSet(_queryString.ToString());
if (!results.IsEmpty) if (!results.IsEmpty)
{ {
var inst = results.Select(x => x.Value("inst").ToString()).ToList()[0]; // Get the value for ?inst var inst = results.Select(x => x.Value("inst").ToString()); // Get the value for ?inst
if (!string.IsNullOrWhiteSpace(inst)) if (inst.Any())
{ {
Console.WriteLine($" Organization {organization} found to match {inst}"); Console.WriteLine($" Organization {organization} found to match {inst.ToList()[0]}");
return inst; organization = inst.ToList()[0];
} }
} }
Console.WriteLine($" Could not find match for {organization}"); Console.WriteLine($" Could not find match for {organization}");
......
...@@ -158,7 +158,8 @@ public class UserReporting : Reporting<UserReportingOptions> ...@@ -158,7 +158,8 @@ public class UserReporting : Reporting<UserReportingOptions>
result.Add(orgOrcid); result.Add(orgOrcid);
break; break;
case "shibboleth": case "shibboleth":
var orgShibboleth = GetOrganizationByUserExternalId(externalId.ExternalId1); // Find the RoR first based on the Organization Entity Id, then try based on the user's External Id.
var orgShibboleth = GetOrganizationByExternalOrEntityId(externalId.Organization) ?? GetOrganizationByExternalOrEntityId(externalId.ExternalId1);
if (orgShibboleth is null) if (orgShibboleth is null)
{ {
Console.WriteLine($" No {searchedEntityType} found for user with ID \"{id}\" and login provider {loginProvider.DisplayName}"); Console.WriteLine($" No {searchedEntityType} found for user with ID \"{id}\" and login provider {loginProvider.DisplayName}");
...@@ -197,7 +198,7 @@ public class UserReporting : Reporting<UserReportingOptions> ...@@ -197,7 +198,7 @@ public class UserReporting : Reporting<UserReportingOptions>
return result.DistinctBy(e => e.RorUrl).ToList(); return result.DistinctBy(e => e.RorUrl).ToList();
} }
private Organization? GetOrganizationByUserExternalId(string userExternalId) private Organization? GetOrganizationByExternalOrEntityId(string externalOrEntityId)
{ {
var _queryString = new SparqlParameterizedString() var _queryString = new SparqlParameterizedString()
{ {
...@@ -217,7 +218,7 @@ public class UserReporting : Reporting<UserReportingOptions> ...@@ -217,7 +218,7 @@ public class UserReporting : Reporting<UserReportingOptions>
SELECT DISTINCT ?memberUrl SELECT DISTINCT ?memberUrl
WHERE {{ WHERE {{
?memberUrl ?p ?value . ?memberUrl ?p ?value .
FILTER( ?value IN ( '{userExternalId}' )) FILTER( ?value IN ( '{externalOrEntityId}' ))
}} }}
}} }}
}} }}
...@@ -226,12 +227,15 @@ public class UserReporting : Reporting<UserReportingOptions> ...@@ -226,12 +227,15 @@ public class UserReporting : Reporting<UserReportingOptions>
" "
}; };
using var results = RdfStoreConnector.QueryEndpoint.QueryWithResultSet(_queryString.ToString()); using var results = RdfStoreConnector.QueryEndpoint.QueryWithResultSet(_queryString.ToString());
if (results.IsEmpty) if (!results.IsEmpty)
{ {
return null; var ror = results.Select(x => x.Value("ror").ToString()); // Get the value for ?ror
if (ror.Any())
{
return FetchOrganizationByRor(ror.ToList()[0]);
} }
var rors = results.Select(x => x.Value("ror").ToString()).ToList(); // Get the value for ?ror }
return FetchOrganizationByRor(rors[0]); return null;
} }
private Organization? TryGetOrganizationByLabel(string rdfsLabel) private Organization? TryGetOrganizationByLabel(string rdfsLabel)
...@@ -257,12 +261,15 @@ public class UserReporting : Reporting<UserReportingOptions> ...@@ -257,12 +261,15 @@ public class UserReporting : Reporting<UserReportingOptions>
" "
}; };
using var results = RdfStoreConnector.QueryEndpoint.QueryWithResultSet(_queryString.ToString()); using var results = RdfStoreConnector.QueryEndpoint.QueryWithResultSet(_queryString.ToString());
if (results.IsEmpty) if (!results.IsEmpty)
{ {
return null; var ror = results.Select(x => x.Value("ror").ToString()); // Get the value for ?ror
if (ror.Any())
{
return FetchOrganizationByRor(ror.ToList()[0]);
} }
var ror = results.Select(x => x.Value("ror").ToString()).ToList()[0]; // Get the value for ?ror }
return FetchOrganizationByRor(ror); return null;
} }
private DateTime? GetLatestActivity(Guid id) private DateTime? GetLatestActivity(Guid id)
......