1
+ # ########## used for https://solidos.github.io/solid-ui/Documentation/form-examples/structures2.html #####
2
+ # ####### THIS IS PART OF THE PRODUCTION PROFILE FORM ###########
3
+
4
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
5
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
6
+ @prefix foaf: <http://xmlns.com/foaf/0.1/> .
7
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
8
+ @prefix solid: <http://www.w3.org/ns/solid/terms#> .
9
+ @prefix ui: <http://www.w3.org/ns/ui#> .
10
+ @prefix schema: <http://schema.org/> .
11
+ @prefix vcard: <http://www.w3.org/2006/vcard/ns#> .
12
+
13
+ @prefix org: <http://www.w3.org/ns/org#> .
14
+ @prefix esco: <http://data.europa.eu/esco/model#> .
15
+ @prefix wd: <http://www.wikidata.org/entity/> .
16
+ @prefix wdt: <http://www.wikidata.org/prop/direct/> .
17
+
18
+ @prefix : <#> .
19
+
20
+ :this
21
+ <http://purl.org/dc/elements/1.1/title> " Profile form" ;
22
+ a ui:Form ;
23
+ ui:parts (
24
+ :OrganizationCreationForm
25
+ ).
26
+
27
+ # ########### Organizations #################
28
+
29
+ :OrganizationCreationForm a ui:Form;
30
+ schema:name " Form for editing an organization using public data" ;
31
+ ui:parts ( :OrgClassifier :OrgSwitch :OrganizationNameField :homePageURIField ) .
32
+
33
+
34
+ :OrgClassifier a ui:Classifier; ui:label " What sort of organization?" @en ;
35
+ ui:category solid:InterestingOrganization .
36
+
37
+ # Ontology data to drive the classifier
38
+
39
+ solid:InterestingOrganization owl:disjointUnionOf (
40
+ schema:Corporation
41
+ schema:EducationalOrganization
42
+ schema:ResearchOrganization # Proposed. https://github.com/schemaorg/schemaorg/issues/2877
43
+ schema:GovernmentOrganization
44
+ schema:NGO
45
+ schema:PerformingGroup # a band
46
+ schema:Project # like Solid
47
+ schema:SportsOrganization # a Team
48
+ solid:OtherOrganization
49
+ ) .
50
+
51
+ # This until the schema.org ontology adopts it
52
+ schema:ResearchOrganization a rdfs:Class;
53
+ rdfs:label " Research Organization" @en , " Organization de Recherche" @fr ,
54
+ " organización de investigación" @es , " منظمة البحث" @ar , " अनुसंधान संगठन" @hi , " Forschungsorganisation" @de , " shirika la utafiti" @sw .
55
+
56
+ :OrganizationNameField
57
+ a ui:SingleLineTextField ;
58
+ ui:label " Organization Name" ;
59
+ ui:maxLength " 200" ;
60
+ ui:property schema:name ;
61
+ ui:size 80 .
62
+
63
+ :homePageURIField a ui:NamedNodeURIField; ui:size 80 ;
64
+ ui:label " Home page URI" @en ;
65
+ ui:property schema:uri . # @@ ??
66
+
67
+ # Depending on the type of org, chose a different form
68
+
69
+ :OrgSwitch a ui:Options; ui:dependingOn rdf:type;
70
+ ui:case
71
+ [ ui:for schema:Corporation; ui:use :CorporationForm ],
72
+ [ ui:for schema:GovernmentOrganization; ui:use :GovernmentOrganizationForm ],
73
+ [ ui:for schema:PerformingGroup; ui:use :PerformingGroupForm ],
74
+ [ ui:for schema:Project; ui:use :ProjectForm ],
75
+ [ ui:for schema:NGO; ui:use :NGOForm ],
76
+ [ ui:for schema:EducationalOrganization; ui:use :EducationalOrganizationForm ],
77
+ [ ui:for schema:ResearchOrganization; ui:use :ResearchOrganizationForm ],
78
+ [ ui:for :SportsOrganization; ui:use :SportsOrganizationForm ],
79
+ [ ui:for solid:OtherOrganization; ui:use :OtherOrganizationForm ].
80
+
81
+
82
+ :CorporationForm a ui:Group; ui:weight 0 ; ui:parts ( :CorporationPrompt :CorporationAutocomplete ) .
83
+
84
+ :CorporationPrompt a ui:Comment; ui:contents " Which corporation?" .
85
+
86
+ :CorporationAutocomplete a ui:AutocompleteField;
87
+ a ui:AutocompleteField; ui:label " Corporation in wikidata" ;
88
+ ui:size 60 ;
89
+ ui:targetClass <http://www.wikidata.org/entity/Q6881511> ; # Enterprise
90
+ ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.
91
+
92
+ :WikidataInstancesByName a ui:DataSource ;
93
+ schema:name " Wikidata instances by name" ;
94
+ ui:endpoint " https://query.wikidata.org/sparql" ;
95
+ ui:searchByNameQuery """ SELECT ?subject ?name
96
+ WHERE {
97
+ ?klass wdt:P279* $(targetClass) .
98
+ ?subject wdt:P31 ?klass .
99
+ ?subject rdfs:label ?name.
100
+ FILTER regex(?name, "$(name)", "i")
101
+ } LIMIT $(limit) """ ;
102
+
103
+ # Note this form of the query is very experimental
104
+ ui:searchByName [ ui:construct { ?subject schema:name ?name } ;
105
+ ui:where { ?klass wdt:P279 ?targetClass .
106
+ ?subject wdt:P31 ?klass ; rdfs:label ?name .
107
+ };
108
+ ].
109
+
110
+ :GovernmentOrganizationForm a ui:Group; ui:weight 0 ; ui:parts ( :GovernmentOrganizationPrompt :GovernmentOrganizationAutocomplete ) .
111
+
112
+ :GovernmentOrganizationPrompt a ui:Comment; ui:contents " Which GovernmentOrganization?" .
113
+
114
+ :GovernmentOrganizationAutocomplete
115
+ a ui:AutocompleteField; ui:label " GovernmentOrganization in wikidata" ;
116
+ ui:size 60 ;
117
+ ui:targetClass <http://www.wikidata.org/entity/Q327333> ; # GovernmentOrganization
118
+ ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.
119
+
120
+ :EducationalOrganizationForm a ui:Group; ui:weight 1 ; ui:parts ( :EducationalOrganizationPrompt :EducationalOrganizationAutocomplete ) .
121
+
122
+ :EducationalOrganizationPrompt a ui:Comment; ui:contents " Which Educational Organization?" .
123
+
124
+ :EducationalOrganizationAutocomplete
125
+ a ui:AutocompleteField; ui:label " Educational Organization in wikidata" ;
126
+ ui:size 60 ;
127
+ ui:targetClass <http://www.wikidata.org/entity/Q2385804> ; # EducationalOrganization
128
+ ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.
129
+
130
+
131
+ :ResearchOrganizationForm a ui:Group; ui:weight 0 ; ui:parts ( :ResearchOrganizationPrompt :ResearchOrganizationAutocomplete ) .
132
+
133
+ :ResearchOrganizationPrompt a ui:Comment; ui:contents " Which Research Organization?" .
134
+
135
+ :ResearchOrganizationAutocomplete
136
+ a ui:AutocompleteField; ui:label " Research Insitute in wikidata" ;
137
+ ui:size 60 ;
138
+ ui:targetClass <http://www.wikidata.org/entity/Q31855> ; # research institute
139
+ ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.
140
+
141
+
142
+ :NGOForm a ui:Group; ui:weight 0 ; ui:parts ( :NGOPrompt :NGOAutocomplete ) .
143
+
144
+ :NGOPrompt a ui:Comment; ui:contents " Which NGO?" .
145
+
146
+ :NGOAutocomplete
147
+ a ui:AutocompleteField; ui:label " NGO in wikidata" ;
148
+ ui:size 60 ;
149
+ ui:targetClass <http://www.wikidata.org/entity/Q163740> ; # Non-profit org
150
+ ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.
151
+
152
+ :PerformingGroupForm a ui:Group; ui:weight 0 ; ui:parts ( :PerformingGroupPrompt :PerformingGroupAutocomplete ) .
153
+
154
+ :PerformingGroupPrompt a ui:Comment; ui:contents " Which PerformingGroup?" .
155
+
156
+ :PerformingGroupAutocomplete
157
+ a ui:AutocompleteField; ui:label " PerformingGroup in wikidata" ;
158
+ ui:size 60 ;
159
+ ui:targetClass <http://www.wikidata.org/entity/Q32178211> ; # Music Org
160
+ ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.
161
+
162
+
163
+ :ProjectForm a ui:Group; ui:weight 0 ; ui:parts ( :ProjectPrompt :ProjectAutocomplete ) . # :ProjectAutocomplete - no: supress, as not in WD
164
+
165
+ :ProjectPrompt a ui:Comment; ui:contents " Which Project?" .
166
+
167
+ :ProjectAutocomplete
168
+ a ui:AutocompleteField; ui:label " Project in wikidata" ;
169
+ ui:size 60 ;
170
+ ui:targetClass <http://www.wikidata.org/entity/Q170584> ; # Project
171
+ ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.
172
+
173
+ :SportsOrganizationForm a ui:Group; ui:weight 0 ; ui:parts ( :SportsOrganizationPrompt :SportsOrganizationAutocomplete ) .
174
+
175
+ :SportsOrganizationPrompt a ui:Comment; ui:contents " Which Sports Organization?" .
176
+
177
+ :SportsOrganizationAutocomplete
178
+ a ui:AutocompleteField; ui:label " SportsOrganization in wikidata" ;
179
+ ui:size 60 ;
180
+ ui:targetClass <http://www.wikidata.org/entity/Q4438121> ; # SportsOrganization
181
+ ui:property solid:publicId; ui:dataSource :WikidataInstancesByName.
182
+
183
+ :OtherOrganizationForm a ui:Group; ui:weight 0 ; ui:parts ( :OrganizationNameField :homePageURIField ) .
184
+
185
+
186
+ # ENDS
0 commit comments