Removes unimplemented! macro calls for SPARQL results formats

pull/35/head
Tpt 5 years ago
parent 4e3f72769f
commit f4f542ce00
  1. 10
      lib/src/sparql/model.rs
  2. 2
      lib/src/syntax.rs

@ -24,7 +24,10 @@ impl<'a> QueryResult<'a> {
pub fn read(reader: impl BufRead + 'a, syntax: QueryResultSyntax) -> Result<Self> {
match syntax {
QueryResultSyntax::Xml => read_xml_results(reader),
QueryResultSyntax::Json => unimplemented!(),
QueryResultSyntax::Json => Err(Error::msg(
//TODO: implement
"JSON SPARQL results format parsing has not been implemented yet",
)),
}
}
@ -79,7 +82,10 @@ pub enum QueryResultSyntax {
impl FileSyntax for QueryResultSyntax {
fn iri(self) -> &'static str {
unimplemented!()
match self {
QueryResultSyntax::Xml => "http://www.w3.org/ns/formats/SPARQL_Results_XML",
QueryResultSyntax::Json => "http://www.w3.org/ns/formats/SPARQL_Results_JSON",
}
}
fn media_type(self) -> &'static str {

@ -2,7 +2,7 @@
///
/// Is implemented by `GraphSyntax` for graph files and `DatasetSyntax` for dataset files.
pub trait FileSyntax: Sized {
/// Its canonical IRI.
/// Its canonical IRI according to [Unique URIs for file formats registry](https://www.w3.org/ns/formats/).
fn iri(self) -> &'static str;
/// Its [IANA media type](https://tools.ietf.org/html/rfc2046).

Loading…
Cancel
Save