/* mod_sparql.h * * Copyright 2006 david reid * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef MOD_SPARQL_H #define MOD_SPARQL_H #include struct store_uri { struct store_uri *next; const unsigned char *uri; }; typedef struct { apr_pool_t *pool; /* pool we use */ int enabled; /* are we enabled? */ int remote; /* remote queries OK? 1 = yes, 0 = no */ int fileUris; /* Do we allow URI's of the file:/// format? */ /* Storage */ char *st_name; /* default location for data - how ? */ char *st_type; /* type of storage to use */ char *st_opts; /* store options string */ struct store_uri *st_uris; /* URI's for the store */ librdf_storage *store; /* RDF storage pointer */ librdf_model *model; /* the model that represents the data */ /* Query Language */ char *ql_name; /* query language name */ librdf_uri *ql_uri; /* query language URI */ /* Outputs */ int resFormat; /* index of outputFormats[] */ librdf_uri *outputUri; /* URI for output format */ } mod_sparql_state_t; #define RESULTS_FORMAT_SIMPLE 0 #define RESULTS_FORMAT_XML_V1 1 #define RESULTS_FORMAT_XML_V2 2 #define RESULTS_FORMAT_XML_V3 3 #define RESULTS_FORMAT_JSON 4 #define SPARQL_HANDLER_NAME "sparql-handler" #define SPARQL_POST_CT "application/x-www-form-urlencoded" #define QUERY "query=" #define DEFAULT_URI "default-graph-uri=" #define SOURCE_URI "named-graph-uri=" #define QUERY_LEN strlen(QUERY) #define DEFAULT_URI_LEN strlen(DEFAULT_URI) #define SOURCE_URI_LEN strlen(SOURCE_URI) #define IS_QUERY(x) strncmp(x, QUERY, QUERY_LEN) == 0 #define IS_DEF_URI(x) strncmp(x, DEFAULT_URI, DEFAULT_URI_LEN) == 0 #define IS_SRC_URI(x) strncmp(x, SOURCE_URI, SOURCE_URI_LEN) == 0 #endif /* MOD_SPARQL_H */