11# generated by datamodel-codegen:
22# filename: Item.json
3- # timestamp: 2024-09-12T12:35:11 +00:00
3+ # timestamp: 2024-12-10T05:09:51 +00:00
44
55from __future__ import annotations
66
1313
1414
1515class ReadAccess (OswBaseModel ):
16+ class Config :
17+ schema_extra = {"title" : "Read access" , "title*" : {"de" : "Lesezugriff" }}
18+
1619 level : Optional [Literal ["public" , "internal" , "restricted" ]] = Field (
1720 None , title = "Level"
1821 )
1922
2023
2124class 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+
2237 read : Optional [ReadAccess ] = Field (None , title = "Read access" )
2338
2439
2540class 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+
2651 text : constr (min_length = 1 ) = Field (..., title = "Text" )
2752 lang : Optional [Literal ["en" , "de" ]] = Field ("en" , title = "Lang code" )
2853
2954
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" )
3268
3369
3470class WikiPage (OswBaseModel ):
3571 """
3672 The wiki page containing this entity
3773 """
3874
75+ class Config :
76+ schema_extra = {
77+ "title" : "Wiki page" ,
78+ "description" : "The wiki page containing this entity" ,
79+ }
80+
3981 title : Optional [str ] = Field (None , title = "Title" )
4082 """
4183 The page title
@@ -47,6 +89,14 @@ class WikiPage(OswBaseModel):
4789
4890
4991class 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+
50100 uuid : UUID = Field (default_factory = uuid4 , title = "UUID" )
51101 wiki_page : Optional [WikiPage ] = Field (None , title = "Wiki page" )
52102 """
@@ -59,6 +109,70 @@ class Meta(OswBaseModel):
59109
60110
61111class 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+
62176 rdf_type : Optional [Set [str ]] = Field (None , title = "Additional RDF type(s)" )
63177 """
64178 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):
83197 query_label : Optional [str ] = Field (None , title = "Query label" )
84198 description : Optional [List [Description ]] = Field (None , title = "Description" )
85199 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+ )
87203 """
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.
89205 """
90206 keywords : Optional [List [str ]] = Field (None , title = "Keywords / Tags" )
91207 """
@@ -103,6 +219,9 @@ class Entity(OswBaseModel):
103219
104220
105221class ObjectStatement (OswBaseModel ):
222+ class Config :
223+ schema_extra = {"title" : "Object Statement" }
224+
106225 rdf_type : Optional [Any ] = "rdf:Statement"
107226 uuid : UUID = Field (default_factory = uuid4 , title = "UUID" )
108227 label : Optional [List [Label ]] = Field (None , title = "Label" )
@@ -118,6 +237,9 @@ class ObjectStatement(OswBaseModel):
118237
119238
120239class DataStatement (OswBaseModel ):
240+ class Config :
241+ schema_extra = {"title" : "Data Statement" }
242+
121243 rdf_type : Optional [Any ] = "rdf:Statement"
122244 uuid : UUID = Field (default_factory = uuid4 , title = "UUID" )
123245 label : Optional [List [Label ]] = Field (None , title = "Label" )
@@ -133,6 +255,9 @@ class DataStatement(OswBaseModel):
133255
134256
135257class QuantityStatement (OswBaseModel ):
258+ class Config :
259+ schema_extra = {"title" : "Quantity Statement" }
260+
136261 rdf_type : Optional [Any ] = "rdf:Statement"
137262 uuid : UUID = Field (default_factory = uuid4 , title = "UUID" )
138263 label : Optional [List [Label ]] = Field (None , title = "Label" )
@@ -151,6 +276,18 @@ class QuantityStatement(OswBaseModel):
151276
152277
153278class 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+
154291 type : Optional [List [str ]] = Field (
155292 ["Category:Item" ], min_items = 1 , title = "Types/Categories"
156293 )
0 commit comments