Skip to Main Content
Exploring Graphs with Elixir
book

Exploring Graphs with Elixir

by Tony Hammond
November 2022
Intermediate to advanced content levelIntermediate to advanced
294 pages
5h 58m
English
Pragmatic Bookshelf
Content preview from Exploring Graphs with Elixir

Querying the Local RDF Service

We’re going to need some RDF data. To keep it simple, we’ll take the RDF description we generated in the previous chapter for a book resource—the book graph:

 iex>​​ ​​graph_context​​ ​​RDFGraph
 RDFGraph
 
 iex>​​ ​​graph_create​​ ​​read_graph(​​"book.ttl"​​)
 #GraphCommons.Graph<type: rdf, file: "", data: "">
 
 iex>​​ ​​graph_info
 %GraphCommons.Service.GraphInfo{
  file: "",
  labels: ["Book", "Organization", "Person"],
  num_edges: 27,
  num_nodes: 8,
  type: :rdf
 }

Here we selected the RDFGraph graph service and then created a new graph using the book.ttl stored graph.

Now let’s have a look at the SELECT and CONSTRUCT query forms.

SELECT

Let’s use a simple SELECT query that returns all the RDF terms ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Concurrent Data Processing in Elixir

Concurrent Data Processing in Elixir

Svilen Gospodinov

Publisher Resources

ISBN: 9798888650059Errata Page