Пример #1
0
		public Sparql(string query) {
			queryString = query;
			try {
				this.query = SPARQLParser.parse(new java.io.StringReader(query));
				if (this.query is SelectQuery) {
					SelectQuery sq = (SelectQuery)this.query;
					ReturnLimit = sq.getLimit();
					ReturnStart = sq.getOffset();
				}
			} catch (TokenMgrError e) {
				throw new QueryFormatException("SPARQL syntax error at: " + e.Message);
			} catch (ParseException e) {
				throw new QueryFormatException("SPARQL syntax error: " + e.getMessage());
			}
			
			extFunctions.Add(new TestFunction());
			extFunctions.Add(new LCFunction());
			extFunctions.Add(new UCFunction());
		}
Пример #2
0
        public Sparql(string query)
        {
            queryString = query;
            try {
                this.query = SPARQLParser.parse(new java.io.StringReader(query));
                if (this.query is SelectQuery)
                {
                    SelectQuery sq = (SelectQuery)this.query;
                    ReturnLimit = sq.getLimit();
                    ReturnStart = sq.getOffset();
                }
            } catch (TokenMgrError e) {
                throw new QueryFormatException("SPARQL syntax error at: " + e.Message);
            } catch (ParseException e) {
                throw new QueryFormatException("SPARQL syntax error: " + e.getMessage());
            }

            extFunctions.Add(new TestFunction());
            extFunctions.Add(new LCFunction());
            extFunctions.Add(new UCFunction());
        }