Skip to content

Commit

Permalink
Merge branch 'develop' into feature/update-first-time-setup-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lukavdplas authored Jun 5, 2024
2 parents 2bda24c + f6ecad9 commit d42e89e
Show file tree
Hide file tree
Showing 45 changed files with 281 additions and 142 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/backend-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This workflow will run backend tests on the Python version defined in the Dockerfiles

name: Backend unit tests

on:
workflow_dispatch:
push:
branches:
- 'develop'
- 'master'
- 'feature/**'
- 'bugfix/**'
- 'hotfix/**'
- 'release/**'
- 'dependabot/**'
paths-ignore:
- 'frontend/**'
- '**.md'

jobs:
backend-test:
name: Test Backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run backend tests
run: sudo mkdir -p /ci-data && sudo docker-compose --env-file .env-ci run backend pytest
27 changes: 27 additions & 0 deletions .github/workflows/frontend-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This workflow will run frontend tests on the Node version defined in the Dockerfiles

name: Frontend unit tests

on:
workflow_dispatch:
push:
branches:
- 'develop'
- 'master'
- 'feature/**'
- 'bugfix/**'
- 'hotfix/**'
- 'release/**'
- 'dependabot/**'
paths-ignore:
- 'backend/**'
- '**.md'

jobs:
frontend-test:
name: Test Frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run frontend tests
run: sudo docker-compose --env-file .env-ci run frontend yarn test
22 changes: 0 additions & 22 deletions .github/workflows/release.yaml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This action will update the CITATION.cff file for new release or hotfix branches

name: Release

on:
push:
branches:
- 'release/**'
- 'hotfix/**'

jobs:
citation-update:
name: Update CITATION.cff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Autoformat CITATION.cff
run: |
version=`grep -o '\d\+\.\d\+\.\d\+' package.json`
today=`date +"%Y-%m-%d"`
sed -i "s/^version: [[:digit:]]\{1,\}\.[[:digit:]]\{1,\}\.[[:digit:]]\{1,\}/version: $version/" CITATION.cff
sed -i "s/[[:digit:]]\{4\}-[[:digit:]]\{2\}-[[:digit:]]\{2\}/$today/" CITATION.cff
bash ./update-citation.sh
git commit -a -m "update version and date in CITATION.cff"
32 changes: 0 additions & 32 deletions .github/workflows/test.yml

This file was deleted.

4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ keywords:
- elasticsearch
- natural language processing
license: MIT
version: 5.6.2
date-released: '2024-05-06'
version: 5.7.0
date-released: '2024-06-5'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ For corpora included in I-analyzer, the backend includes a definition file that

## Usage

If you are interested in using I-analyzer, the most straightforward way to get started is to make an account at [ianalyzer.hum.uu.nl](https://ianalyzer.hum.uu.nl/). This server is maintained by the Research Software Lab and contains corpora focused on a variety of fields. We also maintain more specialised collections at [PEACE portal](https://peace.sites.uu.nl/epigraphy/search/) and [People & Parliament (not publicly accessible)](https://people-and-parliament.hum.uu.nl/).
If you are interested in using I-analyzer, the most straightforward way to get started is to visit [ianalyzer.hum.uu.nl](https://ianalyzer.hum.uu.nl/). This server is maintained by the Research Software Lab and contains corpora focused on a variety of fields. We also maintain more specialised collections at [PEACE portal](https://peace.sites.uu.nl/epigraphy/search/) and [People & Parliament](https://people-and-parliament.hum.uu.nl/).

I-analyzer does not have an "upload data" option (yet!). If you are interested in using I-analyzer as a way to publish your dataset, or to make it easier to search and analyse, you can go about this two ways:

Expand Down
11 changes: 11 additions & 0 deletions backend/corpora/dbnl/citation/citation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ I-analyzer presents the [DBNL-dataset](https://www.kb.nl/onderzoeken-vinden/data

> KB, Nationale Biliotheek. "DBNL-dataset". *I-analyzer*, 2023, {{ frontend_url }}/search/dbnl
### Chicago "notes and bibliography" style
> KB, Nationale Bibliotheek, "DBNL-dataset", distributed by I-analyzer, 2023. {{ frontend_url }}/search/dbnl.

## Citing a specific work

Expand All @@ -34,3 +37,11 @@ This describes the query to view all chapters of the book on I-analyzer.
### MLA style

> Porjeere, Olivier. *Zanglievende uitspanningen*. Martinus de Bruijn, 1788. {{ frontend_url }}/search/dbnl?title_id=porj001zang01_01&sort=chapter_index,asc
### Chicago "notes and bibliography" style
#### First note
> Olivier Porjeere, *Zanglievende uitspanningen* (Alkmaar: Martinus de Bruijn, 1788) {{ frontend_url }}/search/dbnl?title_id=porj001zang01_01&sort=chapter_index,asc.
#### Shortened note
> Porjeere, *Zanglievende uitspanningen*
#### Bibliography entry
> Porjeere, Olivier. *Zanglievende uitspanningen*. Alkmaar: Martinus de Bruijn, 1788. {{ frontend_url }}/search/dbnl?title_id=porj001zang01_01&sort=chapter_index,asc.
44 changes: 44 additions & 0 deletions backend/corpora/parliament/citation/netherlands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## Citing the entire corpus

People & Parliament presents the *Dutch parliamentary data* corpus, which is a combination of the following:
- Dutch parliamentary proceedings from 1814-2013, harvested and enriched in the [Political Mashup project](https://ssh.datastations.nl/dataset.xhtml?persistentId=doi:10.17026/dans-xk5-dw3s), retrieved 2020
- Dutch parliamentary proceedings from 2014-2022, harvested and enriched by [ParlaMINT](https://www.clarin.eu/parlamint), first retrieved 2020 and updated 2023

### Chicago "notes and bibliography" style
> University of Jyväskylä and Utrecht University, "Dutch Parliamentary data", distributed by People & Parliament, 2023. {{ frontend_url }}/search/parliament-netherlands.
### APA style

> University of Jyväskylä and Utrecht University (2023). *Dutch Parliamentary data* [data set]. People & Parliament. {{ frontend_url }}/search/parliament-netherlands
### MLA style

[MLA guidelines](https://style.mla.org/) recommend against citing a database, and recommend [citing each individual work you use](https://style.mla.org/separate-entries-database-works/). If you want to cite the entire corpus nonetheless, we recommend the following format:

> University of Jyväskylä and Utrecht University. "Dutch Parliamentary data". People & Parliament, 2023. {{ frontend_url }}/search/parliament-netherlands
## Referring to a debate
To get an URL for an entire debate, you can use the *view debate* link for a speech. This will get you a link like this:

{{ frontend_url }}/search/parliament-netherlands?debate_id=ParlaMint-NL_2021-12-21-eerstekamer-4&sort=sequence,asc

## Citing a specific speech

To cite a speech in the *Dutch Parliamentary data* corpus, you can retrieve a link by clicking the *link* icon underneath the speech's document tile. This should give you an url as follows:
{{ frontend_url }}/document/parliament-netherlands/ParlaMint-NL_2021-12-21-eerstekamer-4.u1

### Chicago "notes and bibliography" style
#### First note
> Mark Rutte in *Report of the meeting of the Dutch Lower House, Meeting 37, Session 2 (2021-12-21)*, 2021. {{ frontend_url }}/document/parliament-netherlands/ParlaMint-NL_2021-12-21-tweedekamer-2.u225.
#### Shortened note
> Rutte, *Meeting 37, Session 2 (2021-12-21)*
#### Bibliography entry
> Rutte, Mark. In *Report of the meeting of the Dutch Lower House, Meeting 37, Session 2 (2021-12-21)*, 2021. {{ frontend_url }}/document/parliament-netherlands/ParlaMint-NL_2021-12-21-tweedekamer-2.u225.
### APA style

> Rutte, M. (2021). In *Report of the meeting of the Dutch Lower House, Meeting 37, Session 2 (2021-12-21)*. {{ frontend_url }}/document/parliament-netherlands/ParlaMint-NL_2021-12-21-tweedekamer-2.u225
### MLA style

> Rutte, Mark. *Report of the meeting of the Dutch Lower House, Meeting 37, Session 2 (2021-12-21)*, 2021. {{ frontend_url }}/document/parliament-netherlands/ParlaMint-NL_2021-12-21-tweedekamer-2.u225
2 changes: 1 addition & 1 deletion backend/corpora/parliament/description/netherlands.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
The debates of the First and Second Chamber of the bicameral parliament, enriched until the early 2010s by Maarten Marx for the Political Mashup project, and 2014-2020 by ParlaMINT. Metadata is provided.
The debates of the First and Second Chamber of the bicameral parliament, enriched until the early 2010s by Maarten Marx for the Political Mashup project, and 2014-2023 by ParlaMINT. Metadata is provided.
3 changes: 3 additions & 0 deletions backend/corpora/parliament/netherlands.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from corpora.parliament.utils.parlamint import extract_all_party_data, extract_people_data, extract_role_data, party_attribute_extractor, person_attribute_extractor
from corpora.utils.formatting import format_page_numbers
from corpora.parliament.parliament import Parliament
from corpora.utils.constants import document_context
import corpora.parliament.utils.field_defaults as field_defaults
import re

Expand Down Expand Up @@ -132,11 +133,13 @@ class ParliamentNetherlands(Parliament, XMLCorpusDefinition):
es_index = getattr(settings, 'PP_NL_INDEX', 'parliament-netherlands')
image = 'netherlands.jpg'
description_page = 'netherlands.md'
citation_page = 'netherlands.md'
tag_toplevel = lambda _, metadata: 'root' if is_old(metadata) else 'TEI'
tag_entry = lambda _, metadata: 'speech' if is_old(metadata) else 'u'
languages = ['nl']

category = 'parliament'
document_context = document_context()

def sources(self, start, end):
logger = logging.getLogger(__name__)
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/app/about/about.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { SafeHtml } from '@angular/platform-browser';
import { SafeHtml, Title } from '@angular/platform-browser';
import { environment } from '../../environments/environment';
import { DialogService } from '../services';

Expand All @@ -13,12 +13,14 @@ export class AboutComponent implements OnInit {
public aboutHtml: SafeHtml;
public isLoading = false;

constructor(private dialogService: DialogService) { }
constructor(private dialogService: DialogService, private title: Title) {
}

ngOnInit() {
this.isLoading = true;
this.appName = environment.appName;
this.fetchData();
this.title.setTitle(`About - ${this.appName}`);
}

async fetchData() {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/corpus-header/corpus-header.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class CorpusHeaderComponent implements OnChanges, OnInit {

ngOnChanges(changes: SimpleChanges): void {
if (this.corpus) {
this.wordModelsPresent = this.corpus.word_models_present;
this.wordModelsPresent = this.corpus.wordModelsPresent;
}
}
}
11 changes: 9 additions & 2 deletions frontend/src/app/corpus-info/corpus-info.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { Component, OnInit } from '@angular/core';
import { ApiService, CorpusService, WordmodelsService } from '../services';
import { ApiService, CorpusService } from '../services';
import { Corpus, CorpusDocumentationPage, FieldCoverage } from '../models';
import { marked } from 'marked';
import { Observable } from 'rxjs';
import { Title } from '@angular/platform-browser';
import { pageTitle } from '../utils/app';

@Component({
selector: 'ia-corpus-info',
Expand All @@ -16,7 +18,11 @@ export class CorpusInfoComponent implements OnInit {

documentation$: Observable<CorpusDocumentationPage[]>;

constructor(private corpusService: CorpusService, private apiService: ApiService, private wordModelsService: WordmodelsService) { }
constructor(
private corpusService: CorpusService,
private apiService: ApiService,
private title: Title,
) { }

ngOnInit(): void {
this.corpusService.currentCorpus.subscribe(this.setCorpus.bind(this));
Expand All @@ -28,6 +34,7 @@ export class CorpusInfoComponent implements OnInit {
this.apiService.fieldCoverage(corpus.name).then(
result => this.fieldCoverage = result
);
this.title.setTitle(pageTitle(`About ${corpus.title}`));
}

renderMarkdown(content: string): string {
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/app/document-page/document-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { Corpus, FoundDocument } from '../models';
import { CorpusService, ElasticSearchService } from '../services';
import { makeContextParams } from '../utils/document-context';
import { documentIcons } from '../shared/icons';
import { Title } from '@angular/platform-browser';
import { pageTitle } from '../utils/app';

@Component({
selector: 'ia-document-page',
Expand All @@ -25,6 +27,7 @@ export class DocumentPageComponent implements OnInit {
private corpusService: CorpusService,
private elasticSearchService: ElasticSearchService,
private activatedRoute: ActivatedRoute,
private title: Title,
) { }

get contextDisplayName(): string {
Expand Down Expand Up @@ -53,6 +56,7 @@ export class DocumentPageComponent implements OnInit {
this.corpus = corpus;
this.documentId = params['id'];
this.getDocument(this.documentId);
this.title.setTitle(pageTitle(`Document in ${corpus.title}`));
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('DocumentViewComponent', () => {
fixture = TestBed.createComponent(DocumentViewComponent);
component = fixture.componentInstance;
component.corpus = _.merge({
scan_image_type: 'farout_image_type',
scanImageType: 'farout_image_type',
fields: [mockField]
}, mockCorpus);
component.document = makeDocument({ great_field: 'Hello world!' });
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/document-view/document-view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class DocumentViewComponent implements OnChanges {
}

get showScanTab() {
return !!this.corpus.scan_image_type;
return !!this.corpus.scanImageType;
}

ngOnChanges(changes: SimpleChanges): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { HistoryDirective } from '../history.directive';
import { findByName } from '../../utils/utils';
import { actionIcons } from '../../shared/icons';
import { downloadQueryModel, downloadQueryModels } from '../../utils/download-history';
import { Title } from '@angular/platform-browser';
import { pageTitle } from '../../utils/app';

@Component({
selector: 'ia-download-history',
Expand All @@ -23,12 +25,14 @@ export class DownloadHistoryComponent extends HistoryDirective implements OnInit
private downloadService: DownloadService,
private apiService: ApiService,
corpusService: CorpusService,
private notificationService: NotificationService
private notificationService: NotificationService,
private title: Title,
) {
super(corpusService);
}

ngOnInit(): void {
this.title.setTitle(pageTitle('Downloads'));
this.retrieveCorpora();
this.apiService.downloads()
.then(downloadHistory => this.downloads = this.sortByDate(downloadHistory))
Expand Down
Loading

0 comments on commit d42e89e

Please sign in to comment.