From f4f542ce00d7e9183bc94128464862147dd57ba1 Mon Sep 17 00:00:00 2001 From: Tpt Date: Tue, 26 May 2020 14:33:04 +0200 Subject: [PATCH] Removes unimplemented! macro calls for SPARQL results formats --- lib/src/sparql/model.rs | 10 ++++++++-- lib/src/syntax.rs | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/src/sparql/model.rs b/lib/src/sparql/model.rs index c2de1f7a..8b057142 100644 --- a/lib/src/sparql/model.rs +++ b/lib/src/sparql/model.rs @@ -24,7 +24,10 @@ impl<'a> QueryResult<'a> { pub fn read(reader: impl BufRead + 'a, syntax: QueryResultSyntax) -> Result { 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 { diff --git a/lib/src/syntax.rs b/lib/src/syntax.rs index 67c042f8..1e68ab73 100644 --- a/lib/src/syntax.rs +++ b/lib/src/syntax.rs @@ -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).