|
| 1 | +{ |
| 2 | + "@context": { |
| 3 | + "schema": "http://schema.org/", |
| 4 | + "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", |
| 5 | + "rdfs": "http://www.w3.org/2000/01/rdf-schema#", |
| 6 | + "test": "http://discovery.biothings.io/test/" |
| 7 | + }, |
| 8 | + "@graph": [ |
| 9 | + { |
| 10 | + "@id": "test:GrandParentClass", |
| 11 | + "@type": "rdfs:Class", |
| 12 | + "rdfs:comment": "A grandparent class with validation", |
| 13 | + "rdfs:label": "GrandParentClass", |
| 14 | + "rdfs:subClassOf": { |
| 15 | + "@id": "schema:Thing" |
| 16 | + }, |
| 17 | + "$validation": { |
| 18 | + "$schema": "http://json-schema.org/draft-07/schema#", |
| 19 | + "type": "object", |
| 20 | + "properties": { |
| 21 | + "grandParentProp1": { |
| 22 | + "description": "First property from grandparent", |
| 23 | + "type": "string" |
| 24 | + }, |
| 25 | + "grandParentProp2": { |
| 26 | + "description": "Second property from grandparent", |
| 27 | + "type": "number" |
| 28 | + } |
| 29 | + }, |
| 30 | + "required": ["grandParentProp1"] |
| 31 | + } |
| 32 | + }, |
| 33 | + { |
| 34 | + "@id": "test:grandParentProp1", |
| 35 | + "@type": "rdf:Property", |
| 36 | + "rdfs:comment": "First property from grandparent", |
| 37 | + "rdfs:label": "grandParentProp1", |
| 38 | + "schema:domainIncludes": { |
| 39 | + "@id": "test:GrandParentClass" |
| 40 | + }, |
| 41 | + "schema:rangeIncludes": { |
| 42 | + "@id": "schema:Text" |
| 43 | + } |
| 44 | + }, |
| 45 | + { |
| 46 | + "@id": "test:grandParentProp2", |
| 47 | + "@type": "rdf:Property", |
| 48 | + "rdfs:comment": "Second property from grandparent", |
| 49 | + "rdfs:label": "grandParentProp2", |
| 50 | + "schema:domainIncludes": { |
| 51 | + "@id": "test:GrandParentClass" |
| 52 | + }, |
| 53 | + "schema:rangeIncludes": { |
| 54 | + "@id": "schema:Number" |
| 55 | + } |
| 56 | + }, |
| 57 | + { |
| 58 | + "@id": "test:ParentClass", |
| 59 | + "@type": "rdfs:Class", |
| 60 | + "rdfs:comment": "A parent class with some properties", |
| 61 | + "rdfs:label": "ParentClass", |
| 62 | + "rdfs:subClassOf": { |
| 63 | + "@id": "test:GrandParentClass" |
| 64 | + }, |
| 65 | + "$validation": { |
| 66 | + "$schema": "http://json-schema.org/draft-07/schema#", |
| 67 | + "type": "object", |
| 68 | + "properties": { |
| 69 | + "parentProp1": { |
| 70 | + "description": "First property from parent", |
| 71 | + "type": "string" |
| 72 | + }, |
| 73 | + "parentProp2": { |
| 74 | + "description": "Second property from parent", |
| 75 | + "type": "string" |
| 76 | + }, |
| 77 | + "parentProp3": { |
| 78 | + "description": "Third property from parent", |
| 79 | + "type": "integer" |
| 80 | + } |
| 81 | + }, |
| 82 | + "required": ["parentProp1", "parentProp2"] |
| 83 | + } |
| 84 | + }, |
| 85 | + { |
| 86 | + "@id": "test:parentProp1", |
| 87 | + "@type": "rdf:Property", |
| 88 | + "rdfs:comment": "First property from parent", |
| 89 | + "rdfs:label": "parentProp1", |
| 90 | + "schema:domainIncludes": { |
| 91 | + "@id": "test:ParentClass" |
| 92 | + }, |
| 93 | + "schema:rangeIncludes": { |
| 94 | + "@id": "schema:Text" |
| 95 | + } |
| 96 | + }, |
| 97 | + { |
| 98 | + "@id": "test:parentProp2", |
| 99 | + "@type": "rdf:Property", |
| 100 | + "rdfs:comment": "Second property from parent", |
| 101 | + "rdfs:label": "parentProp2", |
| 102 | + "schema:domainIncludes": { |
| 103 | + "@id": "test:ParentClass" |
| 104 | + }, |
| 105 | + "schema:rangeIncludes": { |
| 106 | + "@id": "schema:Text" |
| 107 | + } |
| 108 | + }, |
| 109 | + { |
| 110 | + "@id": "test:parentProp3", |
| 111 | + "@type": "rdf:Property", |
| 112 | + "rdfs:comment": "Third property from parent", |
| 113 | + "rdfs:label": "parentProp3", |
| 114 | + "schema:domainIncludes": { |
| 115 | + "@id": "test:ParentClass" |
| 116 | + }, |
| 117 | + "schema:rangeIncludes": { |
| 118 | + "@id": "schema:Integer" |
| 119 | + } |
| 120 | + }, |
| 121 | + { |
| 122 | + "@id": "test:ChildClass", |
| 123 | + "@type": "rdfs:Class", |
| 124 | + "rdfs:comment": "A child class that extends ParentClass", |
| 125 | + "rdfs:label": "ChildClass", |
| 126 | + "rdfs:subClassOf": { |
| 127 | + "@id": "test:ParentClass" |
| 128 | + }, |
| 129 | + "$validation": { |
| 130 | + "$schema": "http://json-schema.org/draft-07/schema#", |
| 131 | + "type": "object", |
| 132 | + "properties": { |
| 133 | + "childProp1": { |
| 134 | + "description": "First property specific to child", |
| 135 | + "type": "string" |
| 136 | + }, |
| 137 | + "childProp2": { |
| 138 | + "description": "Second property specific to child", |
| 139 | + "type": "boolean" |
| 140 | + } |
| 141 | + }, |
| 142 | + "required": ["childProp1"] |
| 143 | + } |
| 144 | + }, |
| 145 | + { |
| 146 | + "@id": "test:childProp1", |
| 147 | + "@type": "rdf:Property", |
| 148 | + "rdfs:comment": "First property specific to child", |
| 149 | + "rdfs:label": "childProp1", |
| 150 | + "schema:domainIncludes": { |
| 151 | + "@id": "test:ChildClass" |
| 152 | + }, |
| 153 | + "schema:rangeIncludes": { |
| 154 | + "@id": "schema:Text" |
| 155 | + } |
| 156 | + }, |
| 157 | + { |
| 158 | + "@id": "test:childProp2", |
| 159 | + "@type": "rdf:Property", |
| 160 | + "rdfs:comment": "Second property specific to child", |
| 161 | + "rdfs:label": "childProp2", |
| 162 | + "schema:domainIncludes": { |
| 163 | + "@id": "test:ChildClass" |
| 164 | + }, |
| 165 | + "schema:rangeIncludes": { |
| 166 | + "@id": "schema:Boolean" |
| 167 | + } |
| 168 | + }, |
| 169 | + { |
| 170 | + "@id": "test:SecondParentClass", |
| 171 | + "@type": "rdfs:Class", |
| 172 | + "rdfs:comment": "A second parent class with different properties", |
| 173 | + "rdfs:label": "SecondParentClass", |
| 174 | + "rdfs:subClassOf": { |
| 175 | + "@id": "schema:Thing" |
| 176 | + }, |
| 177 | + "$validation": { |
| 178 | + "$schema": "http://json-schema.org/draft-07/schema#", |
| 179 | + "type": "object", |
| 180 | + "properties": { |
| 181 | + "secondParentProp1": { |
| 182 | + "description": "First property from second parent", |
| 183 | + "type": "string" |
| 184 | + }, |
| 185 | + "secondParentProp2": { |
| 186 | + "description": "Second property from second parent", |
| 187 | + "type": "number" |
| 188 | + } |
| 189 | + }, |
| 190 | + "required": ["secondParentProp1"] |
| 191 | + } |
| 192 | + }, |
| 193 | + { |
| 194 | + "@id": "test:secondParentProp1", |
| 195 | + "@type": "rdf:Property", |
| 196 | + "rdfs:comment": "First property from second parent", |
| 197 | + "rdfs:label": "secondParentProp1", |
| 198 | + "schema:domainIncludes": { |
| 199 | + "@id": "test:SecondParentClass" |
| 200 | + }, |
| 201 | + "schema:rangeIncludes": { |
| 202 | + "@id": "schema:Text" |
| 203 | + } |
| 204 | + }, |
| 205 | + { |
| 206 | + "@id": "test:secondParentProp2", |
| 207 | + "@type": "rdf:Property", |
| 208 | + "rdfs:comment": "Second property from second parent", |
| 209 | + "rdfs:label": "secondParentProp2", |
| 210 | + "schema:domainIncludes": { |
| 211 | + "@id": "test:SecondParentClass" |
| 212 | + }, |
| 213 | + "schema:rangeIncludes": { |
| 214 | + "@id": "schema:Number" |
| 215 | + } |
| 216 | + }, |
| 217 | + { |
| 218 | + "@id": "test:MultiParentChildClass", |
| 219 | + "@type": "rdfs:Class", |
| 220 | + "rdfs:comment": "A child class that extends BOTH ParentClass and SecondParentClass", |
| 221 | + "rdfs:label": "MultiParentChildClass", |
| 222 | + "rdfs:subClassOf": [ |
| 223 | + { |
| 224 | + "@id": "test:ParentClass" |
| 225 | + }, |
| 226 | + { |
| 227 | + "@id": "test:SecondParentClass" |
| 228 | + } |
| 229 | + ], |
| 230 | + "$validation": { |
| 231 | + "$schema": "http://json-schema.org/draft-07/schema#", |
| 232 | + "type": "object", |
| 233 | + "properties": { |
| 234 | + "multiChildProp1": { |
| 235 | + "description": "Property specific to multi-parent child", |
| 236 | + "type": "string" |
| 237 | + } |
| 238 | + }, |
| 239 | + "required": ["multiChildProp1"] |
| 240 | + } |
| 241 | + }, |
| 242 | + { |
| 243 | + "@id": "test:multiChildProp1", |
| 244 | + "@type": "rdf:Property", |
| 245 | + "rdfs:comment": "Property specific to multi-parent child", |
| 246 | + "rdfs:label": "multiChildProp1", |
| 247 | + "schema:domainIncludes": { |
| 248 | + "@id": "test:MultiParentChildClass" |
| 249 | + }, |
| 250 | + "schema:rangeIncludes": { |
| 251 | + "@id": "schema:Text" |
| 252 | + } |
| 253 | + } |
| 254 | + ] |
| 255 | +} |
0 commit comments