Skip to content

Commit

Permalink
Merge pull request #528 from readchina/add-new-views
Browse files Browse the repository at this point in the history
Add 3 new views for RAs basing on "genre" of "source" of RAs
  • Loading branch information
whalekeykeeper committed Jun 7, 2023
2 parents dfe773c + e2ed1df commit 674603b
Show file tree
Hide file tree
Showing 5 changed files with 993 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ jobs:
docker run --rm -t -v $(pwd):/tmp duncdrum/textql:alpine -output-header -output-file csv/views/view02_creator-matrix.csv -header -sql "select distinct a.act_id, a.act_object, w.creator, (select distinct ps.title from PrimarySource ps where a.act_object = ps.prim_source_id) as title, (select distinct coalesce(p.family_name, '') || ' ' || coalesce(p.first_name, '') from Person p where w.creator = p.person_id) as name from Act a, Work w inner join Work on a.act_object = w.work_id where a.act_object!='W0414'" csv/data/
docker run --rm -t -v $(pwd):/tmp duncdrum/textql:alpine -output-header -output-file csv/views/view03a_reader-author-nodes.csv -header -sql "select distinct a.agent_id as node_id from Agent a" csv/data/
docker run --rm -t -v $(pwd):/tmp duncdrum/textql:alpine -output-header -output-file csv/views/view03b_reader-author-edges.csv -header -sql "select distinct a.act_id, a.agent as source, w.creator as target from Act a, Work w inner join Work on a.act_object = w.work_id" csv/data/
docker run --rm -t -v $(pwd):/tmp duncdrum/textql:alpine -output-header -output-file csv/views/view05a_RA_source_G44.csv -header -sql "select distinct a.act_id, a.act_object, ps.title from Act a, PrimarySource ps inner join PrimarySource on a.act_object = ps.prim_source_id where ps.language != 'zh' and ps.language != 'zh-Latn-pinyin' and a.act_object!='W0414' and a.source in (select prim_source_id from (select * from PrimarySource union all select * from SecondarySource) AS ss where ss.genre=='G44')" csv/data/
docker run --rm -t -v $(pwd):/tmp duncdrum/textql:alpine -output-header -output-file csv/views/view05b_RA_source_G07.csv -header -sql "select distinct a.act_id, a.act_object, ps.title from Act a, PrimarySource ps inner join PrimarySource on a.act_object = ps.prim_source_id where ps.language != 'zh' and ps.language != 'zh-Latn-pinyin' and a.act_object!='W0414' and a.source in (select prim_source_id from (select * from PrimarySource union all select * from SecondarySource) AS ss where ss.genre=='G07')" csv/data/
docker run --rm -t -v $(pwd):/tmp duncdrum/textql:alpine -output-header -output-file csv/views/view05c_RA_source_fiction.csv -header -sql "select distinct a.act_id, a.act_object, ps.title from Act a, PrimarySource ps inner join PrimarySource on a.act_object = ps.prim_source_id where ps.language != 'zh' and ps.language != 'zh-Latn-pinyin' and a.act_object!='W0414' and a.source in (select prim_source_id from (select * from PrimarySource union all select * from SecondarySource) AS ss, Genre g inner join Genre where ss.genre=g.genre_id and g.genre_type=='fiction')" csv/data/
- name: Update JSON View Data
run: basex xml/modules/rAct-vega.xq > csv/views/view04a_rActs.json
- name: Check Git Status
Expand Down
108 changes: 108 additions & 0 deletions csv/datapackage.json
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,114 @@
}
}
}
},
{
"title": "Titles of textual works",
"resources": {
"name": "view5a",
"data": {
"url": "https://raw.githubusercontent.com/readchina/ReadAct/master/csv/views/view05a_RA_source_G44.csv"
},
"specType": "vega-lite",
"spec": {
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"description": "Textual works when Reading Acts are sellected basing on the genre of their source (autobiography)",
"data": {
"url": "https://raw.githubusercontent.com/readchina/ReadAct/master/csv/views/view05a_RA_source_G44.csv"
},
"mark": {
"type": "bar",
"tooltip": true
},
"encoding": {
"x": {
"field": "title",
"type": "ordinal",
"axis": {
"labelAngle": 0
},
"sort": "-y"
},
"y": {
"aggregate": "count",
"field": "act_object",
"type": "quantitative"
}
}
}
}
},
{
"title": "Titles of textual works",
"resources": {
"name": "view5b",
"data": {
"url": "https://raw.githubusercontent.com/readchina/ReadAct/master/csv/views/view05b_RA_source_G07.csv"
},
"specType": "vega-lite",
"spec": {
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"description": "Textual works when Reading Acts are sellected basing on the genre of their source (science fiction)",
"data": {
"url": "https://raw.githubusercontent.com/readchina/ReadAct/master/csv/views/view05b_RA_source_G07.csv"
},
"mark": {
"type": "bar",
"tooltip": true
},
"encoding": {
"x": {
"field": "title",
"type": "ordinal",
"axis": {
"labelAngle": 0
},
"sort": "-y"
},
"y": {
"aggregate": "count",
"field": "act_object",
"type": "quantitative"
}
}
}
}
},
{
"title": "Titles of textual works",
"resources": {
"name": "view5c",
"data": {
"url": "https://raw.githubusercontent.com/readchina/ReadAct/master/csv/views/view05c_RA_source_fiction.csv"
},
"specType": "vega-lite",
"spec": {
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"description": "Textual works, when Reading Acts are sellected basing on the genre type of their source (fiction)",
"data": {
"url": "https://raw.githubusercontent.com/readchina/ReadAct/master/csv/views/view05c_RA_source_fiction.csv"
},
"mark": {
"type": "bar",
"tooltip": true
},
"encoding": {
"x": {
"field": "title",
"type": "ordinal",
"axis": {
"labelAngle": 0
},
"sort": "-y"
},
"y": {
"aggregate": "count",
"field": "act_object",
"type": "quantitative"
}
}
}
}
}
]
}
Loading

0 comments on commit 674603b

Please sign in to comment.