327 | | || `assoc_defs` || For complex topic types: Optional. Default is no child types. You can add child types later on through an update operation. However, the child types are typically specified at topic type creation time.\\\\For simple topic types: Do //not// specify child types. || |
| 327 | || `assoc_defs` || For complex topic types: Optional. Default is no child types. You can add child types later on through an update operation. However, the child types are typically specified at creation time.\\\\For simple topic types: Do //not// specify child types. || |
| 328 | || `view_config_topics` || Optional. Default is no view models. || |
| 329 | |
| 330 | When creating a complex topic type: For details about the association definition format see DataFormat#AssociationDefinition. |
| 331 | |
| 332 | For a create operation not all of the association definition's properties are involved: |
| 333 | |
| 334 | ||= Property =||= Mandatory / Optional =|| |
| 335 | || `assoc_type_uri` || Mandatory. || |
| 336 | || `whole_cardinality_uri` || For a "composition": Do //not// specify the parent cardinality ("one" is assumed).\\\\For an "aggregation": Mandatory. || |
| 337 | || `part_topic_type_uri` || Mandatory. || |
| 338 | || `part_cardinality_uri` || Mandatory. || |
373 | | curl localhost:8080/core/topictype -X POST -H Content-Type:application/json -d ' |
374 | | {uri: "spaceorg.planetarium.planet_name", |
375 | | value: "Name", |
376 | | data_type_uri: "dm4.core.text"}' |
377 | | |
378 | | curl localhost:8080/core/topictype -X POST -H Content-Type:application/json -d ' |
379 | | {uri: "spaceorg.planetarium.mass", |
380 | | value: "Mass", |
381 | | data_type_uri: "dm4.core.number"}' |
382 | | |
383 | | curl localhost:8080/core/topictype -X POST -H Content-Type:application/json -d ' |
384 | | {uri: "spaceorg.planetarium.distance_to_earth", |
385 | | value: "Distance to Earth", |
386 | | data_type_uri: "dm4.core.number"}' |
| 384 | curl localhost:8080/core/topictype -X POST -H Content-Type:application/json \ |
| 385 | -d '{uri: "spaceorg.planetarium.planet_name", |
| 386 | value: "Name", |
| 387 | data_type_uri: "dm4.core.text"}' |
| 388 | |
| 389 | curl localhost:8080/core/topictype -X POST -H Content-Type:application/json \ |
| 390 | -d '{uri: "spaceorg.planetarium.mass", |
| 391 | value: "Mass", |
| 392 | data_type_uri: "dm4.core.number"}' |
| 393 | |
| 394 | curl localhost:8080/core/topictype -X POST -H Content-Type:application/json \ |
| 395 | -d '{uri: "spaceorg.planetarium.distance_to_earth", |
| 396 | value: "Distance to Earth", |
| 397 | data_type_uri: "dm4.core.number"}' |
392 | | curl localhost:8080/core/topictype -i -X POST -H Content-Type:application/json -d ' |
393 | | {uri: "spaceorg.planetarium.planet", |
394 | | value: "Planet", |
395 | | data_type_uri: "dm4.core.composite", |
396 | | assoc_defs: [ |
397 | | { |
398 | | assoc_type_uri: "dm4.core.composition_def", |
399 | | part_topic_type_uri: "spaceorg.planetarium.planet_name", |
400 | | part_cardinality_uri: "dm4.core.one" |
401 | | }, { |
402 | | assoc_type_uri: "dm4.core.composition_def", |
403 | | part_topic_type_uri: "spaceorg.planetarium.mass", |
404 | | part_cardinality_uri: "dm4.core.one" |
405 | | }, { |
406 | | assoc_type_uri: "dm4.core.composition_def", |
407 | | part_topic_type_uri: "spaceorg.planetarium.distance_to_earth", |
408 | | part_cardinality_uri: "dm4.core.one" |
409 | | }]}' \ |
| 403 | curl localhost:8080/core/topictype -i -X POST -H Content-Type:application/json \ |
| 404 | -d '{uri: "spaceorg.planetarium.planet", |
| 405 | value: "Planet", |
| 406 | data_type_uri: "dm4.core.composite", |
| 407 | assoc_defs: [ |
| 408 | { |
| 409 | assoc_type_uri: "dm4.core.composition_def", |
| 410 | part_topic_type_uri: "spaceorg.planetarium.planet_name", |
| 411 | part_cardinality_uri: "dm4.core.one" |
| 412 | }, { |
| 413 | assoc_type_uri: "dm4.core.composition_def", |
| 414 | part_topic_type_uri: "spaceorg.planetarium.mass", |
| 415 | part_cardinality_uri: "dm4.core.one" |
| 416 | }, { |
| 417 | assoc_type_uri: "dm4.core.composition_def", |
| 418 | part_topic_type_uri: "spaceorg.planetarium.distance_to_earth", |
| 419 | part_cardinality_uri: "dm4.core.one" |
| 420 | }]}' \ |