Skip to content

Commit

Permalink
Merge pull request #61 from statisticssweden/MultipleLanguages
Browse files Browse the repository at this point in the history
Add support for catalog titles and descriptions in multiple languages
  • Loading branch information
jerikso authored Jun 30, 2023
2 parents b94a57d + 97b4c95 commit ee0f571
Show file tree
Hide file tree
Showing 33 changed files with 2,918 additions and 140,265 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@ jobs:
- uses: NuGet/setup-nuget@v1

- name: Restore NuGet packages
working-directory: ./Source/
run: nuget restore


- name: Build the application
working-directory: ./Source/
run: msbuild /p:Configuration=Release

- name: Depoly to Nuget
working-directory: ./Source/Px.Rdf/
- name: Deploy to Nuget
working-directory: ./Px.Dcat/
run: |
$package = Get-ChildItem -Recurse -Filter *.nupkg
nuget push $package $env:nuget_api_key -src https://nuget.org
Expand Down
17 changes: 10 additions & 7 deletions Source/Px.Rdf.sln → DataportalXML.sln
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32126.317
VisualStudioVersion = 17.2.32526.322
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Px.Rdf", "Px.Rdf\Px.Rdf.csproj", "{2C3F7401-9DCD-4563-A7EA-EB98CFE868EF}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Px.Dcat", "Px.Dcat\Px.Dcat.csproj", "{D74054AB-6358-4AFC-8E53-EBFF536289D0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "TestApp\TestApp.csproj", "{2B620474-1DDF-46EB-95D8-290BD4F76845}"
ProjectSection(ProjectDependencies) = postProject
{D74054AB-6358-4AFC-8E53-EBFF536289D0} = {D74054AB-6358-4AFC-8E53-EBFF536289D0}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2C3F7401-9DCD-4563-A7EA-EB98CFE868EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2C3F7401-9DCD-4563-A7EA-EB98CFE868EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2C3F7401-9DCD-4563-A7EA-EB98CFE868EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2C3F7401-9DCD-4563-A7EA-EB98CFE868EF}.Release|Any CPU.Build.0 = Release|Any CPU
{D74054AB-6358-4AFC-8E53-EBFF536289D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D74054AB-6358-4AFC-8E53-EBFF536289D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D74054AB-6358-4AFC-8E53-EBFF536289D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D74054AB-6358-4AFC-8E53-EBFF536289D0}.Release|Any CPU.Build.0 = Release|Any CPU
{2B620474-1DDF-46EB-95D8-290BD4F76845}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2B620474-1DDF-46EB-95D8-290BD4F76845}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2B620474-1DDF-46EB-95D8-290BD4F76845}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -26,6 +29,6 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {48F4396E-E48C-401F-97AD-9F9A733182C2}
SolutionGuid = {A66A1D5D-522F-4866-8911-72ED811C0F6E}
EndGlobalSection
EndGlobal
93 changes: 0 additions & 93 deletions Dokumentation.md

This file was deleted.

14 changes: 14 additions & 0 deletions Px.Dcat/DataClasses/Catalog.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Collections.Generic;

namespace Px.Dcat.DataClasses
{
public class Catalog
{
public List<KeyValuePair<string, string>> Titles;
public List<KeyValuePair<string, string>> Descriptions;
public string License;
public List<string> Languages;
public List<Dataset> Datasets;
public Organization Publisher;
}
}
23 changes: 23 additions & 0 deletions Px.Dcat/DataClasses/ContactPerson.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
namespace Px.Dcat.DataClasses
{
public class ContactPerson
{
public string Resource;
public string Name;
public string Email;
public string Phone;

public override bool Equals(object obj)
{
if (obj is null || obj.GetType() != GetType())
return false;
ContactPerson cp = (ContactPerson)obj;
return Email == cp.Email;
}

public override int GetHashCode()
{
return Email.GetHashCode();
}
}
}
25 changes: 25 additions & 0 deletions Px.Dcat/DataClasses/Dataset.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System.Collections.Generic;

namespace Px.Dcat.DataClasses
{
public class Dataset
{
public List<string> Titles;
public List<string> Descriptions;
public List<string> LanguageURIs;
public List<string> Languages;
public string Category;
public List<ContactPerson> ContactPersons;
public Organization Publisher;
public List<Keyword> Keywords;
public string Identifier;
public string Modified;
public string UpdateFrequency;
public Organization Producer;
public List<Distribution> Distributions;
public string Resource;
public List<string> Sources;

public List<string> Urls;
}
}
12 changes: 12 additions & 0 deletions Px.Dcat/DataClasses/Distribution.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace Px.Dcat.DataClasses
{
public class Distribution
{
public string Title;
public string AccessUrl;
public string Resource;
public string License;
public string Language;
public string Format;
}
}
8 changes: 8 additions & 0 deletions Px.Dcat/DataClasses/Keyword.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Px.Dcat.DataClasses
{
public class Keyword
{
public string Language;
public string Text;
}
}
23 changes: 23 additions & 0 deletions Px.Dcat/DataClasses/Organization.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.Collections.Generic;

namespace Px.Dcat.DataClasses
{
public class Organization
{
public HashSet<(string, string)> Names; // (language, name)
public string Resource;

public override bool Equals(object obj)
{
if (obj is null || obj.GetType() != GetType())
return false;
Organization other = (Organization)obj;
return Names.SetEquals(other.Names);
}

public override int GetHashCode()
{
return Names.GetHashCode();
}
}
}
Loading

0 comments on commit ee0f571

Please sign in to comment.