RDF.Graph.new
You're seeing just the function
new
, go back to RDF.Graph module for more information.
Specs
new() :: t()
Creates an empty unnamed RDF.Graph
.
Specs
Creates an RDF.Graph
.
If a keyword list with options is given an empty graph is created. Otherwise an unnamed graph initialized with the given data is created.
See new/2
for available arguments and the different ways to provide data.
Examples
RDF.Graph.new(name: EX.GraphName)
RDF.Graph.new(init: {EX.S, EX.p, EX.O})
RDF.Graph.new({EX.S, EX.p, EX.O})
Specs
Creates an RDF.Graph
initialized with data.
The initial RDF triples can be provided
- as a single statement tuple
- a
RDF.Description
- a
RDF.Graph
- or a list with any combination of the former
Available options:
name
: the name of the graph to be createdprefixes
: some prefix mappings which should be stored alongside the graph and will be used for example when serializing in a format with prefix supportbase_iri
: a base IRI which should be stored alongside the graph and will be used for example when serializing in a format with base IRI supportinit
: some data with which the graph should be initialized; the data can be provided in any form accepted byadd/3
and above that also with a function returning the initialization data in any of these forms
Examples
RDF.Graph.new({EX.S, EX.p, EX.O})
RDF.Graph.new({EX.S, EX.p, EX.O}, name: EX.GraphName)
RDF.Graph.new({EX.S, EX.p, [EX.O1, EX.O2]})
RDF.Graph.new([{EX.S1, EX.p1, EX.O1}, {EX.S2, EX.p2, EX.O2}])
RDF.Graph.new(RDF.Description.new(EX.S, EX.P, EX.O))
RDF.Graph.new([graph, description, triple])
RDF.Graph.new({EX.S, EX.p, EX.O}, name: EX.GraphName, base_iri: EX.base)