Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Didattica > Corsi N - Z > Ontologie e web semantico > dubbio sparql: DISTINCT vs REDUCED
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
amari
.consigliere.

User info:
Registered: Aug 2006
Posts: 136 (0.02 al dì)
Location: Milano
Corso: Informatica
Anno: 3
Time Online: 21:56:15 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
dubbio sparql: DISTINCT vs REDUCED

Ciao,

qualcuno potrebbe spiegare la differenza tra le clausole DISTINCT e REDUCED?

Grazie mille
A.

07-05-2008 16:15
Click Here to See the Profile for amari Click here to Send amari a Private Message Find more posts by amari Add amari to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ghily
rozzettino

User info:
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

Post actions:

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)
------------------------------------------------------------------------

07-05-2008 16:23
Click Here to See the Profile for ghily Click Here to See the Blog of ghily Click here to Send ghily a Private Message Visit ghily's homepage! Find more posts by ghily Add ghily to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
amari
.consigliere.

User info:
Registered: Aug 2006
Posts: 136 (0.02 al dì)
Location: Milano
Corso: Informatica
Anno: 3
Time Online: 21:56:15 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Grazie mille

A.

07-05-2008 18:09
Click Here to See the Profile for amari Click here to Send amari a Private Message Find more posts by amari Add amari to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 14:40.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.029 seconds (81.53% PHP - 18.47% MySQL) con 28 query.