{
    "@context": [
        "https://secorolab.github.io/metamodels/acceptance-criteria/bdd/bdd.json",
        "https://secorolab.github.io/metamodels/acceptance-criteria/bdd/behaviour.json",
        "https://secorolab.github.io/metamodels/acceptance-criteria/bdd/task.json",
        "https://secorolab.github.io/metamodels/time-constraint.json",
        {
            "tmpl": "https://secorolab.github.io/models/acceptance-criteria/bdd/templates/",
            "scene": "https://secorolab.github.io/models/acceptance-criteria/bdd/scenes/secorolab/"
        }
    ],
    "@graph": [
        { "@id": "tmpl:bhv-pickplace", "@type": ["bhv:Behaviour", "bhv:Pick", "bhv:Place"] },
        { "@id": "tmpl:task-pickplace", "@type": "task:Task" },

        { "@id": "tmpl:evt-scr-start", "@type": "time:Instant" },
        { "@id": "tmpl:evt-scr-end", "@type": "time:Instant" },
        { "@id": "tmpl:evt-pick-start", "@type": "time:Instant" },
        { "@id": "tmpl:evt-pick-end", "@type": "time:Instant" },
        { "@id": "tmpl:evt-place-start", "@type": "time:Instant" },
        { "@id": "tmpl:evt-place-end", "@type": "time:Instant" },

        { "@id": "tmpl:pickplace-given", "@type": "bdd:Given" },
        { "@id": "tmpl:pickplace-when", "@type": "bdd:When" },
        { "@id": "tmpl:pickplace-then", "@type": "bdd:Then" },
        {
            "@id": "tmpl:scenario-pickplace", "@type": "bdd:Scenario",
            "of-behaviour": "tmpl:bhv-pickplace",
            "of-task": "tmpl:task-pickplace",
            "given": "tmpl:pickplace-given",
            "when": "tmpl:pickplace-when",
            "then": "tmpl:pickplace-then"
        },

        { "@id": "tmpl:var-pick-ws", "@type": "bdd:ScenarioVariable" },
        { "@id": "tmpl:var-place-ws", "@type": "bdd:ScenarioVariable" },
        { "@id": "tmpl:var-target-obj", "@type": "bdd:ScenarioVariable" },
        { "@id": "tmpl:var-agent", "@type": "bdd:ScenarioVariable" },

        {
           "@id": "tmpl:flc-located-at-pick-ws",
           "@type": ["bdd:FluentClause", "bdd:LocatedAtPredicate", "tc:TimeConstraint", "tc:BeforeEventConstraint"],
           "clause-of": "tmpl:pickplace-given",
           "ref-object": "tmpl:var-target-obj",
           "ref-workspace": "tmpl:var-pick-ws",
           "before-event": "tmpl:evt-pick-start"
        },

        {
            "@id": "tmpl:flc-no-collide",
            "@type": [
                "bdd:FluentClause", "bdd:StringTemplatePredicate",
                "tc:TimeConstraint", "tc:DuringEventsConstraint"
            ],
            "tmpl-str": "\"{robot}\" does not collide with \"{ws1}\" and \"{ws2}\"",
            "arg-names": ["robot", "ws1", "ws2"],
            "arg-variables": [
                {"@id": "tmpl:var-agent"}, {"@id": "tmpl:var-pick-ws"}, {"@id": "tmpl:var-place-ws"}
            ],
            "clause-of": "tmpl:pickplace-then",
            "after-event": "tmpl:evt-pick-start",
            "before-event": "tmpl:evt-place-end"
        },

        {
           "@id": "tmpl:flc-is-held",
           "@type": [
                "bdd:FluentClause", "bdd:IsHeldPredicate", "tc:TimeConstraint", "tc:DuringEventsConstraint"
           ],
           "clause-of": "tmpl:pickplace-then",
           "ref-object": "tmpl:var-target-obj",
           "ref-agent": "tmpl:var-agent",
           "after-event": "tmpl:evt-pick-end", "before-event": "tmpl:evt-place-end"
        },

        {
           "@id": "tmpl:flc-located-at-place-ws",
           "@type": ["bdd:FluentClause", "bdd:LocatedAtPredicate", "tc:TimeConstraint", "tc:AfterEventConstraint"],
           "clause-of": "tmpl:pickplace-then",
           "ref-object": "tmpl:var-target-obj",
           "ref-workspace": "tmpl:var-place-ws",
           "after-event": "tmpl:evt-place-end"
        },

        {
            "@id": "tmpl:when-pickplace",
            "@type": ["bdd:WhenBehaviour", "tc:TimeConstraint", "tc:DuringEventsConstraint"],
            "of-behaviour": "tmpl:bhv-pickplace",
            "clause-of": "tmpl:pickplace-when",
            "target-obj": "tmpl:var-target-obj",
            "target-agn": "tmpl:var-agent",
            "target-ws": "tmpl:var-place-ws",
            "after-event": "tmpl:evt-pick-start", "before-event": "tmpl:evt-place-end"
        },

        {
            "@id": "tmpl:tmpl-pickplace",
            "@type": ["bdd:ScenarioTemplate", "tc:TimeConstraint", "tc:DuringEventsConstraint" ],
            "of-scenario": "tmpl:scenario-pickplace",
            "has-scene": "scene:scn-pickplace",
            "has-clause": [
                "tmpl:flc-located-at-pick-ws", "tmpl:when-pickplace",
                "tmpl:flc-is-held", "tmpl:flc-located-at-place-ws", "tmpl:flc-no-collide"
            ],
            "after-event": "tmpl:evt-scr-start", "before-event": "tmpl:evt-scr-end"
        }
    ]
}
