W3C home > Mailing lists > Public > public-sparql-dev@w3.org > July to September 2011

Fwd: Request for help....

From: Farhana Sarker <joyamamun@gmail.com>
Date: Wed, 14 Sep 2011 15:06:00 +0100
Message-ID: <CAHQhh0K4v4usDJo4Q-KGv6b8L+Rq6Eun-8s8kERz5r4P7ouf-A@mail.gmail.com>
To: public-sparql-dev@w3.org
Could anyone help me please for my below request??


Best regards,
Farhana

---------- Forwarded message ----------
From: Farhana Sarker <joyamamun@gmail.com>
Date: Tue, Sep 13, 2011 at 4:24 PM
Subject: Request for help....
To: public-sparql-dev@w3.org


Hi,

I am a new SPARQL user.
I need to write a query using SPARQL which can be set conditions and will be
able to return the value if AT LEAST 3 condition is TRUE.

For example:

I want to return all the id and other information from my datasets where 6
conditions are given (as shown below) and want to retrieve information for
whom at least ANY 3 conditions are TRUE. Could you please help me to write
the query correctly as the below query returns for which all the conditions
are TRUE.But I need to retrieve information for whom at least ANY 3
conditions are TRUE.

select ?id ?a ?b ?c ?d ?e ?f ?g

where {

             ?id myns:a ?a.

             filter (regex(?a, "professional")).

             ?id myns:b ?b.

             filter (?b = "P")

             ?id myns:c ?c.

             filter (?c != "UH")

             ?id myns:d ?d.

             filter (?d<2.7)

             ?id myns:e ?e.

             filter (?e<2.7)

             ?id myns:f ?f.

             filter (?f = M)

             ?id myns:g ?g.

               filter (?g != S)

  }



Thank you

Farhana
Received on Thursday, 15 September 2011 07:20:28 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 15 September 2011 07:20:31 GMT