What is wrong with the following? I would expect 233.33 in the last 
variable.

Thank you.

d = Graph().parse(data = """
<http://www.aa.nl/data#l1> <http://purl.org#val1> 
"100"^^<http://www.w3.org/2001/XMLSchema#decimal>.
<http://www.aa.nl/data#l2> <http://purl.org#val1> 
"200"^^<http://www.w3.org/2001/XMLSchema#decimal>.
<http://www.aa.nl/data#l3> <http://purl.org#val1> 
"400"^^<http://www.w3.org/2001/XMLSchema#decimal>.
""")

q = """
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT (SUM(?value1) AS ?nominator) (COUNT(?s1) AS ?denominator) 
(?nominator / ?denominator AS ?indicator)

WHERE 
{ 
        ?s1 <http://purl.org#val1> ?value1 .
}

"""
for r in d.query(q):
    print(r)

(rdflib.term.Literal('700', 
datatype=rdflib.term.URIRef('http://www.w3.org/2001/XMLSchema#decimal')), 
rdflib.term.Literal('3', 
datatype=rdflib.term.URIRef('http://www.w3.org/2001/XMLSchema#integer')), 
None)

-- 
http://github.com/RDFLib
--- 
You received this message because you are subscribed to the Google Groups 
"rdflib-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rdflib-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rdflib-dev/fa626618-35e3-48fa-936b-e8ee2a79997en%40googlegroups.com.

Reply via email to