|
|
@ -12,15 +12,18 @@ mod grammar { |
|
|
|
)] |
|
|
|
)] |
|
|
|
|
|
|
|
|
|
|
|
use model::*; |
|
|
|
use model::*; |
|
|
|
|
|
|
|
use rio::utils::unescape_characters; |
|
|
|
use rio::utils::unescape_unicode_codepoints; |
|
|
|
use rio::utils::unescape_unicode_codepoints; |
|
|
|
use sparql::algebra::*; |
|
|
|
use sparql::algebra::*; |
|
|
|
use sparql::model::*; |
|
|
|
use sparql::model::*; |
|
|
|
|
|
|
|
use std::borrow::Cow; |
|
|
|
use std::collections::BTreeMap; |
|
|
|
use std::collections::BTreeMap; |
|
|
|
use std::collections::HashMap; |
|
|
|
use std::collections::HashMap; |
|
|
|
use std::io::BufReader; |
|
|
|
use std::io::BufReader; |
|
|
|
use std::io::Read; |
|
|
|
use std::io::Read; |
|
|
|
use url::ParseOptions; |
|
|
|
use url::ParseOptions; |
|
|
|
use url::Url; |
|
|
|
use url::Url; |
|
|
|
|
|
|
|
use utils::StaticSliceMap; |
|
|
|
|
|
|
|
|
|
|
|
struct FocusedTriplePattern<F> { |
|
|
|
struct FocusedTriplePattern<F> { |
|
|
|
focus: F, |
|
|
|
focus: F, |
|
|
@ -286,6 +289,21 @@ mod grammar { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const UNESCAPE_CHARACTERS: [u8; 8] = [b't', b'b', b'n', b'r', b'f', b'"', b'\'', b'\\']; |
|
|
|
|
|
|
|
lazy_static! { |
|
|
|
|
|
|
|
static ref UNESCAPE_REPLACEMENT: StaticSliceMap<char, char> = StaticSliceMap::new( |
|
|
|
|
|
|
|
&['t', 'b', 'n', 'r', 'f', '"', '\'', '\\'], |
|
|
|
|
|
|
|
&[ |
|
|
|
|
|
|
|
'\u{0009}', '\u{0008}', '\u{000A}', '\u{000D}', '\u{000C}', '\u{0022}', '\u{0027}', |
|
|
|
|
|
|
|
'\u{005C}' |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn unescape_echars(input: &str) -> Cow<str> { |
|
|
|
|
|
|
|
unescape_characters(input, &UNESCAPE_CHARACTERS, &UNESCAPE_REPLACEMENT) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
include!(concat!(env!("OUT_DIR"), "/sparql_grammar.rs")); |
|
|
|
include!(concat!(env!("OUT_DIR"), "/sparql_grammar.rs")); |
|
|
|
|
|
|
|
|
|
|
|
pub fn read_sparql_query<'a, R: Read + 'a>( |
|
|
|
pub fn read_sparql_query<'a, R: Read + 'a>( |
|
|
|