There is an API formalizing this style of matrix/graph computation called GraphBLAS, coming soon to a language and database near you.
Here is an easy to read but math focused introduction to the topic by Dr Jeremy Kepner Head and Founder of the MIT Lincoln Laboratory Supercomputing Center:
http://www.mit.edu/~kepner/GraphBLAS/GraphBLAS-Math-release....