Skip to content

Commit

Permalink
Move RDF.JSON.new/1 examples
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelotto committed Dec 7, 2024
1 parent 6d097cc commit a7423f0
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions lib/rdf/model/literal/datatypes/json.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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: <https://www.w3.org/TR/rdf12-concepts/#section-json>
"""

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a7423f0

Please sign in to comment.