Change header level of examples

This commit is contained in:
Marcel Otto 2017-06-17 00:27:05 +02:00
parent da24657a07
commit ad1acfffc1
7 changed files with 41 additions and 41 deletions

View file

@ -173,7 +173,7 @@ defmodule RDF.Dataset do
@doc """
Adds statements to a `RDF.Dataset` and overwrites all existing statements with the same subjects and predicates in the specified graph context.
# Examples
## Examples
iex> dataset = RDF.Dataset.new({EX.S, EX.P1, EX.O1})
...> RDF.Dataset.put(dataset, {EX.S, EX.P1, EX.O2})
@ -393,7 +393,7 @@ defmodule RDF.Dataset do
When a graph with the given name can not be found can not be found `:error` is returned.
# Examples
## Examples
iex> dataset = RDF.Dataset.new([{EX.S1, EX.P1, EX.O1, EX.Graph}, {EX.S2, EX.P2, EX.O2}])
...> RDF.Dataset.fetch(dataset, EX.Graph)
@ -413,7 +413,7 @@ defmodule RDF.Dataset do
When a graph with the given name can not be found can not be found the optionally
given default value or `nil` is returned
# Examples
## Examples
iex> dataset = RDF.Dataset.new([{EX.S1, EX.P1, EX.O1, EX.Graph}, {EX.S2, EX.P2, EX.O2}])
...> RDF.Dataset.get(dataset, EX.Graph)
@ -465,7 +465,7 @@ defmodule RDF.Dataset do
If the passed function returns `:pop` the graph with the given name is
removed and a `{removed_graph, new_dataset}` tuple gets returned.
# Examples
## Examples
iex> dataset = RDF.Dataset.new({EX.S, EX.P, EX.O, EX.Graph})
...> RDF.Dataset.get_and_update(dataset, EX.Graph, fn current_graph ->
@ -512,7 +512,7 @@ defmodule RDF.Dataset do
When a graph with given name can not be found the optionally given default value
or `nil` is returned.
# Examples
## Examples
iex> dataset = RDF.Dataset.new([
...> {EX.S1, EX.P1, EX.O1, EX.Graph},
@ -536,7 +536,7 @@ defmodule RDF.Dataset do
@doc """
The number of statements within a `RDF.Dataset`.
# Examples
## Examples
iex> RDF.Dataset.new([
...> {EX.S1, EX.p1, EX.O1, EX.Graph},
@ -554,7 +554,7 @@ defmodule RDF.Dataset do
@doc """
The set of all subjects used in the statement within all graphs of a `RDF.Dataset`.
# Examples
## Examples
iex> RDF.Dataset.new([
...> {EX.S1, EX.p1, EX.O1, EX.Graph},
@ -572,7 +572,7 @@ defmodule RDF.Dataset do
@doc """
The set of all properties used in the predicates within all graphs of a `RDF.Dataset`.
# Examples
## Examples
iex> RDF.Dataset.new([
...> {EX.S1, EX.p1, EX.O1, EX.Graph},
@ -592,7 +592,7 @@ defmodule RDF.Dataset do
Note: This function does collect only URIs and BlankNodes, not Literals.
# Examples
## Examples
iex> RDF.Dataset.new([
...> {EX.S1, EX.p1, EX.O1, EX.Graph},
@ -612,7 +612,7 @@ defmodule RDF.Dataset do
@doc """
The set of all resources used within a `RDF.Dataset`.
# Examples
## Examples
iex> RDF.Dataset.new([
...> {EX.S1, EX.p1, EX.O1, EX.Graph},
@ -632,7 +632,7 @@ defmodule RDF.Dataset do
@doc """
All statements within all graphs of a `RDF.Dataset`.
# Examples
## Examples
iex> RDF.Dataset.new([
...> {EX.S1, EX.p1, EX.O1, EX.Graph},
@ -658,7 +658,7 @@ defmodule RDF.Dataset do
@doc """
Returns if a given statement is in a `RDF.Dataset`.
# Examples
## Examples
iex> dataset = RDF.Dataset.new([
...> {EX.S1, EX.p1, EX.O1, EX.Graph},

View file

@ -59,7 +59,7 @@ defmodule RDF.Description do
@doc """
Add objects to a predicate of a `RDF.Description`.
### Examples
## Examples
iex> RDF.Description.add(RDF.Description.new({EX.S, EX.P1, EX.O1}), EX.P2, EX.O2)
RDF.Description.new([{EX.S, EX.P1, EX.O1}, {EX.S, EX.P2, EX.O2}])
@ -131,7 +131,7 @@ defmodule RDF.Description do
@doc """
Puts objects to a predicate of a `RDF.Description`, overwriting all existing objects.
### Examples
## Examples
iex> RDF.Description.put(RDF.Description.new({EX.S, EX.P, EX.O1}), EX.P, EX.O2)
RDF.Description.new([{EX.S, EX.P, EX.O2}])
@ -155,7 +155,7 @@ defmodule RDF.Description do
@doc """
Adds statements to a `RDF.Description` and overwrites all existing statements with already used predicates.
### Examples
## Examples
iex> RDF.Description.put(RDF.Description.new({EX.S, EX.P, EX.O1}), {EX.P, EX.O2})
RDF.Description.new([{EX.S, EX.P, EX.O2}])
@ -310,7 +310,7 @@ defmodule RDF.Description do
When the predicate can not be found `:error` is returned.
### Examples
## Examples
iex> RDF.Description.fetch(RDF.Description.new({EX.S, EX.p, EX.O}), EX.p)
{:ok, [RDF.uri(EX.O)]}
@ -331,7 +331,7 @@ defmodule RDF.Description do
When the predicate can not be found the optionally given default value or `nil` is returned.
### Examples
## Examples
iex> RDF.Description.get(RDF.Description.new({EX.S, EX.P, EX.O}), EX.P)
[RDF.uri(EX.O)]
@ -361,7 +361,7 @@ defmodule RDF.Description do
If the passed function returns `:pop` the objects for the given predicate are
removed and a `{removed_objects, new_description}` tuple gets returned.
### Examples
## Examples
iex> RDF.Description.new({EX.S, EX.P, EX.O}) |>
...> RDF.Description.get_and_update(EX.P, fn current_objects ->
@ -409,7 +409,7 @@ defmodule RDF.Description do
When the predicate can not be found the optionally given default value or `nil` is returned.
### Examples
## Examples
iex> RDF.Description.pop(RDF.Description.new({EX.S, EX.P, EX.O}), EX.P)
{[RDF.uri(EX.O)], RDF.Description.new(EX.S)}
@ -429,7 +429,7 @@ defmodule RDF.Description do
@doc """
The set of all properties used in the predicates within a `RDF.Description`.
### Examples
## Examples
iex> RDF.Description.new([
...> {EX.S1, EX.p1, EX.O1},
@ -446,7 +446,7 @@ defmodule RDF.Description do
Note: This function does collect only URIs and BlankNodes, not Literals.
### Examples
## Examples
iex> RDF.Description.new([
...> {EX.S1, EX.p1, EX.O1},
@ -470,7 +470,7 @@ defmodule RDF.Description do
@doc """
The set of all resources used within a `RDF.Description`.
### Examples
## Examples
iex> RDF.Description.new([
...> {EX.S1, EX.p1, EX.O1},

View file

@ -152,7 +152,7 @@ defmodule RDF.Graph do
@doc """
Adds statements to a `RDF.Graph` and overwrites all existing statements with the same subjects and predicates.
# Examples
## Examples
iex> RDF.Graph.new([{EX.S1, EX.P1, EX.O1}, {EX.S2, EX.P2, EX.O2}]) |>
...> RDF.Graph.put([{EX.S1, EX.P2, EX.O3}, {EX.S2, EX.P2, EX.O3}])
@ -221,7 +221,7 @@ defmodule RDF.Graph do
@doc """
Add statements to a `RDF.Graph`, overwriting all statements with the same subject and predicate.
# Examples
## Examples
iex> RDF.Graph.new(EX.S, EX.P, EX.O1) |> RDF.Graph.put(EX.S, EX.P, EX.O2)
RDF.Graph.new(EX.S, EX.P, EX.O2)
@ -311,7 +311,7 @@ defmodule RDF.Graph do
When the subject can not be found `:error` is returned.
# Examples
## Examples
iex> RDF.Graph.new([{EX.S1, EX.P1, EX.O1}, {EX.S2, EX.P2, EX.O2}]) |>
...> RDF.Graph.fetch(EX.S1)
@ -328,7 +328,7 @@ defmodule RDF.Graph do
When the subject can not be found the optionally given default value or `nil` is returned.
# Examples
## Examples
iex> RDF.Graph.new([{EX.S1, EX.P1, EX.O1}, {EX.S2, EX.P2, EX.O2}]) |>
...> RDF.Graph.get(EX.S1)
@ -366,7 +366,7 @@ defmodule RDF.Graph do
If the passed function returns `:pop` the description for the given subject is
removed and a `{removed_description, new_graph}` tuple gets returned.
# Examples
## Examples
iex> RDF.Graph.new({EX.S, EX.P, EX.O}) |>
...> RDF.Graph.get_and_update(EX.S, fn current_description ->
@ -412,7 +412,7 @@ defmodule RDF.Graph do
When the subject can not be found the optionally given default value or `nil` is returned.
# Examples
## Examples
iex> RDF.Graph.new([{EX.S1, EX.P1, EX.O1}, {EX.S2, EX.P2, EX.O2}]) |>
...> RDF.Graph.pop(EX.S1)
@ -433,7 +433,7 @@ defmodule RDF.Graph do
@doc """
The number of subjects within a `RDF.Graph`.
# Examples
## Examples
iex> RDF.Graph.new([
...> {EX.S1, EX.p1, EX.O1},
@ -448,7 +448,7 @@ defmodule RDF.Graph do
@doc """
The number of statements within a `RDF.Graph`.
# Examples
## Examples
iex> RDF.Graph.new([
...> {EX.S1, EX.p1, EX.O1},
@ -466,7 +466,7 @@ defmodule RDF.Graph do
@doc """
The set of all subjects used in the statements within a `RDF.Graph`.
# Examples
## Examples
iex> RDF.Graph.new([
...> {EX.S1, EX.p1, EX.O1},
@ -481,7 +481,7 @@ defmodule RDF.Graph do
@doc """
The set of all properties used in the predicates of the statements within a `RDF.Graph`.
# Examples
## Examples
iex> RDF.Graph.new([
...> {EX.S1, EX.p1, EX.O1},
@ -503,7 +503,7 @@ defmodule RDF.Graph do
Note: This function does collect only URIs and BlankNodes, not Literals.
# Examples
## Examples
iex> RDF.Graph.new([
...> {EX.S1, EX.p1, EX.O1},
@ -525,7 +525,7 @@ defmodule RDF.Graph do
@doc """
The set of all resources used within a `RDF.Graph`.
# Examples
## Examples
iex> RDF.Graph.new([
...> {EX.S1, EX.p1, EX.O1},
@ -547,7 +547,7 @@ defmodule RDF.Graph do
@doc """
The list of all statements within a `RDF.Graph`.
# Examples
## Examples
iex> RDF.Graph.new([
...> {EX.S1, EX.p1, EX.O1},

View file

@ -34,7 +34,7 @@ defmodule RDF.Literal do
| `NaiveDateTime` | `xsd:dateTime` |
# Examples
## Examples
iex> RDF.Literal.new(42)
%RDF.Literal{value: 42, datatype: XSD.integer}

View file

@ -15,7 +15,7 @@ defmodule RDF.Quad do
Note: The `RDF.quad` function is a shortcut to this function.
# Examples
## Examples
iex> RDF.Quad.new("http://example.com/S", "http://example.com/p", 42, "http://example.com/Graph")
{~I<http://example.com/S>, ~I<http://example.com/p>, RDF.literal(42), ~I<http://example.com/Graph>}
@ -36,7 +36,7 @@ defmodule RDF.Quad do
Note: The `RDF.quad` function is a shortcut to this function.
# Examples
## Examples
iex> RDF.Quad.new {"http://example.com/S", "http://example.com/p", 42, "http://example.com/Graph"}
{~I<http://example.com/S>, ~I<http://example.com/p>, RDF.literal(42), ~I<http://example.com/Graph>}

View file

@ -23,7 +23,7 @@ defmodule RDF.Statement do
An error is raised when the given elements are not convertible to RDF values.
# Examples
## Examples
iex> RDF.Statement.new {"http://example.com/S", "http://example.com/p", 42}
{~I<http://example.com/S>, ~I<http://example.com/p>, RDF.literal(42)}

View file

@ -15,7 +15,7 @@ defmodule RDF.Triple do
Note: The `RDF.triple` function is a shortcut to this function.
# Examples
## Examples
iex> RDF.Triple.new("http://example.com/S", "http://example.com/p", 42)
{~I<http://example.com/S>, ~I<http://example.com/p>, RDF.literal(42)}
@ -35,7 +35,7 @@ defmodule RDF.Triple do
Note: The `RDF.triple` function is a shortcut to this function.
# Examples
## Examples
iex> RDF.Triple.new {"http://example.com/S", "http://example.com/p", 42}
{~I<http://example.com/S>, ~I<http://example.com/p>, RDF.literal(42)}