Skip to content

Commit 8d832dc

Browse files
author
mgeipel
committed
examples updated
1 parent fd7f6b8 commit 8d832dc

24 files changed

+2715
-1
lines changed
File renamed without changes.
File renamed without changes.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
default counts="myflux/counts.dat";
3+
default catalogue = FLUX_DIR + "10.pica";
4+
5+
//count references
6+
"counting references in " + catalogue | write("stdout");
7+
8+
catalogue|
9+
open-file|
10+
as-lines|
11+
catch-object-exception|
12+
decode-pica|
13+
morph(FLUX_DIR + "references.xml")|
14+
stream-to-triples|
15+
count-triples(countBy="object")|
16+
17+
write("subjects.dat");
18+
19+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<metamorph xmlns="http://www.culturegraph.org/metamorph"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1">
4+
<rules>
5+
<data source="041A*.9" name="">
6+
<trim />
7+
<unique/>
8+
</data>
9+
</rules>
10+
</metamorph>

examples/gnd/json/Tp-200.pica.gz

56.4 KB
Binary file not shown.

examples/gnd/json/tp2json.flux

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
default gnd = FLUX_DIR + "Tp-200.pica.gz";
2+
3+
gnd|
4+
open-file|
5+
as-lines|
6+
decode-pica|
7+
morph(FLUX_DIR + "tp2json.xml")|
8+
encode-json|
9+
write("stdout");

examples/gnd/json/tp2json.xml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<metamorph xmlns="http://www.culturegraph.org/metamorph"
3+
version="1" entityMarker=".">
4+
<meta>
5+
<name>Umsetzung der GND Personen</name>
6+
</meta>
7+
<macros>
8+
<macro name="name">
9+
<combine name="$[out]"
10+
value="${personalname}${surname}${forename}${prefix}${add}"
11+
flushWith="028$[post]" reset="true">
12+
<data source="028$[post].P" name="personalname" />
13+
<data source="028$[post].a" name="surname" />
14+
<data source="028$[post].d" name="forename">
15+
<compose prefix=", " />
16+
</data>
17+
<data source="028$[post].c" name="prefix">
18+
<compose prefix=" " />
19+
</data>
20+
<concat name="add" prefix=" &lt;" postfix="&gt;" delimiter=", "
21+
flushWith="028$[post]" reset="true">
22+
<data source="028$[post].n" />
23+
<data source="028$[post].l" />
24+
<data source="028$[post].g" />
25+
</concat>
26+
<postprocess>
27+
<normalize-utf8 />
28+
</postprocess>
29+
</combine>
30+
31+
</macro>
32+
</macros>
33+
<rules>
34+
35+
<call-macro name="name" post="A" out="@name" />
36+
<call-macro name="name" post="@" out="@varName" />
37+
38+
<data source="_id" name="id" />
39+
40+
<data source="_id" name="type">
41+
<constant value="person" />
42+
</data>
43+
44+
<entity name="thumbnail">
45+
<data source="_id" name="link">
46+
<constant
47+
value="http://art-eater.com/wp-content/uploads/2012/08/ecce_mono.jpg" />
48+
</data>
49+
<data name="caption" source="_id">
50+
<constant value="Fresco by Cecilia Giménez (2012)"/>
51+
</data>
52+
</entity>
53+
54+
<entity name="person" flushWith="record">
55+
<data source="@name" name="name" />
56+
<data source="050G.b" name="description" />
57+
<entity name="variantname[]" flushWith="record">
58+
<data source="@varName" />
59+
</entity>
60+
<data name="birth" source="032Aa.a">
61+
<replace pattern=" " with="" />
62+
<regexp match="((\d+?))-" format="${1}" />
63+
</data>
64+
65+
<data name="death" source="032Aa.a">
66+
<replace pattern=" " with="" />
67+
<regexp match="-((\d+?))$" format="${1}" />
68+
</data>
69+
70+
<entity name="occupations[]" flushWith="record">
71+
<data source="032Fa.a" />
72+
</entity>
73+
</entity>
74+
75+
</rules>
76+
</metamorph>

examples/gnd/references/10.pica

Lines changed: 10 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
default base = "";
3+
default gndsimple = base + "gnd-simplified.dat";
4+
5+
gnd|
6+
open-file|
7+
as-lines|
8+
decode-pica|
9+
morph(FLUX_DIR + "format-gnd.xml")|
10+
encode-formeta(style="concise")|
11+
write(gndsimple);
12+
13+
14+
15+

0 commit comments

Comments
 (0)