コード例 #1
0
        public void TestCount()
        {
            ResourceQuery        query  = new ResourceQuery(nco.PersonContact);
            IResourceQueryResult result = Model.ExecuteQuery(query);

            Assert.AreEqual(40, result.Count());

            query  = new ResourceQuery(_resource);
            result = Model.ExecuteQuery(query);

            Assert.AreEqual(1, result.Count());
        }
コード例 #2
0
        private string GetOntologyTitle(IModel model)
        {
            try
            {
                ResourceQuery query = new ResourceQuery();
                query.Where(rdf.type, owl.Ontology);

                IResourceQueryResult result = model.ExecuteQuery(query);

                if (result.Count() == 0)
                {
                    return("");
                }

                IResource ontology = result.GetResources().First();

                return(ontology.ListValues(dces.Title).OfType <string>().FirstOrDefault());
            }
            catch
            {
                string msg = "Could not retrieve title of ontology <{0}>";
                Logger.LogWarning(string.Format(msg, model.Uri.ToString()));

                return("");
            }
        }
コード例 #3
0
        public void TestContains()
        {
            ResourceQuery a = new ResourceQuery(nco.PersonContact);

            a.Where(nco.fullname).Contains("0");

            IResourceQueryResult result = Model.ExecuteQuery(a);

            Assert.Greater(result.Count(), 0);
        }
コード例 #4
0
 public int Count()
 {
     return(_queryResult.Count());
 }