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
  • 1.1.2
  • Hotfix/2752-excludeFoldersInvalidation
  • Hotfix/xxxx-correctVersions
  • Issue/1788-extractionCronjob
  • Issue/1792-newMetadataStructure
  • Issue/2464-invalidateMeta
  • Issue/2568-betterLogging
  • Issue/2770-apiMigration
  • Issue/2836-incorrectMetadataInvalidation
  • Issue/xxxx-multipleVariants
  • Issue/xxxx-variantDetection
  • Test/xxxx-testDeletion
  • dev
  • gitkeep
  • main
  • v1.2.0
  • v1.1.0
  • v1.1.1
  • v1.1.2
  • v1.1.3
  • v1.1.4
  • v1.2.0
  • v1.2.1
  • v1.2.2
  • v1.2.3
  • v1.2.4
  • v1.2.5
  • v1.2.6
  • v1.2.7
  • v1.3.0
  • v1.3.1
  • v1.3.2
32 results

Target

Select target project
  • coscine/research/metadatatracker
1 result
Select Git revision
  • 1.1.2
  • Hotfix/2752-excludeFoldersInvalidation
  • Hotfix/xxxx-correctVersions
  • Issue/1788-extractionCronjob
  • Issue/1792-newMetadataStructure
  • Issue/2464-invalidateMeta
  • Issue/2568-betterLogging
  • Issue/2770-apiMigration
  • Issue/2836-incorrectMetadataInvalidation
  • Issue/xxxx-multipleVariants
  • Issue/xxxx-variantDetection
  • Test/xxxx-testDeletion
  • dev
  • gitkeep
  • main
  • v1.2.0
  • v1.1.0
  • v1.1.1
  • v1.1.2
  • v1.1.3
  • v1.1.4
  • v1.2.0
  • v1.2.1
  • v1.2.2
  • v1.2.3
  • v1.2.4
  • v1.2.5
  • v1.2.6
  • v1.2.7
  • v1.3.0
  • v1.3.1
  • v1.3.2
32 results
Show changes
Commits on Source (2)
Showing with 46 additions and 9 deletions
......@@ -4,7 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>1.2.4</Version></PropertyGroup>
<Version>1.2.5</Version></PropertyGroup>
<ItemGroup>
<PackageReference Include="JsonSubTypes" Version="1.9.0" />
<PackageReference Include="Polly" Version="7.2.3" />
......
......@@ -12,7 +12,7 @@
<Description>A library generated from a OpenAPI doc</Description>
<Copyright>No Copyright</Copyright>
<RootNamespace>Org.OpenAPITools</RootNamespace>
<Version>1.2.4</Version>
<Version>1.2.5</Version>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml</DocumentationFile>
<RepositoryUrl>https://github.com/GIT_USER_ID/GIT_REPO_ID.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
......
......@@ -4,7 +4,7 @@
<OutputType>Library</OutputType>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Version>1.2.4</Version></PropertyGroup>
<Version>1.2.5</Version></PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\MetadataTracker\MetadataTracker.csproj" />
</ItemGroup>
......
......@@ -91,11 +91,16 @@ public class CoscineMetadataStore : IMetadataStore
return null;
}
public List<string> GetMetadataIds(string resourceId, string path)
public List<string> GetMetadataIds(string resourceId, string? path)
{
return _rdfStoreConnector.GetMetadataIds(resourceId, path);
}
public IEnumerable<string?>? ListMetadata(string resourceId, bool extracted = false)
{
return _rdfStoreConnector.ListMetadata(resourceId, extracted);
}
public bool HasGraph(Uri uri)
{
......
......@@ -22,7 +22,9 @@ public interface IMetadataStore
Uri? GetMetadataId(string resourceId, string path, bool extracted = false);
List<string> GetMetadataIds(string resourceId, string path);
List<string> GetMetadataIds(string resourceId, string? path);
IEnumerable<string?>? ListMetadata(string resourceId, bool extracted = false);
bool HasGraph(Uri uri);
......
......@@ -67,7 +67,12 @@ public class MockupMetadataStore : IMetadataStore
return null;
}
public List<string> GetMetadataIds(string resourceId, string path)
public List<string> GetMetadataIds(string resourceId, string? path)
{
return new List<string>();
}
public IEnumerable<string?>? ListMetadata(string resourceId, bool extracted = false)
{
return new List<string>();
}
......
......@@ -186,6 +186,31 @@ public class MetadataTracker : IMetadataTracker
var resourceDataEntries = await resourceEntry.Entries.ToListAsync();
// Include the metadata that belongs to removed files
var resourceMetadataIds = _metadataStore.ListMetadata(resourceEntry.Id, true) ?? new List<string?>();
foreach (var resourceMetadataId in resourceMetadataIds.Where((entry) => entry is not null).Cast<string>())
{
var afterBase = resourceMetadataId.Replace("https://purl.org/coscine/resources/", "");
var resourceId = afterBase[..afterBase.IndexOf("/")];
var afterResource = afterBase[(afterBase.IndexOf("/") + 1)..];
var path = afterResource[..afterResource.IndexOf("/@type")];
if (!resourceDataEntries.Any((entry) => entry.GeneralIdentifier == resourceId && entry.Key == path))
{
resourceDataEntries.Add(new DataEntry(
new Coscine.ResourceTypes.Base.Models.ResourceEntry(
path,
false,
0,
null,
null,
null,
null
),
resourceId
));
}
}
Logger.LogInformation("Query extraction graphs");
// Get them all beforehand to avoid a O(n^2) complexity
var extractionGraphs = new Dictionary<DataEntry, IGraph?>();
......
......@@ -5,7 +5,7 @@
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>1.2.4</Version></PropertyGroup>
<Version>1.2.5</Version></PropertyGroup>
<ItemGroup>
<PackageReference Include="Coscine.Configuration" Version="2.*-*" />
<PackageReference Include="Coscine.Database" Version="2.*-*" />
......
......@@ -4,7 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>1.2.4</Version></PropertyGroup>
<Version>1.2.5</Version></PropertyGroup>
<ItemGroup>
<PackageReference Include="JsonSubTypes" Version="1.9.0" />
<PackageReference Include="Polly" Version="7.2.3" />
......
......@@ -12,7 +12,7 @@
<Description>A library generated from a OpenAPI doc</Description>
<Copyright>No Copyright</Copyright>
<RootNamespace>Org.OpenAPITools</RootNamespace>
<Version>1.2.4</Version>
<Version>1.2.5</Version>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml</DocumentationFile>
<RepositoryUrl>https://github.com/GIT_USER_ID/GIT_REPO_ID.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
......