1
1
# generated by datamodel-codegen:
2
2
# filename: Item.json
3
- # timestamp: 2024-09-12T12:35:11 +00:00
3
+ # timestamp: 2024-12-10T05:09:51 +00:00
4
4
5
5
from __future__ import annotations
6
6
13
13
14
14
15
15
class ReadAccess (OswBaseModel ):
16
+ class Config :
17
+ schema_extra = {"title" : "Read access" , "title*" : {"de" : "Lesezugriff" }}
18
+
16
19
level : Optional [Literal ["public" , "internal" , "restricted" ]] = Field (
17
20
None , title = "Level"
18
21
)
19
22
20
23
21
24
class AccessRestrictions (OswBaseModel ):
25
+ class Config :
26
+ schema_extra = {
27
+ "title" : "Access restrictions" ,
28
+ "title*" : {"de" : "Zugriffsbeschränkungen" },
29
+ "eval_template" : {
30
+ "$comment" : "See https://www.mediawiki.org/wiki/Extension:Semantic_ACL" ,
31
+ "type" : "mustache-wikitext" ,
32
+ "mode" : "render" ,
33
+ "value" : "{{entry_access.read.level}} {{=<% %>=}} {{#set: |Visible to= {{#switch: <%={{ }}=%> {{{entry_access.read.level}}} {{=<% %>=}} |public=public |internal=users |restricted=whitelist |#default=}} }} <%={{ }}=%>" ,
34
+ },
35
+ }
36
+
22
37
read : Optional [ReadAccess ] = Field (None , title = "Read access" )
23
38
24
39
25
40
class Label (OswBaseModel ):
41
+ class Config :
42
+ schema_extra = {
43
+ "@context" : {
44
+ "rdf" : "http://www.w3.org/2000/01/rdf-schema#" ,
45
+ "text" : {"@id" : "@value" },
46
+ "lang" : {"@id" : "@language" },
47
+ },
48
+ "title" : "Label" ,
49
+ }
50
+
26
51
text : constr (min_length = 1 ) = Field (..., title = "Text" )
27
52
lang : Optional [Literal ["en" , "de" ]] = Field ("en" , title = "Lang code" )
28
53
29
54
30
- class Description (Label ):
31
- pass
55
+ class Description (OswBaseModel ):
56
+ class Config :
57
+ schema_extra = {
58
+ "@context" : {
59
+ "rdf" : "http://www.w3.org/2000/01/rdf-schema#" ,
60
+ "text" : {"@id" : "@value" },
61
+ "lang" : {"@id" : "@language" },
62
+ },
63
+ "title" : "Description" ,
64
+ }
65
+
66
+ text : constr (min_length = 1 ) = Field (..., title = "Text" )
67
+ lang : Optional [Literal ["en" , "de" ]] = Field ("en" , title = "Lang code" )
32
68
33
69
34
70
class WikiPage (OswBaseModel ):
35
71
"""
36
72
The wiki page containing this entity
37
73
"""
38
74
75
+ class Config :
76
+ schema_extra = {
77
+ "title" : "Wiki page" ,
78
+ "description" : "The wiki page containing this entity" ,
79
+ }
80
+
39
81
title : Optional [str ] = Field (None , title = "Title" )
40
82
"""
41
83
The page title
@@ -47,6 +89,14 @@ class WikiPage(OswBaseModel):
47
89
48
90
49
91
class Meta (OswBaseModel ):
92
+ class Config :
93
+ schema_extra = {
94
+ "@context" : {
95
+ "change_id" : {"@id" : "Property:HasChangeId" , "@type" : "xsd:string" }
96
+ },
97
+ "title" : "Meta" ,
98
+ }
99
+
50
100
uuid : UUID = Field (default_factory = uuid4 , title = "UUID" )
51
101
wiki_page : Optional [WikiPage ] = Field (None , title = "Wiki page" )
52
102
"""
@@ -59,6 +109,70 @@ class Meta(OswBaseModel):
59
109
60
110
61
111
class Entity (OswBaseModel ):
112
+ class Config :
113
+ schema_extra = {
114
+ "@context" : {
115
+ "bvco" : "https://bvco.ontology.link/" ,
116
+ "databatt" : "http://www.databatt.org/" ,
117
+ "emmo" : "https://w3id.org/emmo#" ,
118
+ "emmobattery" : "https://w3id.org/emmo/domain/battery#" ,
119
+ "emmochameo" : "https://w3id.org/emmo/domain/chameo#" ,
120
+ "emmochemicals" : "https://w3id.org/emmo/domain/chemicalsubstance#" ,
121
+ "emmoelch" : "https://w3id.org/emmo/domain/electrochemistry#" ,
122
+ "schema" : "https://schema.org/" ,
123
+ "skos" : "https://www.w3.org/TR/skos-reference/" ,
124
+ "xsd" : "http://www.w3.org/2001/XMLSchema#" ,
125
+ "wiki" : "https://wiki-dev.open-semantic-lab.org/id/" ,
126
+ "Category" : {"@id" : "wiki:Category-3A" , "@prefix" : True },
127
+ "File" : {
128
+ "@id" : "https://wiki-dev.open-semantic-lab.org/wiki/Special:Redirect/file/" ,
129
+ "@prefix" : True ,
130
+ },
131
+ "Property" : {"@id" : "wiki:Property-3A" , "@prefix" : True },
132
+ "Item" : {"@id" : "wiki:Item-3A" , "@prefix" : True },
133
+ "attachments*" : {"@id" : "Property:HasFileAttachment" , "@type" : "@id" },
134
+ "based_on" : {"@id" : "skos:isBasedOn" , "@type" : "@id" },
135
+ "based_on*" : {"@id" : "Property:IsBasedOn" , "@type" : "@id" },
136
+ "description" : {"@id" : "skos:definition" , "@type" : "@id" },
137
+ "description*" : {"@id" : "Property:HasDescription" , "@type" : "@id" },
138
+ "image" : {"@id" : "schema:image" , "@type" : "@id" },
139
+ "image*" : {"@id" : "Property:HasImage" , "@type" : "@id" },
140
+ "label" : {"@id" : "skos:prefLabel" , "@type" : "@id" },
141
+ "label*" : {"@id" : "Property:HasLabel" , "@type" : "@id" },
142
+ "lang" : {"@id" : "@language" },
143
+ "meta" : {
144
+ "@id" : "Property:HasMeta" ,
145
+ "@type" : "@id" ,
146
+ "@context" : {
147
+ "change_id" : {
148
+ "@id" : "Property:HasChangeId" ,
149
+ "@type" : "xsd:string" ,
150
+ }
151
+ },
152
+ },
153
+ "name*" : {"@id" : "Property:HasName" },
154
+ "ordering_categories" : {"@id" : "Property:Category" , "@type" : "@id" },
155
+ "ordering_categories*" : {
156
+ "@id" : "Property:HasClassificationCategory" ,
157
+ "@type" : "@id" ,
158
+ },
159
+ "query_label" : {"@id" : "Property:HasLabel" , "@type" : "@id" },
160
+ "rdf_type" : {"@id" : "@type" , "@type" : "@id" },
161
+ "rdf_type*" : {"@id" : "schema:additionalType" , "@type" : "@id" },
162
+ "rdf_type**" : {"@id" : "owl:sameAs" , "@type" : "@id" },
163
+ "rdf_type***" : {"@id" : "Property:Equivalent_URI" , "@type" : "@id" },
164
+ "short_name" : {"@id" : "Property:HasShortName" },
165
+ "keywords" : {"@id" : "schema:keywords" , "@type" : "@id" },
166
+ "keywords*" : {"@id" : "Property:HasKeyword" , "@type" : "@id" },
167
+ "statements" : {"@id" : "Property:HasStatement" , "@type" : "@id" },
168
+ "text" : {"@id" : "@value" },
169
+ "uuid*" : {"@id" : "Property:HasUuid" },
170
+ },
171
+ "uuid" : "ce353767-c628-45bd-9d88-d6eb3009aec0" ,
172
+ "title" : "Entity" ,
173
+ "defaultProperties" : ["description" ],
174
+ }
175
+
62
176
rdf_type : Optional [Set [str ]] = Field (None , title = "Additional RDF type(s)" )
63
177
"""
64
178
Declares additional type(s) for this entity, e.g., to state that this entity has the same meaning as a term in a controlled vocabulary or ontology. This property is synonymous to the schema:additionalType and owl:sameAs. The default syntax is ontology:TermName. The ontology prefix has to be defined in the @context of the Entity, the category or any of the parent categories. The term name has to be a valid identifier in the ontology.
@@ -83,9 +197,11 @@ class Entity(OswBaseModel):
83
197
query_label : Optional [str ] = Field (None , title = "Query label" )
84
198
description : Optional [List [Description ]] = Field (None , title = "Description" )
85
199
image : Optional [str ] = Field (None , title = "Image" )
86
- ordering_categories : Optional [List [str ]] = Field (None , title = "Ordering categories" )
200
+ ordering_categories : Optional [List [str ]] = Field (
201
+ None , title = "Classification categories"
202
+ )
87
203
"""
88
- Ordering categories are used to categorize instances, e.g., according to their use but not their properties. When querying for instances of a here listed ordering category, this instance will be returned. Note: Ordering categories define no properties, while 'regular' categories define properties, which an instance assigns values to.
204
+ Classification categories are used to categorize instances, e.g., according to their use but not their properties. When querying for instances of a here listed classification category, this instance will be returned. Note: Classification categories define no properties, while 'regular' categories define properties, which an instance assigns values to.
89
205
"""
90
206
keywords : Optional [List [str ]] = Field (None , title = "Keywords / Tags" )
91
207
"""
@@ -103,6 +219,9 @@ class Entity(OswBaseModel):
103
219
104
220
105
221
class ObjectStatement (OswBaseModel ):
222
+ class Config :
223
+ schema_extra = {"title" : "Object Statement" }
224
+
106
225
rdf_type : Optional [Any ] = "rdf:Statement"
107
226
uuid : UUID = Field (default_factory = uuid4 , title = "UUID" )
108
227
label : Optional [List [Label ]] = Field (None , title = "Label" )
@@ -118,6 +237,9 @@ class ObjectStatement(OswBaseModel):
118
237
119
238
120
239
class DataStatement (OswBaseModel ):
240
+ class Config :
241
+ schema_extra = {"title" : "Data Statement" }
242
+
121
243
rdf_type : Optional [Any ] = "rdf:Statement"
122
244
uuid : UUID = Field (default_factory = uuid4 , title = "UUID" )
123
245
label : Optional [List [Label ]] = Field (None , title = "Label" )
@@ -133,6 +255,9 @@ class DataStatement(OswBaseModel):
133
255
134
256
135
257
class QuantityStatement (OswBaseModel ):
258
+ class Config :
259
+ schema_extra = {"title" : "Quantity Statement" }
260
+
136
261
rdf_type : Optional [Any ] = "rdf:Statement"
137
262
uuid : UUID = Field (default_factory = uuid4 , title = "UUID" )
138
263
label : Optional [List [Label ]] = Field (None , title = "Label" )
@@ -151,6 +276,18 @@ class QuantityStatement(OswBaseModel):
151
276
152
277
153
278
class Item (Entity ):
279
+ class Config :
280
+ schema_extra = {
281
+ "@context" : [
282
+ "/wiki/Category:Entity?action=raw&slot=jsonschema" ,
283
+ {
284
+ "type" : {"@id" : "Property:HasType" , "@type" : "@id" },
285
+ "type*" : {"@id" : "Property:HasSchema" , "@type" : "@id" },
286
+ },
287
+ ],
288
+ "title" : "Item" ,
289
+ }
290
+
154
291
type : Optional [List [str ]] = Field (
155
292
["Category:Item" ], min_items = 1 , title = "Types/Categories"
156
293
)
0 commit comments