def get(self, id):
        """
        Returns the association with a given identifier.

        An association connects, at a minimum, two things, designated subject and object,
        via some relationship. Associations also include evidence, provenance etc.
        """
        args = parser.parse_args()

        return get_association(id)
Esempio n. 2
0
    def get(self, id):
        """
        Returns evidence graph as a png

        TODO - requires matplotlib which is hard to install
        """
        args = parser.parse_args()

        assoc = get_association(id, user_agent=USER_AGENT)
        eg = {'graphs': [assoc.get('evidence_graph')]}
        digraph = convert_json_object(eg)
        #fp = tempfile.TemporaryFile()
        nx.draw(digraph)
        fn = '/tmp/' + id + '.png'  # TODO
        plt.savefig(fn)
        return send_file(fn)