<Requests>
    <AqlRequest>
        <RequestURL>
            <![CDATA[
                with edges
                for edg IN edges
                filter edg._key in ${argument}
                remove edg IN edges
            ]]>
        </RequestURL>
        <RequestArgument type="AQL">
            <RequestArgumentURL>
                <![CDATA[
                    WITH applications, subject, history, edges

                    FOR app IN applications
                        FILTER app.statement.recruitsData.mainInfo[0].id IN @ids
                        LET parentEdges = (
                            FOR vertex, edge, path
                                IN 1..1
                                OUTBOUND app._id edges
                                OPTIONS { uniqueVertices: "path" }
                                FILTER edge.field IN ["applicant", "history", "interdepreq"]
                                RETURN { edgesId: edge._key, parent: DOCUMENT(vertex._id) }
                        )
                        RETURN {
                            applicationId: app._key,
                            edgesId: (FOR e IN parentEdges RETURN e.edgesId),
                            subjectId: (FOR e IN parentEdges FILTER e.parent.schema == "Subject" RETURN e.parent._key),
                            historyId: (FOR e IN parentEdges FILTER e.parent.schema == "History" RETURN e.parent._key),
                            interdepreqId: (FOR e IN parentEdges FILTER e.parent.schema == "Interdepreq" RETURN e.parent._key)
                        }
                ]]>
            </RequestArgumentURL>
        </RequestArgument>
        <AqlRequestCollections>
            <AqlRequestCollection type="read">applications</AqlRequestCollection>
            <AqlRequestCollection type="read">subject</AqlRequestCollection>
            <AqlRequestCollection type="read">history</AqlRequestCollection>
            <AqlRequestCollection type="read, write">edges</AqlRequestCollection>
        </AqlRequestCollections>
        <AqlConnectionParams>
            <Host>localhost</Host>
            <Port>8529</Port>
            <Username>root</Username>
            <Password>test</Password>
            <Database>_system</Database>
        </AqlConnectionParams>
    </AqlRequest>
</Requests>