Пример #1
0
		private static void TestConnectionCreationForTripleStore(LinqTripleStore ts1)
		{
			IRdfContext context = new RdfDataContext(ts1);
			QueryFactory<Track> factory = new QueryFactory<Track>(ts1.QueryMethod, context);
			IRdfQuery<Track> qry1 = context.ForType<Track>();
			IRdfConnection<Track> rdfConnection = factory.CreateConnection(qry1);
			Assert.IsNotNull(rdfConnection);
		}
Пример #2
0
        protected IEnumerator <T> RunQuery()
        {
            if (CachedResults != null && ShouldReuseResultset)
            {
                return(CachedResults.GetEnumerator());
            }
            if (QueryText == null)
            {
                var sb = new StringBuilder();
                CreateSelectQuery(sb);
                QueryText = sb.ToString();
            }
            IRdfConnection <T> conn = QueryFactory.CreateConnection(this);
            IRdfCommand <T>    cmd  = conn.CreateCommand();

            cmd.ElideDuplicates = Expressions.ContainsKey("Distinct") || Expressions.ContainsKey("Reduced");
            cmd.CommandText     = QueryText;
            cmd.InstanceName    = GetInstanceName();
            return(cmd.ExecuteQuery());
        }