test_match v0.1.0 TestMatch.Graph
Module providing a struct for graphs.
The %TestMatch.Graph{} struct is used to keep some related data fields
together. One of the fields :type tracks whether this is a property
graph (:lpg) or a semantic graph (:rdf).
The other fields are straightforward data access fields:
:data–graph_data:file– name ofgraph_file(within thegraphs_dir):path– absolute path ofgraph_file:uri– absolute URI ofgraph_file
Examples
iex> data |> TestMatch.Graph.new("temp.ttl", :rdf)
%TestMatch.Graph{
data: "<GRAPH_DATA>"
file: "temp.ttl",
path: ".../test_match/priv/rdf/graphs/temp.ttl",
type: :rdf,
uri: "file:///.../test_match/priv/rdf/graphs/temp.ttl"
}
Link to this section Summary
Functions
Creates a %TestMatch.Graph{} struct.
Link to this section Functions
Link to this function
new(graph_data, graph_file, graph_type)
Creates a %TestMatch.Graph{} struct.
Examples
iex> data |> TestMatch.Graph.new("books.ttl", :rdf)
%TestMatch.Graph{
data: "@prefix bibo: <http://purl.org/ontology/bibo/> \n..."
file: "books.ttl",
path: ".../test_match/priv/rdf/graphs/books.ttl",
type: :rdf,
uri: "file:///.../test_match/priv/rdf/graphs/books.ttl"
}