Пример #1
0
        public void ParsingObjectsUpdateTypeCheck()
        {
            Type target            = typeof(SparqlUpdateParser);
            MimeTypeDefinition def = MimeTypesHelper.Definitions.FirstOrDefault(d => d.CanParseObject <SparqlUpdateCommandSet>());

            Assert.AreNotEqual(null, def, "Should get a valid definition");
            Assert.AreEqual(target, def.GetObjectParserType <SparqlUpdateCommandSet>());
        }
Пример #2
0
        public void ParsingObjectsUpdateTypeCheck()
        {
            Type target            = typeof(SparqlUpdateParser);
            MimeTypeDefinition def = MimeTypesHelper.Definitions.FirstOrDefault(d => d.CanParseObject <SparqlUpdateCommandSet>());

            Assert.NotNull(def);
            Assert.Equal(target, def.GetObjectParserType <SparqlUpdateCommandSet>());
        }
Пример #3
0
        public void ParsingObjectsUpdateParserCheck()
        {
            Type target            = typeof(SparqlUpdateParser);
            MimeTypeDefinition def = MimeTypesHelper.Definitions.FirstOrDefault(d => d.CanParseObject <SparqlUpdateCommandSet>());

            Assert.AreNotEqual(null, def, "Should get a valid definition");
            Assert.AreEqual(target, def.GetObjectParserType <SparqlUpdateCommandSet>());

            IObjectParser <SparqlUpdateCommandSet> parser = def.GetObjectParser <SparqlUpdateCommandSet>();
            SparqlUpdateCommandSet cmds = parser.ParseFromString("CLEAR DEFAULT");

            Console.WriteLine(cmds.ToString());
        }
Пример #4
0
        public void ParsingObjectsQueryParserCheck()
        {
            Type target            = typeof(SparqlQueryParser);
            MimeTypeDefinition def = MimeTypesHelper.Definitions.FirstOrDefault(d => d.CanParseObject <SparqlQuery>());

            Assert.AreNotEqual(null, def, "Should get a valid definition");
            Assert.AreEqual(target, def.GetObjectParserType <SparqlQuery>());

            IObjectParser <SparqlQuery> parser = def.GetObjectParser <SparqlQuery>();
            SparqlQuery q = parser.ParseFromString("SELECT * WHERE { ?s ?p ?o }");

            Console.WriteLine(q.ToString());
        }