I want to count how many times the foaf:account property is used(SPARQL)

I want to write a SPARQL query to count how many times the foaf:account property is used and how to execute it in Java.

Can someone help me please?

In this case, i want the SPARQL query to return "2".


         xmlns:foaf="http://xmlns.com/foaf/0.1/">   
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<foaf:Person rdf:about="https://someone"> &nbsp; &nbsp;&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<foaf:lastName>Surname</foaf:lastName> &nbsp;&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<foaf:account>https://www.acc1.com</foaf:account> &nbsp;&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<foaf:account>https://www.acc2.com</foaf:account>&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<foaf:weblog>https://smth</foaf:weblog> &nbsp;&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </foaf:Person> &nbsp;
</rdf:RDF><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

Best Answer