private void ClearRuleSet(Uri ruleSet, VirtuosoStore store) { try { string query = string.Format("delete * from DB.DBA.SYS_RDF_SCHEMA where RS_NAME='{0}';", ruleSet.OriginalString); store.ExecuteQuery(query); }catch (Exception) { } }
private void RemoveGraphFromRuleSet(Uri ruleSet, Uri graph, VirtuosoStore store) { try { string query = string.Format("rdfs_rule_set ('{0}', '{1}', 1)", ruleSet, graph); store.ExecuteQuery(query); } catch (Exception) { } }
/// <summary> /// Connect to the database using the given credentials. /// </summary> /// <returns>True if a connection has been established, False otherwise.</returns> public bool Connect(string host, int port, string user, string password, string defaultInferenceRule) { lock (ThreadDictionary) { var store = new VirtuosoStore(host, port, user, password, defaultInferenceRule); if (!ThreadDictionary.ContainsKey(Thread.CurrentThread)) { ThreadDictionary.Add(Thread.CurrentThread, store); } return(store.IsReady); } }
public void Update(IStore store) { if (store is VirtuosoStore) { VirtuosoStore virtuosoStore = (store as VirtuosoStore); foreach (RuleSet set in Settings.RuleSets) { ClearRuleSet(new Uri(set.Uri), virtuosoStore); foreach (var item in set.Graphs) { AddGraphToRuleSet(new Uri(set.Uri), new Uri(item.Uri), virtuosoStore); } } } }
private void AddGraphToRuleSet(Uri ruleSet, Uri graph, VirtuosoStore store) { string query = string.Format("rdfs_rule_set ('{0}', '{1}')", ruleSet, graph); store.ExecuteQuery(query); }