From a7423f0963c8443dfe8a4e79cab752ed34ec280c Mon Sep 17 00:00:00 2001 From: Marcel Otto Date: Sat, 7 Dec 2024 20:58:13 +0100 Subject: [PATCH] Move RDF.JSON.new/1 examples --- lib/rdf/model/literal/datatypes/json.ex | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/rdf/model/literal/datatypes/json.ex b/lib/rdf/model/literal/datatypes/json.ex index 8c1678d..b3380d5 100644 --- a/lib/rdf/model/literal/datatypes/json.ex +++ b/lib/rdf/model/literal/datatypes/json.ex @@ -5,16 +5,6 @@ defmodule RDF.JSON do As specified in RDF 1.2, this datatype allows JSON content as literal values. The lexical forms must conform to [RFC 7493 (I-JSON)](https://www.rfc-editor.org/rfc/rfc7493). - ## Examples - - iex> RDF.JSON.new(%{foo: 42}) - - iex> RDF.JSON.new(~s({"foo": 42})) - - iex> RDF.JSON.new("not JSON") |> RDF.JSON.valid?() - false - - See: """ @@ -53,6 +43,13 @@ defmodule RDF.JSON do ## Examples + iex> RDF.JSON.new(%{foo: 42}) + + iex> RDF.JSON.new(~s({"foo": 42})) + + iex> RDF.JSON.new("not JSON") |> RDF.JSON.valid?() + false + iex> RDF.JSON.new("null") |> RDF.JSON.value() nil