test_match v0.1.0 TestMatch.Query
Module providing a struct for queries.
The %TestMatch.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:
:data–query_data:file– name ofquery_file(within thequeries_dir):path– absolute path ofquery_file:uri– absolute URI ofquery_file
Examples
iex> data |> TestMatch.Query.new("temp.rq", :rdf)
%TestMatch.Query{
data: "<QUERY_DATA>"
file: "temp.rq",
path: ".../test_match/priv/rdf/queries/temp.rq",
type: :rdf,
uri: "file:///.../test_match/priv/rdf/queries/temp.rq"
}
Link to this section Summary
Functions
Creates a %TestMatch.Query{} struct.
Link to this section Functions
Link to this function
new(query_data, query_file, query_type)
Creates a %TestMatch.Query{} struct.
Examples
iex> data |> TestMatch.Query.new("books.rq", :rdf)
%TestMatch.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"
}