convert SQL to SPARQL

I, 

i have a doubt in converting the followyng SQL,



SELECT p.nome, p.morada,
COUNT(r.matricula)

FROM Pessoa as p,
Registo as r 

WHERE p.nif = r.nif

GROUP BY p.nome

to SPARQL. 





PREFIX ex:<http://exemplo.com/ontologia Ex#>

SELECT ?nome ?morada COUNT(?matricula)

WHERE {?pId  rdf:type  <ex:Pessoa>

 ?rId rdf:type  <ex:Registo>

 ?pId <ex:nome> ?nome

 ?pId <ex:morada> ?morada

 ?rId <ex:temRegisto>
?registoId

 ?registoId <ex:matricula> ?matricula GROUP BY (?nome) }
Is  this correct, or the GROUP BY is an extension?
Thanks,
Ricardo.
 		 	   		  
_________________________________________________________________
Windows Live: Friends get your Flickr, Yelp, and Digg updates when they e-mail you.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_3:092010

Received on Friday, 16 October 2009 17:21:12 UTC