test_graph v0.1.0 TestGraph.Query

Module providing a struct for queries.

The %TestGraph.Query{} struct is used to keep some related data fields together. One of the fields :type tracks whether this is a property graph query (:lpg) or a semantic graph query (:rdf). The other fields are straightforward data access fields:

  • :dataquery_data
  • :file – name of query_file (within the queries_dir)
  • :path – absolute path of query_file
  • :uri – absolute URI of query_file

Examples

iex> data |> TestGraph.Query.new("temp.rq", :rdf)
%TestGraph.Query{
  data: "<QUERY_DATA>"
  file: "temp.rq",
  path:  ".../test_graph/priv/rdf/queries/temp.rq",
  type: :rdf,
  uri: "file:///.../test_graph/priv/rdf/queries/temp.rq"
}

Link to this section Summary

Functions

Creates a %TestGraph.Query{} struct

Link to this section Functions

Link to this function

new(query_data, query_file, query_type)

Creates a %TestGraph.Query{} struct.

Examples

iex> data |> TestGraph.Query.new("books.rq", :rdf)
%TestGraph.Query{
  data: "@prefix bibo: <http://purl.org/ontology/bibo/> \n..."
  file: "books.rq",
  path:  ".../test_graph/priv/rdf/queries/books.rq",
  type: :rdf,
  uri: "file:///.../test_graph/priv/rdf/queries/books.rq"
}