Building an RDF Graph
We’ll switch gears here and see how we can build up an RDF graph using RDF.ex rather than writing out the RDF explicitly as in the examples we just saw.
One of the challenges to working with RDF is managing URI strings. We’ll need to deal with node names ourselves (for instance data) as these will generally use application-specific naming. But for edges and node labels, we don’t want to be dealing with URI strings every time we add a property or a class name.
We can use one particular aspect of RDF.ex—its support for RDF vocabularies. This will abstract away the URI strings.
Let’s see how we might do this.
Adding a SCHEMA Vocabulary for Schema.org Terms
We could generate a set of example terms as used in the previous ...
Get Exploring Graphs with Elixir now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.