diff --git a/example/properties_directory/non-scalar/hubbard_u.json b/example/properties_directory/non-scalar/hubbard_u.json index cccc757b8..cbe617da5 100644 --- a/example/properties_directory/non-scalar/hubbard_u.json +++ b/example/properties_directory/non-scalar/hubbard_u.json @@ -4,12 +4,18 @@ "values": [ { "id": 1, - "atomicSpecies": "Co", + "atomicSpecies": "Co1", "orbitalName": "3d", "value": 6.7553 }, { "id": 2, + "atomicSpecies": "Co2", + "orbitalName": "3d", + "value": 6.7553 + }, + { + "id": 3, "atomicSpecies": "O", "orbitalName": "3p", "value": 2.2438 diff --git a/schema/core/reusable/atomic_data/numeric.json b/schema/core/reusable/atomic_data/numeric.json new file mode 100644 index 000000000..e708cfdff --- /dev/null +++ b/schema/core/reusable/atomic_data/numeric.json @@ -0,0 +1,25 @@ +{ + "$id": "core/reusable/atomic-data/numeric-data", + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Atomic data numeric properties", + "description": "Numeric fields used in atomic data", + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "Site number or index in the lattice" + }, + "id2": { + "type": "integer", + "description": "Site number or index in the lattice of second site" + }, + "distance": { + "type": "number", + "description": "Distance between two sites in angstrom." + }, + "value": { + "type": "number", + "description": "Value related to a specific property, e.g., Hubbard U, V etc." + } + } +} diff --git a/schema/core/reusable/atomic_data/string.json b/schema/core/reusable/atomic_data/string.json new file mode 100644 index 000000000..7aaaab7ba --- /dev/null +++ b/schema/core/reusable/atomic_data/string.json @@ -0,0 +1,27 @@ +{ + "$id": "core/reusable/atomic-data/string-data", + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Atomic data string properties", + "description": "String fields used in atomic data", + "type": "object", + "properties": { + "atomicSpecies": { + "type": "string", + "pattern": "^[a-zA-Z]{1,2}[\\d+]?$", + "description": "Example: Co1, Mn" + }, + "atomicSpecies2": { + "type": "string", + "pattern": "^[a-zA-Z]{1,2}[\\d+]?$", + "description": "Example: Co2, O" + }, + "orbitalName": { + "type": "string", + "pattern": "^[1-7][sSpPdDfF]$" + }, + "orbitalName2": { + "type": "string", + "pattern": "^[1-7][sSpPdDfF]$" + } + } +} diff --git a/schema/core/reusable/atomic_data_per_orbital.json b/schema/core/reusable/atomic_data_per_orbital.json index 203cfcec3..63ba16210 100644 --- a/schema/core/reusable/atomic_data_per_orbital.json +++ b/schema/core/reusable/atomic_data_per_orbital.json @@ -4,20 +4,13 @@ "title": "Atomic data per orbital", "description": "Atomic properties per orbital e.g., Hubbard U parameters.", "type": "object", - "properties": { - "id": { - "type": "number", - "description": "Site number in the lattice" + "allOf": [ + { + "$ref": "atomic_data/numeric.json" }, - "atomicSpecies": { - "type": "string", - "description": "Atomic species name. Example: Co, Ni1, O" - }, - "orbitalName": { - "type": "string", - "pattern": "^[1-7][sSpPdDfF]$", - "description": "Atomic orbital or Hubbard manifold." + { + "$ref": "atomic_data/string.json" } - }, - "required": ["id", "atomicSpecies", "orbitalName"] + ], + "required": ["id", "atomicSpecies", "orbitalName", "value"] } diff --git a/schema/core/reusable/atomic_data_per_orbital_pair.json b/schema/core/reusable/atomic_data_per_orbital_pair.json index 9733be52e..d0a5aa2a1 100644 --- a/schema/core/reusable/atomic_data_per_orbital_pair.json +++ b/schema/core/reusable/atomic_data_per_orbital_pair.json @@ -4,35 +4,13 @@ "title": "Atomic data per orbital pair", "description": "Atomic properties per orbital pair e.g., Hubbard V parameters.", "type": "object", - "properties": { - "id": { - "type": "number", - "description": "Site number or index in the lattice" + "allOf": [ + { + "$ref": "atomic_data/numeric.json" }, - "id2": { - "type": "number", - "description": "Site number or index in the lattice of second site" - }, - "atomicSpecies": { - "type": "string", - "description": "Example: Co1" - }, - "atomicSpecies2": { - "type": "string", - "description": "Example: O" - }, - "orbitalName": { - "type": "string", - "pattern": "^[1-7][sSpPdDfF]$" - }, - "orbitalName2": { - "type": "string", - "pattern": "^[1-7][sSpPdDfF]$" - }, - "distance": { - "type": "number", - "description": "Distance between two sites in angstrom." + { + "$ref": "atomic_data/string.json" } - }, - "required": ["id", "id2", "atomicSpecies", "atomicSpecies2"] + ], + "required": ["id", "id2", "atomicSpecies", "atomicSpecies2", "value"] } diff --git a/schema/properties_directory/non-scalar/hubbard_u.json b/schema/properties_directory/non-scalar/hubbard_u.json index 7d11d9b19..8da10b025 100644 --- a/schema/properties_directory/non-scalar/hubbard_u.json +++ b/schema/properties_directory/non-scalar/hubbard_u.json @@ -18,13 +18,7 @@ { "$ref": "../../core/reusable/atomic_data_per_orbital.json" } - ], - "properties": { - "value": { - "type": "number", - "description": "Hubbard U values in eV" - } - } + ] } } }, diff --git a/schema/properties_directory/non-scalar/hubbard_v.json b/schema/properties_directory/non-scalar/hubbard_v.json index 67fb68503..6deceacc6 100644 --- a/schema/properties_directory/non-scalar/hubbard_v.json +++ b/schema/properties_directory/non-scalar/hubbard_v.json @@ -18,13 +18,7 @@ { "$ref": "../../core/reusable/atomic_data_per_orbital_pair.json" } - ], - "properties": { - "value": { - "type": "number", - "description": "Hubbard V values in eV" - } - } + ] } } },