Little need for support

18 views
Skip to first unread message

Richard Dijkstra

unread,
Feb 25, 2019, 3:44:36 PM2/25/19
to rdflib-dev
Dear rdflib user/devleoper,

I am enthousiatic about rdflib but I am shocked that only few questions are asked here and even less are answered. I did expect a lot more.

Does anybody have a idea why this is the case.
Thank you for your reply.

Richard D

Jörn Hees

unread,
Feb 26, 2019, 3:56:42 AM2/26/19
to rdfli...@googlegroups.com

> On 25 Feb 2019, at 21:44, Richard Dijkstra <richarddi...@gmail.com> wrote:
>
> I am enthousiatic about rdflib but I am shocked that only few questions are asked here and even less are answered. I did expect a lot more.
>
> Does anybody have a idea why this is the case.
> Thank you for your reply.

Well, the simple answer is: we'd all like to be more active here, but all have jobs leaving too little time for this :-/

So please feel jump in.

Best,
Jörn

Richard Dijkstra

unread,
Feb 26, 2019, 4:51:39 AM2/26/19
to rdflib-dev
Hi Jörn,

Thank you for the reply. I do think RDFlib is being used professionally; that means that learning and creating come together.

e.g. I am analyzing a customer data set and want to extract the customers that exist exact twice in the set.

I query:

        SELECT  ?naam  (COUNT(?naam) as ?count)
        WHERE {
                ?sfg_cust local:Klantnr ?klantnr ;
                          rdfs:label ?naam .
                FILTER (?count = 2)
                }
                GROUP BY ?naam
                ORDER BY DESC(?count)
                """,

on the following graph:

local:sfg_customer_100068 a local:Sfg_customer ;
    rdfs:label "SCALDA COLL V BROOD EN BANKET" ;
    ...
    local:Klant_categorienr 345 ;
    local:Klant_omschrijving "SCALDA COLL V BROOD EN BANKET"^^xsd:string ;
    local:Klantnr "100068"^^xsd:string ;

Without the FILTER I get a nice result; but with FILTER the result is empty.
What is wrong?

regards,
Richard

Jörn Hees

unread,
Feb 26, 2019, 5:08:17 AM2/26/19
to rdfli...@googlegroups.com

> On 26 Feb 2019, at 10:51, Richard Dijkstra <richarddi...@gmail.com> wrote:
>
> I query:
>
> SELECT ?naam (COUNT(?naam) as ?count)
> WHERE {
> ?sfg_cust local:Klantnr ?klantnr ;
> rdfs:label ?naam .
> FILTER (?count = 2)
> }
> GROUP BY ?naam
> ORDER BY DESC(?count)
> """,
>
> on the following graph:
>
> local:sfg_customer_100068 a local:Sfg_customer ;
> rdfs:label "SCALDA COLL V BROOD EN BANKET" ;
> ...
> local:Klant_categorienr 345 ;
> local:Klant_omschrijving "SCALDA COLL V BROOD EN BANKET"^^xsd:string ;
> local:Klantnr "100068"^^xsd:string ;
>
> Without the FILTER I get a nice result; but with FILTER the result is empty.
> What is wrong?

Quick answer without trying it out: the aggregate projection variable is only defined outside of the WHERE block, so it's not available within...
Try HAVING (https://www.w3.org/TR/2013/REC-sparql11-query-20130321/#having) or an inner query.

j

Richard Dijkstra

unread,
Mar 3, 2019, 10:19:17 AM3/3/19
to rdflib-dev
After hours puzzling I foud the next working construct having a double counter!
The query is different but similar.

    SELECT ?relation (COUNT(?relation) AS ?count)
    WHERE {
            ?author ?relation ex:Paper1 .
            }
            GROUP BY ?relation
            HAVING (COUNT(?relation) < 2 )

Jörn, thank you for the social motivation :)

Richard
Reply all
Reply to author
Forward
0 new messages