Ejemplo n.º 1
0
 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)
     {
     }
 }
Ejemplo n.º 2
0
 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)
     {
     }
 }
Ejemplo n.º 3
0
        /// <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);
            }
        }
Ejemplo n.º 4
0
        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);
                    }
                }
            }
        }
Ejemplo n.º 5
0
        private void AddGraphToRuleSet(Uri ruleSet, Uri graph, VirtuosoStore store)
        {
            string query = string.Format("rdfs_rule_set ('{0}', '{1}')", ruleSet, graph);

            store.ExecuteQuery(query);
        }