I think that it's not difficult to program what you want in Jena. Also, Protégé is like a black box that we can't determine how it really works (it's based on OWLApi).
I agree with Vinicius, Protege 4.* has an ontology metrics tab. And if it's not visible (I think it's not visible in the default setup), you can make it appear through Window > Views > Ontology Views > Ontology Metrics.
I got it via ontology metrics tab. Actually I don't have strong base SPARQL queries. I think it is difficult to understand for beginner like me. Anyway thank you so much.