Пример #1
0
 public void SparqlOperatorRegistration1()
 {
     try
     {
         MockSparqlOperator op = new MockSparqlOperator();
         SparqlOperators.AddOperator(op);
         Assert.IsTrue(SparqlOperators.IsRegistered(op));
         SparqlOperators.RemoveOperator(op);
         Assert.IsFalse(SparqlOperators.IsRegistered(op));
     }
     finally
     {
         SparqlOperators.Reset();
     }
 }
Пример #2
0
        public void ConfigurationAutoOperators1()
        {
            try
            {
                String data = @"@prefix dnr: <http://www.dotnetrdf.org/configuration#> .
_:a a dnr:SparqlOperator ;
dnr:type """ + typeof(MockSparqlOperator).AssemblyQualifiedName + @""" .";

                Graph g = new Graph();
                g.LoadFromString(data);

                ConfigurationLoader.AutoConfigureSparqlOperators(g);

                ISparqlOperator op;
                SparqlOperators.TryGetOperator(SparqlOperatorType.Add, out op, null);

                Assert.AreEqual(typeof(MockSparqlOperator), op.GetType());
                SparqlOperators.RemoveOperator(op);
            }
            finally
            {
                SparqlOperators.Reset();
            }
        }