From 60281a037993e31428772f8b687636436137484c Mon Sep 17 00:00:00 2001 From: Marcel Otto Date: Tue, 11 Sep 2018 03:16:10 +0200 Subject: [PATCH] Add is_xsd_date/1 and is_xsd_time/1 guards --- lib/rdf/literal_guards.ex | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/rdf/literal_guards.ex b/lib/rdf/literal_guards.ex index 6235201..253a31b 100644 --- a/lib/rdf/literal_guards.ex +++ b/lib/rdf/literal_guards.ex @@ -27,8 +27,10 @@ defmodule RDF.Literal.Guards do @xsd_string XSD.string() @xsd_boolean XSD.boolean() @xsd_dateTime XSD.dateTime() + @xsd_date XSD.date() + @xsd_time XSD.time() @xsd_any_uri XSD.anyURI() - @rdf_lang_string RDF.langString + @rdf_lang_string RDF.langString() @doc """ Returns `true` if the given datatype is `xsd:integer`; otherwise returns `false`. @@ -64,6 +66,16 @@ defmodule RDF.Literal.Guards do """ defguard is_xsd_datetime(datatype) when datatype == @xsd_dateTime + @doc """ + Returns `true` if the given datatype is `xsd:date`; otherwise returns `false`. + """ + defguard is_xsd_date(datatype) when datatype == @xsd_date + + @doc """ + Returns `true` if the given datatype is `xsd:time`; otherwise returns `false`. + """ + defguard is_xsd_time(datatype) when datatype == @xsd_time + @doc """ Returns `true` if the given datatype is `xsd:anyURI`; otherwise returns `false`. """