November 2022
Intermediate to advanced
294 pages
5h 58m
English
The first thing we’ll do is create a new module. Create a new folder examples/ under our rdf_graph/lib/rdf_graph/ folder and under that create a walk_query.ex file.
| | . |
| | ├── rdf_graph |
| | │ ├── examples |
| » | │ │ └── walk_query.ex |
| | │ ├── service.ex |
| | │ └── vocab.ex |
| | └── rdf_graph.ex |
Then create a new module:
| | defmodule RDFGraph.Examples.WalkQuery do |
| | |
| | # ... |
| | |
| | end |
Now add in a walk_query/2 function as follows:
| 1: | def walk_query(link \\ "http://dbpedia.org/resource/Bob_Dylan", count \\ 0) |
| - | def walk_query(_, count) when count >= 7, do: :ok |
| - | |
| - | def walk_query(link, count) do |
| 5: | IO.puts link |
| - | query = |
| - | ~S""" |
| - | PREFIX dbo: <http://dbpedia.org/ontology/> ... |
Read now
Unlock full access