title: How to bind individual json data "values" in angular to named $scope variables (data returned using SPARQL query)?
body: <p>Newby to Angular so apologies if a stupid question. Have checked other questions on dataversity, stack overflow, google ...
  checked w3c and attempted several "try it and see solutions" but just can't get this to play ball.</p>
  
  <p>Basically, i am using angular to bind the results of a SPARQL query on classes and number of classes in a dataset/query 
  using Fuseki Server 1-1.1.2 endpoint (SPARQL 1.1). (See code below after question).</p>
  
  <p>This nicely lists the class name in URI format and a count of it's instances in URI format but I want to only see the characters after the "#" for "class" in the results rather than the whole URI. </p>
  
  <p>I initially tried doing this in the SPARQL query using REPLACE and STRAFTER functions in the query (i.e. SELECT  (strafter(str(?class),"#") AS ?className)) which works fine in Fuseki directly but returns blank results in attempted angular bindings. </p>
  
  <p>From reading other answers, I'm aware of getLocalName() and that not all data will have a local name after the "#" but I need to access the part after the "#" in javascript. So my question is this .... </p>
  
  <p>In order to perform URI/string manipulation on the returned data, I would like to know how to bind individual data items returned to individual scope variables i.e. instead of $scope.results = response.results.bindings 
  Can I do something like $scope.results.class = response.results.bindings.class.value?
  (It didn't work when I tried it nor did passing "results.bindings.class.value" to a string delineating function as I couldn't figure out how to then invoke this in ng-repeat).</p>
  
  <p>So please in summary could you advise me how to bind individual json "values" to named $scope variables?</p>
  
  <p>Any help gratefully received. I have to do it using SPARQL, javascript/HTML/angular.</p>
  
  <p>Here is my code.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html &gt;
  &lt;script src=     "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"&gt;&lt;/script&gt;
  &lt;body&gt;
  
  &lt;div ng-app="myApp" ng-controller="queryCtrl"&gt;&lt;table&gt;
   &lt;tr ng-repeat="x in results"&gt;
      &lt;td&gt;{{x.class.value}}&lt;/td&gt;
      &lt;td&gt;{{x.count.value}}&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;&lt;/div&gt;
  
  &lt;script&gt;
  var app = angular.module('myApp', []);
  app.controller('queryCtrl', function($scope, $http) {
     var query = encodeURIComponent("SELECT  ?class (COUNT(?s) AS ?count ) { ?    s a ?class } GROUP BY ?class ORDER BY ?count");
     var endpoint = "http://localhost:3030/dataset/query";
     $scope.results = [];
     $http.get("http://localhost:3030/dataset/query?    query="+query+"&amp;output=json")
     .success(function (response) {
      $scope.results = response.results.bindings;
      /* for debugging*/
      if ( window.console &amp;&amp; window.console.log ) {
         // console is available, write message if something has happened
         console.log(response.results);
      }
     });
  
  });
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>