Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: improve XML and JSON Schemas (DEV-449) #180

Merged
merged 10 commits into from Apr 25, 2022
34 changes: 24 additions & 10 deletions knora/dsplib/schemas/data.xsd
Expand Up @@ -200,16 +200,25 @@
</xs:simpleContent>
</xs:complexType>

<!-- boolean value type -->
<xs:complexType name="boolean_type">
<xs:simpleContent>
<xs:extension base="xs:boolean">
<xs:attribute name="comment" type="xs:string"/>
<xs:attribute name="permissions" type="xs:NCName" use="required"/>
</xs:extension>
</xs:simpleContent>
<!-- boolean value type
<xs:complexType name="boolean_type">
<xs:sequence>
<xs:element name="text" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="permissions" type="xs:NCName" use="required"/>
<xs:attribute name="comment" type="xs:string"/>
</xs:complexType>

</xs:complexType>-->

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the commented out code be deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'll delete it. Thanks for the review!


<xs:complexType name="boolean_type">
<xs:simpleContent>
<xs:extension base="xs:boolean">
<xs:attribute name="comment" type="xs:string"/>
<xs:attribute name="permissions" type="xs:NCName" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<!-- textprop_type -->
<xs:complexType name="textprop_type">
<xs:sequence>
Expand Down Expand Up @@ -334,7 +343,7 @@
<!-- booleanprop_type -->
<xs:complexType name="booleanprop_type">
<xs:sequence>
<xs:element name="boolean" type="boolean_type" minOccurs="1" maxOccurs="unbounded"/>
<xs:element name="boolean" type="boolean_type" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:complexType>
Expand Down Expand Up @@ -454,7 +463,12 @@
<xs:complexType>
<xs:sequence>
<xs:element name="permissions" type="permissions_type" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="resource" type="resource_type" minOccurs="1" maxOccurs="unbounded"/>
<xs:element name="resource" type="resource_type" minOccurs="1" maxOccurs="unbounded">
<xs:unique name="UniqueNameAttr">
<xs:selector xpath=".//*"/>
<xs:field xpath="@name"/>
</xs:unique>
</xs:element>
</xs:sequence>
<xs:attribute name="default-ontology" type="xs:string"/>
<xs:attribute name="shortcode" type="knorashortcode_type"/>
Expand Down
19 changes: 18 additions & 1 deletion knora/dsplib/schemas/ontology.json
Expand Up @@ -379,6 +379,7 @@
},
"required": [
"name",
"super",
"object",
"labels",
"gui_element"
Expand Down Expand Up @@ -475,6 +476,22 @@
},
"then": {
"properties": {
"super": {
"type": "array",
"items": {
"type": "string",
"oneOf": [
{
"enum": [
"hasGeometry"
]
},
{
"$ref": "#/definitions/prefixedname"
}
]
}
},
"gui_element": {
"enum": [
"Geometry",
Expand All @@ -496,7 +513,7 @@
"properties": {
"gui_element": {
"const":
"Geonames"
"Geonames"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion testdata/test-onto.json
Expand Up @@ -293,7 +293,7 @@
{
"name": "hasGeometry",
"super": [
"hasValue"
"hasGeometry"
],
"object": "GeomValue",
"labels": {
Expand Down