I am struggling with what seems like a simple issue, even after reading through various Q&A forums. I have a JSON response from an AJAX call that executes a SPARQL query:
{
"head": {
"vars": [ "name" , "email" ]
} ,
"results": {
"bindings": [
{
"name": { "type": "literal" , "value": "Name Surname" } ,
"email": { "type": "literal" , "value": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0b656a666e25787e79656a666a">[email protected]</a>" }
}
]
}
}
My aim is to retrieve the "name" of the user, but the response always contains multiple elements instead of just one.
I have tried accessing the "name" value using different methods such as:
response["name"].value
//or
response[0]["name"]
//or
response.name
However, none of these solutions seem to work. Can someone guide me on how to correctly extract the name value? Your help is greatly appreciated.