|
ghily |
rozzettino
Registered: Jul 2003
Posts: 718 (0.09 al dì)
Location: Settimo
Corso: Informatica spec
Anno: 2
Time Online: 13 Days, 1:05:36 [...]
Status: Offline
Edit | Report | IP: Logged |
da quello che ho capito io distinct te li elimina di sicuro, cioè ti ritorna un solo elemento, invece reduced te li riduce nel senso che potrebbe fartene vedere 1 o 2 o tre, una roba random insomma.
Esempio tratto dal reference
9.3.1 DISTINCT
The DISTINCT solution modifier eliminates duplicate solutions. Specifically, each solution that binds the same variables to the same RDF terms as another solution is eliminated from the solution set.
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT DISTINCT ?name WHERE { ?x foaf:name ?name }
name
"Alice"
Note that, per the order of solution sequence modifiers, duplicates are eliminated before either limit or offset is applied.
9.3.2 REDUCED
While the DISTINCT modifier ensures that duplicate solutions are eliminated from the solution set, REDUCED simply permits them to be eliminated. The cardinality of any set of variable bindings in an REDUCED solution set is at least one and not more than the cardinality of the solution set with no DISTINCT or REDUCED modifier . For example, using the data above, the query
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT REDUCED ?name WHERE { ?x foaf:name ?name }
may have one, two (shown here) or three solutions:
name
"Alice"
"Alice"
__________________
------------------------------------------------------------------------
O siamo capaci di sconfiggere le idee contrarie con la discussione, o dobbiamo lasciarle esprimere. Non è possibile sconfiggere le idee con la forza, perchè questo blocca il libero sviluppo dell'intelligenza
(Ernesto Che Guevara)
------------------------------------------------------------------------
|