diff app/query.service.ts @ 13:98b435bb6c0c

more query work.
author Robert Casties <casties@mpiwg-berlin.mpg.de>
date Thu, 21 Jan 2016 14:47:00 +0100
parents 1843b12eff9a
children 7dc7ea95ca26
line wrap: on
line diff
--- a/app/query.service.ts	Thu Jan 21 11:16:13 2016 +0100
+++ b/app/query.service.ts	Thu Jan 21 14:47:00 2016 +0100
@@ -10,7 +10,10 @@
 @Injectable()
 export class QueryService {
         
-    public neo4jBaseUrl = 'http://localhost:7474/db/data';
+    public neo4jBaseUrl = 'https://ismi-dev.mpiwg-berlin.mpg.de/neo4j-ismi/db/data';
+    //public neo4jBaseUrl = 'http://localhost:7474/db/data';
+    public openMindBaseUrl = 'https://ismi-dev.mpiwg-berlin.mpg.de/om4-ismi/';
+    //public openMindBaseUrl = 'http://localhost:18080/ismi-richfaces/':
     public state: QueryState;
     public ismiObjectTypes: any;
     
@@ -138,6 +141,7 @@
     
     updateQuery() {
         this.createCypherQuery();
+        this.state.resultInfo = 'loading...';
         // run query for result table
         var resQuery = this.state.resultCypherQuery;
         var queryParams = this.state.cypherQueryParams;
@@ -210,4 +214,20 @@
         // return Observable
         return resp;
     }
+    
+    fetchNormalizedString(text: string) {
+        console.debug("fetching normalized string: ", text);
+        var headers = new Headers();
+        headers.append('Accept', 'application/json');
+        // put headers in options
+        var opts = {'headers': headers};
+        // make get request asynchronously
+        var url = this.openMindBaseUrl+'jsonInterface?method=normalize_string&type=arabic_translit&text=';
+        url += text;
+        var resp = this._http.get(url, opts)
+        // filter result as JSON
+        .map(res => res.json());
+        // return Observable
+        return resp;        
+    }
 }
\ No newline at end of file