|
1
|
|
|
""" |
|
2
|
|
|
Testdata cotaining two very simple conceptschemes: trees and a few geographic concepts. |
|
3
|
|
|
|
|
4
|
|
|
.. versionadded:: 0.1.0 |
|
5
|
|
|
""" |
|
6
|
|
|
|
|
7
|
|
|
|
|
8
|
|
|
from skosprovider.providers import DictionaryProvider |
|
9
|
|
|
|
|
10
|
|
|
larch = { |
|
11
|
|
|
'id': '1', |
|
12
|
|
|
'uri': 'urn:x-skosprovider:trees/1', |
|
13
|
|
|
'labels': [ |
|
14
|
|
|
{'type': 'prefLabel', 'language': 'en', 'label': 'The Larch'}, |
|
15
|
|
|
{'type': 'prefLabel', 'language': 'nl', 'label': 'De Lariks'}, |
|
16
|
|
|
{'type': 'sortLabel', 'language': 'nl', 'label': 'c'} |
|
17
|
|
|
], |
|
18
|
|
|
'notes': [ |
|
19
|
|
|
{'type': 'definition', 'language': 'en', 'note': 'A type of tree.'} |
|
20
|
|
|
], |
|
21
|
|
|
'matches': { |
|
22
|
|
|
'close': ['http://id.python.org/different/types/of/trees/nr/1/the/larch'] |
|
23
|
|
|
} |
|
24
|
|
|
} |
|
25
|
|
|
|
|
26
|
|
|
chestnut = { |
|
27
|
|
|
'id': '2', |
|
28
|
|
|
'uri': 'urn:x-skosprovider:trees/2', |
|
29
|
|
|
'labels': [ |
|
30
|
|
|
{'type': 'prefLabel', 'language': 'en', 'label': 'The Chestnut'}, |
|
31
|
|
|
{'type': 'altLabel', 'language': 'nl', 'label': 'De Paardekastanje'}, |
|
32
|
|
|
{'type': 'altLabel', 'language': 'fr', 'label': 'la châtaigne'}, |
|
33
|
|
|
{'type': 'sortLabel', 'language': 'nl', 'label': 'a'} |
|
34
|
|
|
], |
|
35
|
|
|
'notes': [ |
|
36
|
|
|
{ |
|
37
|
|
|
'type': 'definition', 'language': 'en', |
|
38
|
|
|
'note': 'A different type of tree.' |
|
39
|
|
|
} |
|
40
|
|
|
], |
|
41
|
|
|
'matches': { |
|
42
|
|
|
'related': ['http://id.python.org/different/types/of/trees/nr/17/the/other/chestnut'] |
|
43
|
|
|
} |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
species = { |
|
47
|
|
|
'id': 3, |
|
48
|
|
|
'uri': 'urn:x-skosprovider:trees/3', |
|
49
|
|
|
'labels': [ |
|
50
|
|
|
{'type': 'prefLabel', 'language': 'en', 'label': 'Trees by species'}, |
|
51
|
|
|
{'type': 'prefLabel', 'language': 'nl', 'label': 'Bomen per soort'}, |
|
52
|
|
|
{'type': 'sortLabel', 'language': 'nl', 'label': 'b'} |
|
53
|
|
|
], |
|
54
|
|
|
'type': 'collection', |
|
55
|
|
|
'members': ['1', '2'] |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
trees = DictionaryProvider( |
|
59
|
|
|
{'id': 'TREES', 'default_language': 'nl', 'conceptscheme_id': 1}, |
|
60
|
|
|
[larch, chestnut, species] |
|
61
|
|
|
) |
|
62
|
|
|
|
|
63
|
|
|
world = { |
|
64
|
|
|
'id': '1', |
|
65
|
|
|
'labels': [ |
|
66
|
|
|
{'type': 'prefLabel', 'language': 'en', 'label': 'World'} |
|
67
|
|
|
], |
|
68
|
|
|
'narrower': [2, 3], |
|
69
|
|
|
'matches': { |
|
70
|
|
|
'close': ['urn:somethingelse:st1', 'urn:somethingelse:st2'], |
|
71
|
|
|
'exact': ['urn:something:thingy'], |
|
72
|
|
|
'related': ['urn:somethingelse:stuff'] |
|
73
|
|
|
} |
|
74
|
|
|
} |
|
75
|
|
|
|
|
76
|
|
|
geo = DictionaryProvider( |
|
77
|
|
|
{'id': 'GEOGRAPHY'}, |
|
78
|
|
|
[ |
|
79
|
|
|
world, |
|
80
|
|
|
{ |
|
81
|
|
|
'id': 2, |
|
82
|
|
|
'labels': [ |
|
83
|
|
|
{'type': 'prefLabel', 'language': 'en', 'label': 'Europe'} |
|
84
|
|
|
], |
|
85
|
|
|
'narrower': [4, 5], 'broader': [1] |
|
86
|
|
|
}, { |
|
87
|
|
|
'id': 3, |
|
88
|
|
|
'labels': [ |
|
89
|
|
|
{ |
|
90
|
|
|
'type': 'prefLabel', 'language': 'en', |
|
91
|
|
|
'label': 'North-America' |
|
92
|
|
|
} |
|
93
|
|
|
], |
|
94
|
|
|
'narrower': [6], 'broader': [1] |
|
95
|
|
|
}, { |
|
96
|
|
|
'id': 4, |
|
97
|
|
|
'labels': [ |
|
98
|
|
|
{'type': 'prefLabel', 'language': 'en', 'label': 'Belgium'} |
|
99
|
|
|
], |
|
100
|
|
|
'narrower': [7, 8, 9], 'broader': [2] |
|
101
|
|
|
}, { |
|
102
|
|
|
'id': 5, |
|
103
|
|
|
'labels': [ |
|
104
|
|
|
{ |
|
105
|
|
|
'type': 'prefLabel', 'language': 'en', |
|
106
|
|
|
'label': 'United Kingdom' |
|
107
|
|
|
} |
|
108
|
|
|
], |
|
109
|
|
|
'broader': [2] |
|
110
|
|
|
}, { |
|
111
|
|
|
'id': 6, |
|
112
|
|
|
'labels': [ |
|
113
|
|
|
{ |
|
114
|
|
|
'type': 'prefLabel', 'language': 'en', |
|
115
|
|
|
'label': 'United States of America' |
|
116
|
|
|
} |
|
117
|
|
|
], |
|
118
|
|
|
'broader': [3] |
|
119
|
|
|
}, { |
|
120
|
|
|
'id': 7, |
|
121
|
|
|
'labels': [ |
|
122
|
|
|
{'type': 'prefLabel', 'language': 'en', 'label': 'Flanders'} |
|
123
|
|
|
], |
|
124
|
|
|
'broader': [4] |
|
125
|
|
|
}, { |
|
126
|
|
|
'id': 8, |
|
127
|
|
|
'labels': [ |
|
128
|
|
|
{'type': 'prefLabel', 'language': 'en', 'label': 'Brussels'} |
|
129
|
|
|
], |
|
130
|
|
|
'broader': [4] |
|
131
|
|
|
}, { |
|
132
|
|
|
'id': 9, |
|
133
|
|
|
'labels': [ |
|
134
|
|
|
{'type': 'prefLabel', 'language': 'en', 'label': 'Wallonie'} |
|
135
|
|
|
], |
|
136
|
|
|
'broader': [4] |
|
137
|
|
|
}, { |
|
138
|
|
|
'id': '333', |
|
139
|
|
|
'type': 'collection', |
|
140
|
|
|
'labels': [ |
|
141
|
|
|
{ |
|
142
|
|
|
'type': 'prefLabel', 'language': 'en', |
|
143
|
|
|
'label': 'Places where dutch is spoken' |
|
144
|
|
|
} |
|
145
|
|
|
], |
|
146
|
|
|
'members': ['4', '7', '8'] |
|
147
|
|
|
} |
|
148
|
|
|
] |
|
149
|
|
|
) |
|
150
|
|
|
|