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).