0

Normal Data Insertion

{
  :sub :pred 'o1'. 
  :sub :pred 'o2'.
  :sub :pred 'o3'. 
}

Data insertion using container

{
  :sub :pred :_b. 
  :_b rdf:type rdf:Seq.
  :_b rdf:_1 'o1'. 
  :_b rdf:_2 'o2'.
  :_b rdf:_3 'o3'. 
}

When I used the basic select query, both the above insertion models were returning results in same order(o1, o2, o3).

What are the benefits we get by container approach(rdf:Seq)?

Is rdf:Seq just for representational purpose or does it perform anything under the hood(i.e, preserves insertion ordering) when queried upon?

My Understanding: Even the container insertion model just works the same as the basic normal model when retrieved upon. So even with the container model, insertion order won't be guaranteed while retrieval. I really don't understand the significance of rdf:Seq (docs link)

harish chava
  • 302
  • 2
  • 15
  • 1
    was basically already answered in your previous question. "normal" insertion does not preserve the order among the values of `?o`. Nor does `rdf:Seq`. If you really need this, then use `rdf:List` as documented here: https://www.w3.org/TR/rdf-schema/#ch_list and how to query documented here: https://stackoverflow.com/questions/17523804/is-it-possible-to-get-the-position-of-an-element-in-an-rdf-collection-in-sparql – UninformedUser Apr 08 '20 at 13:55
  • What is the signifance of containers ? they seem to behave like any normal resources – harish chava Apr 08 '20 at 15:39
  • 1
    in contrast to RDF collections as `rdf:List` those containers are defined to be open or at least you aren't able to state that there are no more elements. The reason for the existence of those containers, don't know - it's just something to represent data that to whatever reason "belongs" together. Anyways, use `rdf:List` and you're done with your task – UninformedUser Apr 09 '20 at 08:05

0 Answers0