I had an opportunity to count co-occurrence frequencies for RDF triples, so this is a memo of the process. Following the article below, I will again use the Japan Search RDF store as an example.
The following counts the number of triples that share a common creator (schema:creator) among instances of the sword type. The filter avoids identical instances and prevents duplicate counting.