public SimpleRacoonResponse LoadLDLFile(byte[] token, string[] LDLFileContent, string[] AbsolutePosContent, string graph) { Exception error = null; SimpleRacoonResponse res = new SimpleRacoonResponse(); Session currentSession; if (SessionStore.TryGetValidSession(token, out currentSession)) { try { LDLParser theParser = LDLParser.GetParser(); theParser.ParseText(LDLFileContent, AbsolutePosContent); IEnumerable <BOTripple> tripples = theParser.GetAsTripples(); List <InsertableTriple> toInsert = new List <InsertableTriple>(); foreach (BOTripple trip in tripples) { toInsert.Add(new InsertableTriple(trip)); } error = InsertTripple.InsertData(toInsert, graph, currentSession); } catch (Exception ex) { error = ex; } QueryExecution.SuccessResponse(res, error); } else { QueryExecution.SecurityFailureResponse(res); } return(res); }
private void parseFile(string name, string staticDataFile) { try { string[] fileContent = File.ReadAllLines(name); string[] absoluteFileContent = File.ReadAllLines(staticDataFile); LDLParser.GetParser().ParseText(fileContent, absoluteFileContent); int nTripples = LDLParser.GetParser().GetAsTripples().Count; this.txtOutput.Text = string.Format("Completed, {0} triples created", nTripples); } catch (Exception ex) { this.txtOutput.Text += ex.Message + Environment.NewLine; } }