Re: [Owlim-discussion] REDUCED/DISTINCT

2013-04-08 Thread Jeen Broekstra

On 05/04/13 23:58, Jerven Bolleman wrote:

Dear OWLIM developers,

PREFIX rdfs:http://www.w3.org/2000/01/rdf-schema#
PREFIX up:http://purl.uniprot.org/core/
SELECT (count(DISTINCT(?protein)) as ?count) WHERE {
?protein a up:Protein ;
up:reviewed true ;
rdfs:seeAlso ?link .
}
Is allowed
PREFIX rdfs:http://www.w3.org/2000/01/rdf-schema#
PREFIX up:http://purl.uniprot.org/core/
SELECT (count(REDUCED(?protein)) as ?count) WHERE {
?protein a up:Protein ;
up:reviewed true ;
rdfs:seeAlso ?link .
}
throws a malformed query exception.
How come this the case?


This is because REDUCED is not allowed as a qualifier for aggregate 
functions, only DISTINCT can be used in this way. This is not a Sesame 
restrictions but a feature of the spec. See the SPARQL grammar for 
aggregates: http://www.w3.org/TR/sparql11-query/#rAggregate


So there is no bug here. Your second query is simply incorrect SPARQL. I 
assume this has been done simply because having REDUCED in an aggregate 
(where the exact behavior is undefined) is unlikely to be useful in 
practice.


As an aside, REDUCED as a qualifier for the SELECT clause (as opposed to 
aggregate functions) is a feature that has been supported by Sesame and 
OWLIM for a long while, since SPARQL 1.0 became a standard - though I 
must admit I have never used it myself and know of very few use cases in 
practice.


The default evaluation strategy for it in Sesame is to filter out 
duplicates that are sequential. For example, (A, A, B, A , B, B, C, B) 
will be reduced to (A, B, A, B, C, B).


Cheers,

Jeen
___
Owlim-discussion mailing list
Owlim-discussion@ontotext.com
http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion


Re: [Owlim-discussion] REDUCED/DISTINCT

2013-04-05 Thread Barry Bishop

Hi Jerven,

This is simply because REDUCED is not yet supported.

To be honest, I wasn't aware of this operator until your email, but I 
see that it has been around for a long time.


Now that SPARQL 1.1 has reached recommendation status, I expect there 
will be a push to get Sesame/OWLIM in synch.


Thanks for the observation,
barry

On 04/05/2013 12:58 PM, Jerven Bolleman wrote:

Dear OWLIM developers,

PREFIX rdfs:http://www.w3.org/2000/01/rdf-schema#
PREFIX up:http://purl.uniprot.org/core/
SELECT (count(DISTINCT(?protein)) as ?count) WHERE {
?protein a up:Protein ;
up:reviewed true ;
rdfs:seeAlso ?link .
}
Is allowed
PREFIX rdfs:http://www.w3.org/2000/01/rdf-schema#
PREFIX up:http://purl.uniprot.org/core/
SELECT (count(REDUCED(?protein)) as ?count) WHERE {
?protein a up:Protein ;
up:reviewed true ;
rdfs:seeAlso ?link .
}
throws a malformed query exception.
How come this the case?

Regards,
Jerven
---
Jerven Bollemanjerven.bolle...@isb-sib.ch
SIB Swiss Institute of Bioinformatics  Tel: +41 (0)22 379 58 85
CMU, rue Michel Servet 1   Fax: +41 (0)22 379 58 58
1211 Geneve 4,
Switzerland www.isb-sib.ch - www.uniprot.org
Follow us at https://twitter.com/#!/uniprot
---

___
Owlim-discussion mailing list
Owlim-discussion@ontotext.com
http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion


___
Owlim-discussion mailing list
Owlim-discussion@ontotext.com
http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion


Re: [Owlim-discussion] REDUCED/DISTINCT

2013-04-05 Thread Jerven Bolleman
Hi Barry,

Kind of odd that 
PREFIX rdfs:http://www.w3.org/2000/01/rdf-schema# 
PREFIX up:http://purl.uniprot.org/core/ 
SELECT REDUCED ?protein WHERE {
   ?protein a up:Protein ;
   up:reviewed true ;
   rdfs:seeAlso ?link .
}
Does work.

Reduced and Distinct both exist in the sesame algebra as UnaryTupleOperator at 
least in the 2.7 branch.


Regards,
Jerven
On Apr 5, 2013, at 1:54 PM, Barry Bishop wrote:

 Hi Jerven,
 
 This is simply because REDUCED is not yet supported.
 
 To be honest, I wasn't aware of this operator until your email, but I see 
 that it has been around for a long time.
 
 Now that SPARQL 1.1 has reached recommendation status, I expect there will be 
 a push to get Sesame/OWLIM in synch.
 
 Thanks for the observation,
 barry
 
 On 04/05/2013 12:58 PM, Jerven Bolleman wrote:
 Dear OWLIM developers,
 
 PREFIX rdfs:http://www.w3.org/2000/01/rdf-schema#
 PREFIX up:http://purl.uniprot.org/core/
 SELECT (count(DISTINCT(?protein)) as ?count) WHERE {
?protein a up:Protein ;
up:reviewed true ;
rdfs:seeAlso ?link .
 }
 Is allowed
 PREFIX rdfs:http://www.w3.org/2000/01/rdf-schema#
 PREFIX up:http://purl.uniprot.org/core/
 SELECT (count(REDUCED(?protein)) as ?count) WHERE {
?protein a up:Protein ;
up:reviewed true ;
rdfs:seeAlso ?link .
 }
 throws a malformed query exception.
 How come this the case?
 
 Regards,
 Jerven
 ---
 Jerven Bollemanjerven.bolle...@isb-sib.ch
 SIB Swiss Institute of Bioinformatics  Tel: +41 (0)22 379 58 85
 CMU, rue Michel Servet 1   Fax: +41 (0)22 379 58 58
 1211 Geneve 4,
 Switzerland www.isb-sib.ch - www.uniprot.org
 Follow us at https://twitter.com/#!/uniprot
 ---
 
 ___
 Owlim-discussion mailing list
 Owlim-discussion@ontotext.com
 http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion
 

---
Jerven Bollemanjerven.bolle...@isb-sib.ch
SIB Swiss Institute of Bioinformatics  Tel: +41 (0)22 379 58 85
CMU, rue Michel Servet 1   Fax: +41 (0)22 379 58 58
1211 Geneve 4,
Switzerland www.isb-sib.ch - www.uniprot.org
Follow us at https://twitter.com/#!/uniprot
---

___
Owlim-discussion mailing list
Owlim-discussion@ontotext.com
http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion


Re: [Owlim-discussion] REDUCED/DISTINCT

2013-04-05 Thread Barry Bishop

... I learn something everyday!

Yes, this is indeed strange, but I will ask Jeen to have a look.

Best,
barry

On 04/05/2013 02:08 PM, Jerven Bolleman wrote:

Hi Barry,

Kind of odd that
PREFIX rdfs:http://www.w3.org/2000/01/rdf-schema#
PREFIX up:http://purl.uniprot.org/core/
SELECT REDUCED ?protein WHERE {
?protein a up:Protein ;
up:reviewed true ;
rdfs:seeAlso ?link .
}
Does work.

Reduced and Distinct both exist in the sesame algebra as UnaryTupleOperator at 
least in the 2.7 branch.


Regards,
Jerven
On Apr 5, 2013, at 1:54 PM, Barry Bishop wrote:


Hi Jerven,

This is simply because REDUCED is not yet supported.

To be honest, I wasn't aware of this operator until your email, but I see that 
it has been around for a long time.

Now that SPARQL 1.1 has reached recommendation status, I expect there will be a 
push to get Sesame/OWLIM in synch.

Thanks for the observation,
barry

On 04/05/2013 12:58 PM, Jerven Bolleman wrote:

Dear OWLIM developers,

PREFIX rdfs:http://www.w3.org/2000/01/rdf-schema#
PREFIX up:http://purl.uniprot.org/core/
SELECT (count(DISTINCT(?protein)) as ?count) WHERE {
?protein a up:Protein ;
up:reviewed true ;
rdfs:seeAlso ?link .
}
Is allowed
PREFIX rdfs:http://www.w3.org/2000/01/rdf-schema#
PREFIX up:http://purl.uniprot.org/core/
SELECT (count(REDUCED(?protein)) as ?count) WHERE {
?protein a up:Protein ;
up:reviewed true ;
rdfs:seeAlso ?link .
}
throws a malformed query exception.
How come this the case?

Regards,
Jerven
---
Jerven Bollemanjerven.bolle...@isb-sib.ch
SIB Swiss Institute of Bioinformatics  Tel: +41 (0)22 379 58 85
CMU, rue Michel Servet 1   Fax: +41 (0)22 379 58 58
1211 Geneve 4,
Switzerland www.isb-sib.ch - www.uniprot.org
Follow us at https://twitter.com/#!/uniprot
---

___
Owlim-discussion mailing list
Owlim-discussion@ontotext.com
http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion

---
Jerven Bollemanjerven.bolle...@isb-sib.ch
SIB Swiss Institute of Bioinformatics  Tel: +41 (0)22 379 58 85
CMU, rue Michel Servet 1   Fax: +41 (0)22 379 58 58
1211 Geneve 4,
Switzerland www.isb-sib.ch - www.uniprot.org
Follow us at https://twitter.com/#!/uniprot
---



___
Owlim-discussion mailing list
Owlim-discussion@ontotext.com
http://ontomail.semdata.org/cgi-bin/mailman/listinfo/owlim-discussion