test_match v0.1.0 TestMatch

Top-level module used in "" post.

This module is now standalone and finds the NeoSemantics modules from the github neo_semantics project.

See the examples directory for some example scripts.

Link to this section Summary

Functions

Delegates to TestMatch.LPG.Cypher.Client.rquery/0

Delegates to TestMatch.LPG.Cypher.Client.rquery/1

Delegates to TestMatch.LPG.Cypher.Client.rquery/0

Delegates to TestMatch.LPG.Cypher.Client.rquery/1

Delegates to TestMatch.LPG.Cypher.Client.clear/0

Delegates to TestMatch.LPG.Cypher.Client.dump/1

Delegates to TestMatch.LPG.Cypher.Client.dump/2

Delegates to TestMatch.LPG.Cypher.Client.init/0

Delegates to TestMatch.LPG.Cypher.Client.reset/0

Delegates to TestMatch.LPG.Cypher.Client.test/0

Delegates to TestMatch.RDF.SPARQL.Client.dbpedia_sparql_endpoint/0

Exports from Neo4j an LPG graph transformed into an RDF graph. The graph is centered on a node identified by node_id.

Exports from Neo4j an LPG graph transformed into an RDF graph. The graph is defined by the cypher query.

Exports from Neo4j an LPG graph transformed into an RDF graph. The graph is defined by the cypher query.

Exports from Neo4j an LPG graph transformed into an RDF graph. The graph is centered on a node identified by node_uri.

Imports into Neo4j an LPG graph transformed from an RDF graph.

Imports into Neo4j an LPG graph transformed from an RDF graph which was queried from a remote datastore using a SPARQL endpoint.

Delegates to TestMatch.Lib.from_cypher/0

Delegates to TestMatch.Lib.from_cypher/1

Delegates to TestMatch.Lib.from_cypher_with_properties/0

Delegates to TestMatch.Lib.from_cypher_with_properties/1

Delegates to TestMatch.Lib.from_sparql/0

Delegates to TestMatch.Lib.from_sparql/1

Delegates to TestMatch.Lib.list_graph_images/0

Delegates to TestMatch.Lib.list_graphs/0

Delegates to TestMatch.Lib.list_graph_images/0

Delegates to TestMatch.Lib.list_graphs/0

Delegates to TestMatch.LPG.list_graphs/0

Delegates to TestMatch.LPG.list_queries/0

Delegates to TestMatch.RDF.list_graphs/0

Delegates to TestMatch.RDF.list_queries/0

Delegates to TestMatch.RDF.SPARQL.Client.sparql_services/0

Delegates to TestMatch.RDF.SPARQL.Client.local_sparql_endpoint/0

Delegates to TestMatch.LPG.books/0

Delegates to TestMatch.LPG.movies/0

Delegates to TestMatch.RDF.books/0

Delegates to TestMatch.Lib.read_graph/0

Delegates to TestMatch.Lib.read_graph/1

Delegates to TestMatch.LPG.read_graph/0

Delegates to TestMatch.LPG.read_graph/1

Delegates to TestMatch.LPG.read_query/0

Delegates to TestMatch.LPG.read_query/1

Delegates to TestMatch.RDF.read_graph/0

Delegates to TestMatch.RDF.read_graph/1

Delegates to TestMatch.RDF.read_query/0

Delegates to TestMatch.RDF.read_query/1

Delegates to TestMatch.RDF.SPARQL.Client.rquery/0

Delegates to TestMatch.RDF.SPARQL.Client.rquery/1

Delegates to TestMatch.RDF.SPARQL.Client.rquery/2

Delegates to TestMatch.RDF.SPARQL.Client.rquery/0

Delegates to TestMatch.RDF.SPARQL.Client.rquery/1

Delegates to TestMatch.RDF.SPARQL.Client.rquery/2

Delegates to TestMatch.RDF.SPARQL.Client.sparql_endpoint/0

Delegates to TestMatch.RDF.SPARQL.Client.sparql_endpoint/1

Delegates to TestMatch.RDF.SPARQL.Client.sparql_query/0

Delegates to TestMatch.RDF.SPARQL.Client.sparql_query/1

Delegates to TestMatch.RDF.SPARQL.Client.wikidata_sparql_endpoint/0

Delegates to TestMatch.Lib.write_graph/1

Delegates to TestMatch.Lib.write_graph/2

Delegates to TestMatch.Lib.write_lib_graph/1

Delegates to TestMatch.Lib.write_lib_graph/2

Delegates to TestMatch.LPG.write_graph/1

Delegates to TestMatch.LPG.write_graph/2

Delegates to TestMatch.LPG.write_query/1

Delegates to TestMatch.LPG.write_query/2

Delegates to TestMatch.RDF.write_graph/1

Delegates to TestMatch.RDF.write_graph/2

Delegates to TestMatch.RDF.write_query/1

Delegates to TestMatch.RDF.write_query/2

Delegates to TestMatch.Lib.to_png/1

Delegates to TestMatch.Lib.to_png/2

Link to this section Functions

Delegates to TestMatch.LPG.Cypher.Client.rquery/0

Delegates to TestMatch.LPG.Cypher.Client.rquery/1

Delegates to TestMatch.LPG.Cypher.Client.rquery/0

Delegates to TestMatch.LPG.Cypher.Client.rquery/1

Delegates to TestMatch.LPG.Cypher.Client.clear/0

Link to this function

cypher_dump(arg)

Delegates to TestMatch.LPG.Cypher.Client.dump/1

Link to this function

cypher_dump(arg1, arg2)

Delegates to TestMatch.LPG.Cypher.Client.dump/2

Delegates to TestMatch.LPG.Cypher.Client.init/0

Delegates to TestMatch.LPG.Cypher.Client.reset/0

Delegates to TestMatch.LPG.Cypher.Client.test/0

Link to this function

dbpedia_sparql_endpoint()

Delegates to TestMatch.RDF.SPARQL.Client.dbpedia_sparql_endpoint/0

Link to this function

export_rdf_by_id(node_id, exclude_context \\ false)

Exports from Neo4j an LPG graph transformed into an RDF graph. The graph is centered on a node identified by node_id.

This returns the full context unless an optional boolean arg exclude_context is passed as true which will exclude context if present.

Examples

iex> TestMatch.export_rdf_by_id(1783)
%TestMatch.Graph{
  data: "@prefix neovoc: <neo4j://defaultvocabulary#> .\n@prefix neoind: <neo4j://indiv#> .\n\n\nneoind:1783 a neovoc:Resource;\n  neovoc:ns0__creator neoind:1785;\n  neovoc:ns0__homepage neoind:1784;\n  neovoc:ns0__license neoind:1786;\n  neovoc:ns0__name "Elixir";\n  neovoc:uri "http://example.org/Elixir" .\n",
  file: "1783.ttl",
  path: "/Users/tony/Projects/github/tonyhammond/ex_mples/test_match/_build/dev/lib/test_graph/priv/rdf/graphs/1783.ttl",
  type: :rdf,
  uri: "file:///Users/tony/Projects/github/tonyhammond/ex_mples/test_match/_build/dev/lib/test_graph/priv/rdf/graphs/1783.ttl"
}

iex> TestMatch.export_rdf_by_id(1783).data
"@prefix neovoc: <neo4j://defaultvocabulary#> .\n@prefix neoind: <neo4j://indiv#> .\n\n\nneoind:1783 a neovoc:Resource;\n  neovoc:ns0__creator neoind:1785;\n  neovoc:ns0__homepage neoind:1784;\n  neovoc:ns0__license neoind:1786;\n  neovoc:ns0__name "Elixir";\n  neovoc:uri "http://example.org/Elixir" .\n"
Link to this function

export_rdf_by_query(cypher, graph_file)

Exports from Neo4j an LPG graph transformed into an RDF graph. The graph is defined by the cypher query.

Examples

iex> cypher = TestMatch.LPG.read_query("node1.cypher").data
"match (n) return n limit 1\n"
iex> cypher |> TestMatch.export_rdf_by_query
"..."
Link to this function

export_rdf_by_query_on_rdf(cypher, graph_file)

Exports from Neo4j an LPG graph transformed into an RDF graph. The graph is defined by the cypher query.

Examples

iex> cypher = TestMatch.LPG.read_query("temp.cypher").data
"match (n:Resource {uri:'http://dataset/indiv#153'}) return n\n"
iex> cypher |> TestMatch.export_rdf_by_query_on_rdf
"..."
Link to this function

export_rdf_by_uri(node_uri, exclude_context \\ false)

Exports from Neo4j an LPG graph transformed into an RDF graph. The graph is centered on a node identified by node_uri.

This returns the full context unless an optional boolean arg exclude_context is passed as true which will exclude context if present.

Examples

iex> TestMatch.export_rdf_by_uri("http://example.org/Elixir")
%TestMatch.Graph{
  data: "@prefix neovoc: <neo4j://vocabulary#> .\n\n\n<http://example.org/Elixir> <http://example.org/creator> <http://dbpedia.org/resource/José_Valim>;\n  <http://example.org/homepage> <http://elixir-lang.org>;\n  <http://example.org/license> <http://dbpedia.org/resource/Apache_License>;\n  <http://example.org/name> "Elixir" .\n",
  file: "http___example.org_Elixir.ttl",
  path: ... <> "/test_match/priv/rdf/graphs/http___example.org_Elixir.ttl",
  type: :rdf,
  uri: "file:///" <> ... <> "/test_match/priv/rdf/graphs/http___example.org_Elixir.ttl"
}

iex> TestMatch.export_rdf_by_uri("http://example.org/Elixir").data
"@prefix neovoc: <neo4j://vocabulary#> .\n\n\n<http://example.org/Elixir> <http://example.org/creator> <http://dbpedia.org/resource/José_Valim>;\n  <http://example.org/homepage> <http://elixir-lang.org>;\n  <http://example.org/license> <http://dbpedia.org/resource/Apache_License>;\n  <http://example.org/name> "Elixir" .\n"
Link to this function

import_rdf_from_graph(graph_file \\ "default.ttl")

Imports into Neo4j an LPG graph transformed from an RDF graph.

Examples

iex> TestMatch.import_rdf_from_graph("elixir.ttl")
[
  %{
    "extraInfo" => "",
    "namespaces" => %{
      "http://example.org/" => "ns0",
      "http://purl.org/dc/elements/1.1/" => "dc",
      "http://purl.org/dc/terms/" => "dct",
      "http://schema.org/" => "sch",
      "http://www.w3.org/1999/02/22-rdf-syntax-ns#" => "rdf",
      "http://www.w3.org/2000/01/rdf-schema#" => "rdfs",
      "http://www.w3.org/2002/07/owl#" => "owl",
      "http://www.w3.org/2004/02/skos/core#" => "skos"
    },
    "terminationStatus" => "OK",
    "triplesLoaded" => 4
  }
]
Link to this function

import_rdf_from_query(query_file \\ "default.rq")

Imports into Neo4j an LPG graph transformed from an RDF graph which was queried from a remote datastore using a SPARQL endpoint.

Examples

iex> TestMatch.import_rdf_from_query("elixir.rq")
[
  %{
    "extraInfo" => "",
    "namespaces" => %{
      "http://example.org/" => "ns0",
      "http://purl.org/dc/elements/1.1/" => "dc",
      "http://purl.org/dc/terms/" => "dct",
      "http://schema.org/" => "sch",
      "http://www.w3.org/1999/02/22-rdf-syntax-ns#" => "rdf",
      "http://www.w3.org/2000/01/rdf-schema#" => "rdfs",
      "http://www.w3.org/2002/07/owl#" => "owl",
      "http://www.w3.org/2004/02/skos/core#" => "skos"
    },
    "terminationStatus" => "OK",
    "triplesLoaded" => 4
  }
]
Link to this function

lib_graph_from_cypher()

Delegates to TestMatch.Lib.from_cypher/0

Link to this function

lib_graph_from_cypher(arg)

Delegates to TestMatch.Lib.from_cypher/1

Link to this function

lib_graph_from_cypher_with_properties()

Delegates to TestMatch.Lib.from_cypher_with_properties/0

Link to this function

lib_graph_from_cypher_with_properties(arg)

Delegates to TestMatch.Lib.from_cypher_with_properties/1

Link to this function

lib_graph_from_sparql()

Delegates to TestMatch.Lib.from_sparql/0

Link to this function

lib_graph_from_sparql(arg)

Delegates to TestMatch.Lib.from_sparql/1

Link to this function

list_dot_graph_images()

Delegates to TestMatch.Lib.list_graph_images/0

Link to this function

list_dot_graphs()

Delegates to TestMatch.Lib.list_graphs/0

Link to this function

list_lib_graph_images()

Delegates to TestMatch.Lib.list_graph_images/0

Link to this function

list_lib_graphs()

Delegates to TestMatch.Lib.list_graphs/0

Link to this function

list_lpg_graphs()

Delegates to TestMatch.LPG.list_graphs/0

Link to this function

list_lpg_queries()

Delegates to TestMatch.LPG.list_queries/0

Link to this function

list_rdf_graphs()

Delegates to TestMatch.RDF.list_graphs/0

Link to this function

list_rdf_queries()

Delegates to TestMatch.RDF.list_queries/0

Link to this function

list_sparql_services()

Delegates to TestMatch.RDF.SPARQL.Client.sparql_services/0

Link to this function

local_sparql_endpoint()

Delegates to TestMatch.RDF.SPARQL.Client.local_sparql_endpoint/0

Delegates to TestMatch.LPG.books/0

Delegates to TestMatch.LPG.movies/0

Delegates to TestMatch.RDF.books/0

Link to this function

read_dot_graph()

Delegates to TestMatch.Lib.read_graph/0

Link to this function

read_dot_graph(arg)

Delegates to TestMatch.Lib.read_graph/1

Link to this function

read_lpg_graph()

Delegates to TestMatch.LPG.read_graph/0

Link to this function

read_lpg_graph(arg)

Delegates to TestMatch.LPG.read_graph/1

Link to this function

read_lpg_query()

Delegates to TestMatch.LPG.read_query/0

Link to this function

read_lpg_query(arg)

Delegates to TestMatch.LPG.read_query/1

Link to this function

read_rdf_graph()

Delegates to TestMatch.RDF.read_graph/0

Link to this function

read_rdf_graph(arg)

Delegates to TestMatch.RDF.read_graph/1

Link to this function

read_rdf_query()

Delegates to TestMatch.RDF.read_query/0

Link to this function

read_rdf_query(arg)

Delegates to TestMatch.RDF.read_query/1

Delegates to TestMatch.RDF.SPARQL.Client.rquery/0

Delegates to TestMatch.RDF.SPARQL.Client.rquery/1

Link to this function

sparql(arg1, arg2)

Delegates to TestMatch.RDF.SPARQL.Client.rquery/2

Delegates to TestMatch.RDF.SPARQL.Client.rquery/0

Delegates to TestMatch.RDF.SPARQL.Client.rquery/1

Link to this function

sparql!(arg1, arg2)

Delegates to TestMatch.RDF.SPARQL.Client.rquery/2

Link to this function

sparql_endpoint()

Delegates to TestMatch.RDF.SPARQL.Client.sparql_endpoint/0

Link to this function

sparql_endpoint(arg)

Delegates to TestMatch.RDF.SPARQL.Client.sparql_endpoint/1

Delegates to TestMatch.RDF.SPARQL.Client.sparql_query/0

Link to this function

sparql_query(arg)

Delegates to TestMatch.RDF.SPARQL.Client.sparql_query/1

Link to this function

wikidata_sparql_endpoint()

Delegates to TestMatch.RDF.SPARQL.Client.wikidata_sparql_endpoint/0

Link to this function

write_dot_graph(arg)

Delegates to TestMatch.Lib.write_graph/1

Link to this function

write_dot_graph(arg1, arg2)

Delegates to TestMatch.Lib.write_graph/2

Link to this function

write_lib_graph(arg)

Delegates to TestMatch.Lib.write_lib_graph/1

Link to this function

write_lib_graph(arg1, arg2)

Delegates to TestMatch.Lib.write_lib_graph/2

Link to this function

write_lpg_graph(arg)

Delegates to TestMatch.LPG.write_graph/1

Link to this function

write_lpg_graph(arg1, arg2)

Delegates to TestMatch.LPG.write_graph/2

Link to this function

write_lpg_query(arg)

Delegates to TestMatch.LPG.write_query/1

Link to this function

write_lpg_query(arg1, arg2)

Delegates to TestMatch.LPG.write_query/2

Link to this function

write_rdf_graph(arg)

Delegates to TestMatch.RDF.write_graph/1

Link to this function

write_rdf_graph(arg1, arg2)

Delegates to TestMatch.RDF.write_graph/2

Link to this function

write_rdf_query(arg)

Delegates to TestMatch.RDF.write_query/1

Link to this function

write_rdf_query(arg1, arg2)

Delegates to TestMatch.RDF.write_query/2

Link to this function

write_to_png(arg)

Delegates to TestMatch.Lib.to_png/1

Link to this function

write_to_png(arg1, arg2)

Delegates to TestMatch.Lib.to_png/2