summaryrefslogtreecommitdiffstats
path: root/aai-schema-ingest/src/test/resources/edgeRules
diff options
context:
space:
mode:
authorThreefoot, Jane (jt6620) <jt6620@att.com>2018-03-29 12:54:05 -0400
committerThreefoot, Jane (jt6620) <jt6620@att.com>2018-03-29 13:12:22 -0400
commitc20ee9965e16166f11a77a15b29204eebac4d08c (patch)
treefb485cbf9b68d3818fd8c257ab3dfb1feff590ac /aai-schema-ingest/src/test/resources/edgeRules
parent1ea271f2c395172d9f999da5748877b3cdbcd44b (diff)
added schema validation tools
Issue-ID: AAI-879 Change-Id: I028547c97450372252b76286a8b10f4dbed4d2bf Signed-off-by: Threefoot, Jane (jt6620) <jt6620@att.com>
Diffstat (limited to 'aai-schema-ingest/src/test/resources/edgeRules')
-rw-r--r--aai-schema-ingest/src/test/resources/edgeRules/containsValidationTest.json64
-rw-r--r--aai-schema-ingest/src/test/resources/edgeRules/cousinDefaultValidationTest.json112
-rw-r--r--aai-schema-ingest/src/test/resources/edgeRules/labelValidationTest1.json124
-rw-r--r--aai-schema-ingest/src/test/resources/edgeRules/labelValidationTest2.json52
-rw-r--r--aai-schema-ingest/src/test/resources/edgeRules/test3-butbad.json63
5 files changed, 415 insertions, 0 deletions
diff --git a/aai-schema-ingest/src/test/resources/edgeRules/containsValidationTest.json b/aai-schema-ingest/src/test/resources/edgeRules/containsValidationTest.json
new file mode 100644
index 00000000..06e599b1
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/edgeRules/containsValidationTest.json
@@ -0,0 +1,64 @@
+{
+ "rules" : [
+ {
+ "from": "human",
+ "to": "monster",
+ "label": "fights",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "${direction}",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"valid set with one containment"
+ },
+ {
+ "from": "human",
+ "to": "monster",
+ "label": "avoids",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"valid set with one containment"
+ },
+ {
+ "from": "cheese",
+ "to": "bread",
+ "label": "eatenWith",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"valid set with no containment"
+ },
+ {
+ "from": "box",
+ "to": "cat",
+ "label": "contains",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "${direction}",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"invalid set with more than one containment"
+ },
+ {
+ "from": "box",
+ "to": "cat",
+ "label": "encapsulates",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "IN",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"invalid set with more than one containment"
+ }
+ ]
+} \ No newline at end of file
diff --git a/aai-schema-ingest/src/test/resources/edgeRules/cousinDefaultValidationTest.json b/aai-schema-ingest/src/test/resources/edgeRules/cousinDefaultValidationTest.json
new file mode 100644
index 00000000..1a5b8a9b
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/edgeRules/cousinDefaultValidationTest.json
@@ -0,0 +1,112 @@
+{
+ "rules" : [
+ {
+ "from": "human",
+ "to": "monster",
+ "label": "fights",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"valid set as cousin/contains have separate defaulting"
+ },
+ {
+ "from": "human",
+ "to": "monster",
+ "label": "builds",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "OUT",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"valid set as cousin/contains have separate defaulting"
+ },
+ {
+ "from": "boop",
+ "to": "beep",
+ "label": "isTransformedByRobotsInto",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"valid set with exactly 1 default"
+ },
+ {
+ "from": "boop",
+ "to": "beep",
+ "label": "yields",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "false",
+ "description":"valid set with exactly 1 default"
+ },
+ {
+ "from": "sheep",
+ "to": "wool",
+ "label": "produces",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"invalid set with multiple defaults"
+ },
+ {
+ "from": "wool",
+ "to": "sheep",
+ "label": "isShearedFrom",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"invalid set with multiple defaults"
+ },
+ {
+ "from": "cloth",
+ "to": "thread",
+ "label": "isWovenFrom",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "false",
+ "description":"invalid set with no defaults"
+ },
+ {
+ "from": "cloth",
+ "to": "thread",
+ "label": "unravelsTo",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "false",
+ "description":"invalid set with no defaults"
+ },
+ {
+ "from": "family",
+ "to": "baby",
+ "label": "raises",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "OUT",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"vacuously valid set (ie no cousin so doesn't even matter)"
+ }
+ ]
+} \ No newline at end of file
diff --git a/aai-schema-ingest/src/test/resources/edgeRules/labelValidationTest1.json b/aai-schema-ingest/src/test/resources/edgeRules/labelValidationTest1.json
new file mode 100644
index 00000000..1a5bd487
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/edgeRules/labelValidationTest1.json
@@ -0,0 +1,124 @@
+{
+ "rules": [
+ {
+ "from": "human",
+ "to": "monster",
+ "label": "fights",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"will be part of valid set"
+ },
+ {
+ "from": "monster",
+ "to": "human",
+ "label": "ignores",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"will be part of valid set"
+ },
+ {
+ "from": "human",
+ "to": "monster",
+ "label": "tames",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "OUT",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"will be part of valid set"
+ },
+ {
+ "from": "sphinx",
+ "to": "monster",
+ "label": "isA",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"will be part of invalid set - dup label, cousin and containment, from/to flipped"
+ },
+ {
+ "from": "sphinx",
+ "to": "monster",
+ "label": "isA",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "OUT",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"will be part of invalid set - dup label, cousin and containment, from/to flipped"
+ },
+ {
+ "from": "griffin",
+ "to": "hippogriff",
+ "label": "fliesPast",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "false",
+ "description":"will be part of invalid set - dup label, both cousins, from/to flipped"
+ },
+ {
+ "from": "hippogriff",
+ "to": "griffin",
+ "label": "fliesPast",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"will be part of invalid set - dup label, both cousins, from/to flipped"
+ },
+ {
+ "from": "human",
+ "to": "toaster",
+ "label": "owns",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "OUT",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"will be part of valid set (dup label (human owns) but on different pair so ok)"
+ },
+ {
+ "from": "badger",
+ "to": "mushroom",
+ "label": "onap.whatever.BindsTo",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"will be part of invalid set - full copy in file2"
+ },
+ {
+ "from": "lava",
+ "to": "floor",
+ "label": "is",
+ "direction": "IN",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"will be part of invalid set - dup in file2, contains and cousin, from/to flipped"
+ }
+ ]
+} \ No newline at end of file
diff --git a/aai-schema-ingest/src/test/resources/edgeRules/labelValidationTest2.json b/aai-schema-ingest/src/test/resources/edgeRules/labelValidationTest2.json
new file mode 100644
index 00000000..5743fbb9
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/edgeRules/labelValidationTest2.json
@@ -0,0 +1,52 @@
+{
+ "rules": [
+ {
+ "from": "human",
+ "to": "strange-and-interesting-plant",
+ "label": "owns",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "OUT",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"will be part of valid set (dup label (human owns) to stuff in file1, but different pair so ok)"
+ },
+ {
+ "from": "badger",
+ "to": "mushroom",
+ "label": "onap.whatever.BindsTo",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"will be part of invalid set - full copy in file2"
+ },
+ {
+ "from": "floor",
+ "to": "lava",
+ "label": "is",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"will be part of invalid set - dup in file2, contains and cousin, from/to flipped"
+ },
+ {
+ "from": "human",
+ "to": "toaster",
+ "label": "builds",
+ "direction": "OUT",
+ "multiplicity": "ONE2ONE",
+ "contains-other-v": "NONE",
+ "delete-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":"will be part of valid set across both files"
+ }
+ ]
+} \ No newline at end of file
diff --git a/aai-schema-ingest/src/test/resources/edgeRules/test3-butbad.json b/aai-schema-ingest/src/test/resources/edgeRules/test3-butbad.json
new file mode 100644
index 00000000..f20caebb
--- /dev/null
+++ b/aai-schema-ingest/src/test/resources/edgeRules/test3-butbad.json
@@ -0,0 +1,63 @@
+{
+ "rules": [
+ {
+ "from": "l-interface",
+ "to": "logical-link",
+ "label": "tosca.relationships.network.LinksTo",
+ "direction": "OUT",
+ "multiplicity": "MANY2MANY",
+ "contains-other-v": "NONE",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":""
+ },
+ {
+ "from": "logical-link",
+ "to": "l-interface",
+ "label": "org.onap.relationships.inventory.Source",
+ "direction": "OUT",
+ "multiplicity": "ONE2MANY",
+ "contains-other-v": "NONE",
+ "delete-other-v": "!${direction}",
+ "prevent-delete": "NONE",
+ "default": "false",
+ "description":""
+ },
+ {
+ "from": "logical-link",
+ "to": "l-interface",
+ "label": "org.onap.relationships.inventory.Source",
+ "direction": "OUT",
+ "multiplicity": "ONE2MANY",
+ "contains-other-v": "NONE",
+ "delete-other-v": "!${direction}",
+ "prevent-delete": "NONE",
+ "default": "false",
+ "description":""
+ },
+ {
+ "from": "l-interface",
+ "to": "lag-interface",
+ "label": "org.onap.relationships.inventory.BelongsTo",
+ "direction": "OUT",
+ "multiplicity": "MANY2ONE",
+ "contains-other-v": "!${direction}",
+ "delete-other-v": "!${direction}",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":""
+ },
+ {
+ "from": "gooble",
+ "to": "logical-link",
+ "label": "org.onap.relationships.inventory.Uses",
+ "direction": "OUT",
+ "multiplicity": "MANY2MANY",
+ "contains-other-v": "NONE",
+ "delete-other-v": "${direction}",
+ "prevent-delete": "NONE",
+ "default": "true",
+ "description":""
+ }
+ ]
+} \ No newline at end of file