Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F2121798
Transform sparql module from fantoir-datasource in standalone crate
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
dereckson
Jan 14 2023, 19:02
2023-01-14 19:02:00 (UTC+0)
Size
813 B
Referenced Files
None
Subscribers
None
Transform sparql module from fantoir-datasource in standalone crate
View Options
impl SparqlResults {
pub fn into_bool (self) -> Option<bool> {
match self {
SparqlResults::Solutions(_) => None,
SparqlResults::Boolean(bool) => Some(bool),
}
}
}
/* -------------------------------------------------------------
Tests
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#[cfg(test)]
mod tests {
use super::*;
#[test]
pub fn test_parse_boolean_results () {
let boolean_results = r#"
<?xml version="1.0"?>
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
<head />
<boolean>true</boolean>
</sparql>
"#;
let results = parse_sparql_results(boolean_results);
let actual = results.into_bool();
assert!(actual.is_some());
assert!(actual.unwrap());
}
}
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1324677
Default Alt Text
Transform sparql module from fantoir-datasource in standalone crate (813 B)
Attached To
Mode
P308 Transform sparql module from fantoir-datasource in standalone crate
Attached
Detach File
Event Timeline
Log In to Comment