For Example: "john@mora.org" is the email address and, I want to extract mora from this email using SPARQL
This is my approach which didn't give the expected result:
BASE <http://timbl.org/foaf.rdf>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?work_place
FROM <http://timbl.org/foaf.rdf>
WHERE
{
<#timbl> foaf:knows ?friend .
?friend foaf:name ?name .
?friend foaf:mbox ?mail .
BIND(REPLACE(STR(?mail), "^.*@", "", "i") as ?work_place) .
}
Example input:
"john@mora.org"
Expected Result:
"mora"
The result I Received :
"mora.org"
What needed to be added in the query or RegEx to get the expected output