Skip to main content

Graph Guide

What is a graph

A graph is a collection of nodes, unordered edges and values, these are all resources. Nodes can be labelled and nodes can have edges. Edges have a source ('from') and a destination ('to') resource which can both be either a node, edge or value. The edge is always labeled with a key (property) and an edge can also be the source to other edges (statements on edges). Values have a data-value and values can have edges.

  • Graphs support Librarian-traversals
  • Graphs can be merged (graph ++ graph)
  • Graphs support transactions (graph.transaction -> new in-memory graph with 'commit' function)
  • Graph support history (never delete, only add an edge (@deletedon) to the edge .. to be tested)

create a graph

val graph: Graph = MemGraph("graph-doc")
import scala.concurrent.duration._
scala.concurrent.Await.ready(lspace.util.SampleGraph.loadSocial(graph).runToFuture, 5.seconds)
val labels = SampleGraph.ontologies
val keys = SampleGraph.properties

How to use

First steps:

import lspace._ //easy access to common object (types) //easy access to common object (types)
import lspace.Implicits.Scheduler.global //default scheduler (execution context) //default scheduler (execution context)
import lspace.Implicits.SyncGuide.guide //graph-engine

To create a graph (in-memory):

val graph = Graph("my-graph-url")
// graph: Graph = graph:my-graph-url

A graph always has a name, ideally this would be a url so it can be referenced.

Before continuing reading and learning, first load some sample-data:

lspace.util.SampleGraph.loadSocial(graph).runToFuture
// res0: monix.execution.CancelableFuture[{val places: AnyRef{val SanJosédeMaipo: AnyRef{val place: lspace.structure.Node; val id: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultString.C]; val name: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultString.C]; val geo: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultGeopoint.C]}; val CrystalSprings: AnyRef{val place: lspace.structure.Node; val id: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultString.C]; val name: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultString.C]; val geo: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultGeopoint.C]}; val Haridwar: AnyRef{val place: lspace.structure.Node; val id: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultString.C]; val name: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultString.C]; val geo: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultGeopoint.C]}; val Talca: AnyRef{val place: lspace.structure.Node; val id: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultString.C]; val name: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultString.C]; val geo: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultGeopoint.C]}};val persons: AnyRef{val Yoshio: AnyRef{val person: lspace.structure.Node; val id: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultString.C]; val name: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultString.C]; val birthdate: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultLocalDate.C]; val birthPlace: lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node]; val balance: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultDouble.C]; val rate: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultInt.C]; val address: lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node]}; val Levi: AnyRef{val person: lspace.structure.Node; val id: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultString.C]; val name: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultString.C]; val birthdate: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultLocalDate.C]; val birthPlace: lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node]; val balance: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultDouble.C]; val rate: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultInt.C]; val address: lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node]}; val Gray: AnyRef{val person: lspace.structure.Node; val id: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultString.C]; val name: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultString.C]; val birthdate: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultLocalDate.C]; val birthPlace: lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node]; val balance: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultDouble.C]; val rate: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultInt.C]; val address: lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node]}; val Kevin: AnyRef{val person: lspace.structure.Node; val id: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultString.C]; val name: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultString.C]; val birthdate: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultLocalDate.C]; val birthPlace: lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node]; val balance: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultDouble.C]; val rate: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultInt.C]; val address: lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node]}; val Stan: AnyRef{val person: lspace.structure.Node; val id: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultString.C]; val name: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultString.C]; val birthdate: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultLocalDate.C]; val birthPlace: lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node]; val balance: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultInt.C]; val rate: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultInt.C]; val address: lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node]}; val Garrison: AnyRef{val person: lspace.structure.Node; val id: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultString.C]; val name: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultString.C]; val birthdate: lspace.structure.Edge[lspace.structure.Node,lspace.structure.util.ClassTypeable.defaultLocalDate.C]; val birthPlace: lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node]; val address: lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node]}};val knows: AnyRef{val GarrissonKnownStan: (lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node], lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node]); val GarrissonKnownKevin: (lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node], lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node]); val KevinKnownStan: (lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node], lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node]); val KevinKnownGray: (lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node], lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node]); val GrayKnowsLevi: (lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node], lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node]); val LeviKnowsYoshio: (lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node], lspace.structure.Edge[lspace.structure.Node,lspace.structure.Node])}}] = Async(
// underlying = Future(<not completed>),
// cancelable = monix.eval.internal.TaskConnection$Impl$$anon$1@450264ce,
// isolatedCtx = null
// )

Graphs have a some basis API's which allows for reading from and writing to the graph.

Resource API's

Graph-resources can all be retrieved by Iri (@id) or by Id. Values and edges do mostly not have an Iri (empty-string). There are API's on each structure-level (resource, value, edge and node).

The main methods per section:

Resources API

hasIri

graph.resources.hasIri("graph-doc/place/123")
// res1: monix.reactive.Observable[Resource[Any]] = monix.reactive.internal.operators.ConcatMapObservable@5cfded2c
graph.resources.hasIri("graph-doc/place/123", "graph-doc/person/123")
// res2: monix.reactive.Observable[Resource[Any]] = monix.reactive.internal.operators.ConcatMapObservable@43f07f2a

hasId

graph.resources.hasId(1001L).id
// res3: monix.eval.Task[Option[Long]] = Map(
// source = FlatMap(
// source = Eval(
// thunk = lspace.provider.mem.store.MemStore$$Lambda$57526/0x000000080445fbc0@4e23192b
// ),
// f = lspace.structure.Resources$$Lambda$57530/0x0000000804464b68@2fe7606f,
// trace = StackTrace(
// stackTrace = List(
// monix.eval.internal.TaskTracing$.buildFrame(TaskTracing.scala:52),
// monix.eval.internal.TaskTracing$.buildCachedFrame(TaskTracing.scala:43),
// monix.eval.internal.TaskTracing$.cached(TaskTracing.scala:38),
// monix.eval.Task.flatMap(Task.scala:1792),
// lspace.structure.Resources.hasId(Resources.scala:60),
// repl.MdocSession$App.<init>(03-graph-guide.md:41),
// repl.MdocSession$.app(03-graph-guide.md:3),
// mdoc.internal.document.DocumentBuilder$$doc$.$anonfun$build$2(DocumentBuilder.scala:89),
// scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18),
// scala.util.DynamicVariable.withValue(DynamicVariable.scala:59),
// scala.Console$.withErr(Console.scala:193),
// mdoc.internal.document.DocumentBuilder$$doc$.$anonfun$build$1(DocumentBuilder.scala:89),
// scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18),
// scala.util.DynamicVariable.withValue(DynamicVariable.scala:59),
// scala.Console$.withOut(Console.scala:164),
// mdoc.internal.document.DocumentBuilder$$doc$.build(DocumentBuilder.scala:88),
// mdoc.internal.markdown.MarkdownBuilder$.$anonfun$buildDocument$2(MarkdownBuilder.scala:47),
// mdoc.internal.markdown.MarkdownBuilder$$anon$1.run(MarkdownBuilder.scala:103)
// )
// )
// ),
// f = lspace.package$ResourceOptionTask$$Lambda$57538/0x0000000804466cf8@3d6cc588,
// trace = StackTrace(
// stackTrace = List(
// monix.eval.internal.TaskTracing$.buildFrame(TaskTracing.scala:52),
// monix.eval.internal.TaskTracing$.buildCachedFrame(TaskTracing.scala:43),
// monix.eval.internal.TaskTracing$.cached(TaskTracing.scala:38),
// monix.eval.Task.map(Task.scala:2027),
// lspace.package$ResourceOptionTask.id(package.scala:77),
// repl.MdocSession$App.<init>(03-graph-guide.md:41),
// repl.MdocSession$.app(03-graph-guide.md:3),
// mdoc.internal.document.DocumentBuilder$$doc$.$anonfun$build$2(DocumentBuilder.scala:89),
// scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18),
// ...

upsert

graph.values.create("some-literal")
// res4: monix.eval.Task[Value[String]] = FlatMap(
// source = Async(
// register = <function2>,
// trampolineBefore = false,
// trampolineAfter = false,
// restoreLocals = true,
// trace = StackTrace(
// stackTrace = List(
// monix.eval.internal.TaskTracing$.buildFrame(TaskTracing.scala:52),
// monix.eval.internal.TaskTracing$.buildCachedFrame(TaskTracing.scala:43),
// monix.eval.internal.TaskTracing$.cached(TaskTracing.scala:38),
// monix.eval.internal.TracedAsync$.apply(TracedAsync.scala:39),
// monix.eval.internal.TaskCreate$.cancelableCancelable(TaskCreate.scala:65),
// monix.eval.Task$AsyncBuilder0$$anon$6.create(Task.scala:4571),
// monix.eval.Task$AsyncBuilder$CreatePartiallyApplied$.apply$extension(Task.scala:4504),
// monix.reactive.Observable.firstOrElseL(Observable.scala:4232),
// monix.reactive.Observable.firstL(Observable.scala:4223),
// monix.reactive.Observable.headL(Observable.scala:4214),
// monix.reactive.Observable.foldLeftL(Observable.scala:4382),
// monix.reactive.Observable.toListL(Observable.scala:4744),
// lspace.provider.mem.store.MemNodeStore.hasIri(MemNodeStore.scala:27),
// lspace.structure.Nodes.hasIri(Nodes.scala:31),
// lspace.structure.RApi.hasIri(RApi.scala:10),
// lspace.structure.RApi.hasIri$(RApi.scala:10),
// lspace.structure.Nodes.hasIri(Nodes.scala:13),
// lspace.structure.Ontologies.$anonfun$store$2(Ontologies.scala:109),
// scala.Option.getOrElse(Option.scala:201),
// lspace.structure.Ontologies.store(Ontologies.scala:95),
// lspace.structure.Node._addLabel(Node.scala:42),
// lspace.structure.Node._addLabel$(Node.scala:41),
// lspace.provider.mem.MemGraph$$anon$6.lspace$provider$mem$MemNode$$super$_addLabel(MemGraph.scala:87),
// lspace.provider.mem.MemNode.$anonfun$addLabel$1(MemNode.scala:45),
// monix.eval.internal.TaskRunLoop$.startFuture(TaskRunLoop.scala:605),
// monix.eval.Task.runToFutureOpt(Task.scala:587),
// monix.eval.Task.runToFuture(Task.scala:543),
// repl.MdocSession$App.<init>(03-graph-guide.md:26),
// repl.MdocSession$.app(03-graph-guide.md:3),
// mdoc.internal.document.DocumentBuilder$$doc$.$anonfun$build$2(DocumentBuilder.scala:89),
// scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18),
// scala.util.DynamicVariable.withValue(DynamicVariable.scala:59),
// scala.Console$.withErr(Console.scala:193),
// mdoc.internal.document.DocumentBuilder$$doc$.$anonfun$build$1(DocumentBuilder.scala:89),
// scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18),
// scala.util.DynamicVariable.withValue(DynamicVariable.scala:59),
// ...
graph.values.create("some-literal") //should be equal because values are deduplicated
// res5: monix.eval.Task[Value[String]] = FlatMap(
// source = Async(
// register = <function2>,
// trampolineBefore = false,
// trampolineAfter = false,
// restoreLocals = true,
// trace = StackTrace(
// stackTrace = List(
// monix.eval.internal.TaskTracing$.buildFrame(TaskTracing.scala:52),
// monix.eval.internal.TaskTracing$.buildCachedFrame(TaskTracing.scala:43),
// monix.eval.internal.TaskTracing$.cached(TaskTracing.scala:38),
// monix.eval.internal.TracedAsync$.apply(TracedAsync.scala:39),
// monix.eval.internal.TaskCreate$.cancelableCancelable(TaskCreate.scala:65),
// monix.eval.Task$AsyncBuilder0$$anon$6.create(Task.scala:4571),
// monix.eval.Task$AsyncBuilder$CreatePartiallyApplied$.apply$extension(Task.scala:4504),
// monix.reactive.Observable.firstOrElseL(Observable.scala:4232),
// monix.reactive.Observable.firstL(Observable.scala:4223),
// monix.reactive.Observable.headL(Observable.scala:4214),
// monix.reactive.Observable.foldLeftL(Observable.scala:4382),
// monix.reactive.Observable.toListL(Observable.scala:4744),
// lspace.provider.mem.store.MemNodeStore.hasIri(MemNodeStore.scala:27),
// lspace.structure.Nodes.hasIri(Nodes.scala:31),
// lspace.structure.RApi.hasIri(RApi.scala:10),
// lspace.structure.RApi.hasIri$(RApi.scala:10),
// lspace.structure.Nodes.hasIri(Nodes.scala:13),
// lspace.structure.Ontologies.$anonfun$store$2(Ontologies.scala:109),
// scala.Option.getOrElse(Option.scala:201),
// lspace.structure.Ontologies.store(Ontologies.scala:95),
// lspace.structure.Node._addLabel(Node.scala:42),
// lspace.structure.Node._addLabel$(Node.scala:41),
// lspace.provider.mem.MemGraph$$anon$6.lspace$provider$mem$MemNode$$super$_addLabel(MemGraph.scala:87),
// lspace.provider.mem.MemNode.$anonfun$addLabel$1(MemNode.scala:45),
// monix.eval.internal.TaskRunLoop$.startFuture(TaskRunLoop.scala:605),
// monix.eval.Task.runToFutureOpt(Task.scala:587),
// monix.eval.Task.runToFuture(Task.scala:543),
// repl.MdocSession$App.<init>(03-graph-guide.md:26),
// repl.MdocSession$.app(03-graph-guide.md:3),
// mdoc.internal.document.DocumentBuilder$$doc$.$anonfun$build$2(DocumentBuilder.scala:89),
// scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18),
// scala.util.DynamicVariable.withValue(DynamicVariable.scala:59),
// scala.Console$.withErr(Console.scala:193),
// mdoc.internal.document.DocumentBuilder$$doc$.$anonfun$build$1(DocumentBuilder.scala:89),
// scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18),
// scala.util.DynamicVariable.withValue(DynamicVariable.scala:59),
// ... //should be equal because values are deduplicated
graph.values.create("some-literal2") //new value, hence new id
// res6: monix.eval.Task[Value[String]] = FlatMap(
// source = Async(
// register = <function2>,
// trampolineBefore = false,
// trampolineAfter = false,
// restoreLocals = true,
// trace = StackTrace(
// stackTrace = List(
// monix.eval.internal.TaskTracing$.buildFrame(TaskTracing.scala:52),
// monix.eval.internal.TaskTracing$.buildCachedFrame(TaskTracing.scala:43),
// monix.eval.internal.TaskTracing$.cached(TaskTracing.scala:38),
// monix.eval.internal.TracedAsync$.apply(TracedAsync.scala:39),
// monix.eval.internal.TaskCreate$.cancelableCancelable(TaskCreate.scala:65),
// monix.eval.Task$AsyncBuilder0$$anon$6.create(Task.scala:4571),
// monix.eval.Task$AsyncBuilder$CreatePartiallyApplied$.apply$extension(Task.scala:4504),
// monix.reactive.Observable.firstOrElseL(Observable.scala:4232),
// monix.reactive.Observable.firstL(Observable.scala:4223),
// monix.reactive.Observable.headL(Observable.scala:4214),
// monix.reactive.Observable.foldLeftL(Observable.scala:4382),
// monix.reactive.Observable.toListL(Observable.scala:4744),
// lspace.provider.mem.store.MemNodeStore.hasIri(MemNodeStore.scala:27),
// lspace.structure.Nodes.hasIri(Nodes.scala:31),
// lspace.structure.RApi.hasIri(RApi.scala:10),
// lspace.structure.RApi.hasIri$(RApi.scala:10),
// lspace.structure.Nodes.hasIri(Nodes.scala:13),
// lspace.structure.Ontologies.$anonfun$store$2(Ontologies.scala:109),
// scala.Option.getOrElse(Option.scala:201),
// lspace.structure.Ontologies.store(Ontologies.scala:95),
// lspace.structure.Node._addLabel(Node.scala:42),
// lspace.structure.Node._addLabel$(Node.scala:41),
// lspace.provider.mem.MemGraph$$anon$6.lspace$provider$mem$MemNode$$super$_addLabel(MemGraph.scala:87),
// lspace.provider.mem.MemNode.$anonfun$addLabel$1(MemNode.scala:45),
// monix.eval.internal.TaskRunLoop$.startFuture(TaskRunLoop.scala:605),
// monix.eval.Task.runToFutureOpt(Task.scala:587),
// monix.eval.Task.runToFuture(Task.scala:543),
// repl.MdocSession$App.<init>(03-graph-guide.md:26),
// repl.MdocSession$.app(03-graph-guide.md:3),
// mdoc.internal.document.DocumentBuilder$$doc$.$anonfun$build$2(DocumentBuilder.scala:89),
// scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18),
// scala.util.DynamicVariable.withValue(DynamicVariable.scala:59),
// scala.Console$.withErr(Console.scala:193),
// mdoc.internal.document.DocumentBuilder$$doc$.$anonfun$build$1(DocumentBuilder.scala:89),
// scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18),
// scala.util.DynamicVariable.withValue(DynamicVariable.scala:59),
// ...

count:

graph.resources.count()
// res7: monix.eval.Task[Long] = Map(
// source = Async(
// register = <function2>,
// trampolineBefore = true,
// trampolineAfter = true,
// restoreLocals = true,
// trace = null
// ),
// f = lspace.structure.Resources$$Lambda$57596/0x0000000804473c10@14c801a3,
// trace = StackTrace(
// stackTrace = List(
// monix.eval.internal.TaskTracing$.buildFrame(TaskTracing.scala:52),
// monix.eval.internal.TaskTracing$.buildCachedFrame(TaskTracing.scala:43),
// monix.eval.internal.TaskTracing$.cached(TaskTracing.scala:38),
// monix.eval.Task.map(Task.scala:2027),
// lspace.structure.Resources.count(Resources.scala:13),
// repl.MdocSession$App.<init>(03-graph-guide.md:59),
// repl.MdocSession$.app(03-graph-guide.md:3),
// mdoc.internal.document.DocumentBuilder$$doc$.$anonfun$build$2(DocumentBuilder.scala:89),
// scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18),
// scala.util.DynamicVariable.withValue(DynamicVariable.scala:59),
// scala.Console$.withErr(Console.scala:193),
// mdoc.internal.document.DocumentBuilder$$doc$.$anonfun$build$1(DocumentBuilder.scala:89),
// scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18),
// scala.util.DynamicVariable.withValue(DynamicVariable.scala:59),
// scala.Console$.withOut(Console.scala:164),
// mdoc.internal.document.DocumentBuilder$$doc$.build(DocumentBuilder.scala:88),
// mdoc.internal.markdown.MarkdownBuilder$.$anonfun$buildDocument$2(MarkdownBuilder.scala:47),
// mdoc.internal.markdown.MarkdownBuilder$$anon$1.run(MarkdownBuilder.scala:103)
// )
// )
// )

Resource

A resource ..

Nodes API

Nodes can be:

Retrieved by Iri(s)/Uri(s):

graph.nodes.hasIri("graph-doc/place/123")
// res8: monix.reactive.Observable[Node] = monix.reactive.internal.operators.ConcatMapObservable@9682c0
graph.nodes.hasIri("graph-doc/place/123", "graph-doc/person/123")
// res9: monix.reactive.Observable[Node] = monix.reactive.internal.operators.ConcatMapObservable@56f0d99f

Retrieved by Id(s):

graph.nodes.hasId(1002L)
// res10: monix.eval.Task[Option[Node]] = Eval(
// thunk = lspace.provider.mem.store.MemStore$$Lambda$57526/0x000000080445fbc0@52046a45
// )

Counted:

graph.nodes.count()
// res11: monix.eval.Task[Long] = Eval(
// thunk = lspace.provider.mem.store.MemStore$$Lambda$57567/0x000000080446e708@693e9182
// )

Node

A node ..

Edges API

Edges can be:

Counted:

graph.edges.count()
// res12: monix.eval.Task[Long] = Eval(
// thunk = lspace.provider.mem.store.MemStore$$Lambda$57567/0x000000080446e708@6791c323
// )

Edge

An edge ..

Values API

Counted:

graph.values.count()
// res13: monix.eval.Task[Long] = Eval(
// thunk = lspace.provider.mem.store.MemStore$$Lambda$57567/0x000000080446e708@3b7ad806
// )

Value

A value ..

History

A graph can have a history trait which means that resources are time aware and annotated with supporting "@createdon" and "@deletedon" tags.