-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from statisticssweden/MultipleLanguages
Add support for catalog titles and descriptions in multiple languages
- Loading branch information
Showing
33 changed files
with
2,918 additions
and
140,265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} | ||
} |
Oops, something went wrong.