3
  • I am using sesame HTTP api with its in-memory rdf store.
  • I load data/triples in a context/named graph
  • I query using named graph/context

I have 2 questions:

  • In the same repository, can a graph node be shared across different named graphs?

    • My use case is I filter data from graph1 and put it in graph2. So are nodes shared b/w graph1 and graph2?
  • Is looking up for a named graph an O(1) operation during a GET operation ? Or is there a performance advantage of using named graphs ?

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58
gaurav jain
  • 1,267
  • 8
  • 20
  • 36

1 Answers1

4
  1. Yes, a graph node can be shared across different named graphs - in fact in Sesame any RDF resource with the same URI is automatically assumed to be identical and is therefore automatically shared across named graphs.
  2. That depends on the type of store and index used. In the in-memory store, a search for all statements given a particular element (subject, predicate, object, or named graph/context) is O(1) as the required list of statements is directly accessible. In a native store (Sesame's persistent on-disk store) the complexity depends on which indices are available, but on average it's O(log n).
Jeen Broekstra
  • 21,642
  • 4
  • 51
  • 73
  • thanks. But I assume if I delete graph2, then shared node will not be affected as it is referenced by graph1. right? – gaurav jain Jan 28 '13 at 08:38
  • That's correct. All modification operations in Sesame work on RDF statements. If you delete all statements in graph2, that will not affect the contents of graph1. – Jeen Broekstra Jan 28 '13 at 19:48