コード例 #1
0
 /// <summary>
 /// Internal constructor which parses the results returned from a given query.
 /// </summary>
 /// <param name="query">The executed query.</param>
 /// <param name="store"></param>
 /// <param name="transaction"></param>
 /// <param name="model"></param>
 internal VirtuosoSparqlQueryResult(IModel model, ISparqlQuery query, VirtuosoStore store, ITransaction transaction = null)
 {
     _store       = store;
     _transaction = transaction;
     _query       = query;
     _model       = model;
 }
コード例 #2
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)
     {
     }
 }
コード例 #3
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)
     {
     }
 }
コード例 #4
0
        public override IStore GetStore(Dictionary <string, string> configurationDictionary)
        {
            string hostKey = "host";
            string host    = "127.0.0.1";

            if (configurationDictionary.ContainsKey(hostKey))
            {
                host = configurationDictionary[hostKey];
            }


            string portKey = "port";
            int    port;

            if (!configurationDictionary.ContainsKey(portKey) || !int.TryParse(configurationDictionary[portKey], out port))
            {
                #if !DEBUG
                port = 1112;
                #else
                port = 1111;
                #endif
            }

            string userKey = "uid";
            string user    = "******";
            if (configurationDictionary.ContainsKey(userKey))
            {
                user = configurationDictionary["uid"];
            }


            string passwordKey = "pw";
            string password    = "******";
            if (configurationDictionary.ContainsKey(passwordKey))
            {
                password = configurationDictionary[passwordKey];
            }

            if (string.IsNullOrEmpty(host) || string.IsNullOrEmpty(user) || string.IsNullOrEmpty(password))
            {
                return(null);
            }

            string inferenceRule = null;
            string ruleKey       = "rule";
            if (configurationDictionary.ContainsKey(ruleKey))
            {
                inferenceRule = configurationDictionary[ruleKey];
            }


            VirtuosoStore store = new VirtuosoStore(host, port, user, password, inferenceRule);
            return(store);
        }
コード例 #5
0
        public void Update(VirtuosoStore store)
        {
            VirtuosoStore virtuosoStore = (store as VirtuosoStore);

            foreach (Ruleset set in Rulesets.RulesetCollection)
            {
                ClearRuleSet(new Uri(set.Uri), virtuosoStore);
                foreach (var item in set.GraphCollection)
                {
                    AddGraphToRuleSet(new Uri(set.Uri), new Uri(item.Uri), virtuosoStore);
                }
            }
        }
コード例 #6
0
 internal VirtuosoTransaction(VirtuosoStore rdfStore)
 {
     //Model = model;
     RdfStore = rdfStore;
 }
コード例 #7
0
        private void AddGraphToRuleSet(Uri ruleSet, Uri graph, VirtuosoStore store)
        {
            string query = string.Format("rdfs_rule_set ('{0}', '{1}')", ruleSet, graph);

            store.ExecuteQuery(query);
        }