/ Published in: PHP
Expand |
Embed | Plain Text
public function executeGetLocation(sfWebRequest $request) { $ressource = $request->getParameter('ressource'); { $query = "SELECT ?location WHERE {{ <" . $ressource . "> <http://dbpedia.org/ontology/locationCity> ?location }}"; $searchUrl = 'http://dbpedia.org/sparql?' . '&format=json'; } $ch= curl_init(); curl_setopt($ch, CURLOPT_URL, $searchUrl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); return $this->renderText( json_encode($response)); }
You need to login to post a comment.
