I know you said that the property value is not duplicated, but it really
looks like it is. Could something unexpected have created it?
Can you please confirm that the following returns nothing?
SELECT ?activity ?r1 ?r2
WHERE {
?activity ont:rating ?r1 . ?activity ont:rating ?r2
FILTER (!sameTerm(?r1, ?r2)) }
Regards,
Paul
On Wed, Dec 5, 2012 at 12:48 PM, Emmanuelle <[email protected]> wrote:
> Hi,
>
> I'm getting duplicated results when executing the following query (I'm
> using jena 2.7.0):
>
> SELECT ?activity ?rating WHERE {?activity ont:rating ?rating }
> ....
> | ind:obj675_p2c22A | "0.75"^^xsd:float |
> | ind:obj3967_p2c22A | "1"^^xsd:float |
> | ind:obj3967_p2c22A | "1.0"^^xsd:float |
> ....
> Only values equal to their integer part are duplicated this way.
>
> The "ind:obj3967_p2c22A" individual is unique and the datatype
> property value is not duplicated in the ontology, it's functional with
> range float:
>
> <owl:DatatypeProperty rdf:about="&ont;rating">
> <rdf:type rdf:resource="&owl;FunctionalProperty"/>
> <rdfs:range rdf:resource="&xsd;float"/>
> </owl:DatatypeProperty>
>
> I could get around it by doing:
> SELECT ?activity ((?rating * 1.0) as ?r) WHERE {?activity ont:rating
> ?rating }
>
> but I couldn't find a way to get a accurate result when aggregating, e.g.:
> SELECT (count(?activity) as ?totA) (sum(?rating) as ?totR) WHERE ....
>
> Is it the expected behavior? Is there a way to set the precision of
> float values when querying the ontology to avoid duplication?
>
> Thanks in advance.
> Emmanuelle
>