This question is a follow up to Can CONSTRUCT return duplicate triples?, the accepted answer there states the following:

The results of a CONSTRUCT query is an RDF graph. An RDF graph is a set of triples. A set is a mathematical object which only contains a single copy of each of its elements.

When we communicate the results of a CONSTRUCT query, we do so by writing down the serialization of an RDF graph, such as in RDF/XML or in Turtle. These serializations do nothing to prohibit us from writing the same triple down twice


So... a CONSTRUCT query is welcome to return its results in a serialization that contains duplicate triples, but whether it does so or not is irrelevant, since it's serializing the same RDF graph either way.

Does "When we communicate the results of a CONSTRUCT query" extend to using an API? The SPARQL working draft(s) probably have nothing to say about this, but what would you expect or demand from an API for executing sparql (construct) queries?

Specifically, would you accept an API construct, e.g. an iterator, that returns duplicate RDF triples or would you be horrified and dismayed?

asked 06 Nov '12, 01:25

bazbishop's gravatar image

accept rate: 25%

converted 06 Nov '12, 10:35

Rob%20Vesse's gravatar image

Rob Vesse ♦

Yes I would, ultimately behavior in this regard in going to be down to the API designer. Provided the API states what it's behavior is clearly I wouldn't mind either way.

Personally I would prefer an API that doesn't suppress duplicates because this likely makes the API more efficient (no need to maintain state information necessary to check for duplicates e.g. a Set of triples generated so far) and gives the consumer of the API the freedom to choose to suppress duplicates as and when they need to.

permanent link

answered 06 Nov '12, 10:40

Rob%20Vesse's gravatar image

Rob Vesse ♦
accept rate: 29%


Just for the record--since I answered the original question--I fully agree with Rob's answer.

(06 Nov '12, 12:55) lee lee's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 06 Nov '12, 01:25

question was seen: 1,183 times

last updated: 06 Nov '12, 12:55