I think you could also do FILTER, something like

SELECT * WHERE{?ApplicationUri a owl:Class.
?ApplicationUri rdfs:label ?label.
FILTER (?label = "forestry"|| "drilling"|| "oceans") .
?subClass rdfs:subClassOf* ?ApplicationUri.}



-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Scott
Henninger
Sent: Monday, June 08, 2009 7:49 PM
To: TopBraid Composer Users
Subject: [tbc-users] Re: Logical Operators


Steve;  Although it's not a strict "OR" operator, UNION will work in
this case:

SELECT *
WHERE {
  {  ?ApplicationUri rdfs:label "forestry"
  }
  UNION
  {  ?ApplicationUri rdfs:label "drilling"
  }
  UNION
  {  ?ApplicationUri rdfs:label "oceans"
  }
}

This gets the union of the three graph patterns, binding ?
ApplicationUri to the subject of the resulting graph.

-- Scott

On Jun 8, 5:52 pm, dalguy72 <[email protected]> wrote:
> I want to be able to be able to specify two (or possibly a list of
> possibilities) as criteria in my sparql query.   If I sql, I would use
> the "OR" operator or I would use an "IN" statement.  Is there an
> equivalent with sparql.
>
> The simplest example that I come up with is that I want to get the
> URI's for the items with the following labels: "forestry", "drilling",
> and "oceans".
>
> To get one of them, I would do something like:
>
> SELECT * WHERE{
>    ?ApplicationUri rdfs:label "forestry"
>
> }
>
> To get all of them in one return set is the goal I am after, and then
> I can place it within a more complex query, such as, in just a
> slightly more complex call, return all the subclassess that use the
> same application uri
>
> SELECT * WHERE{
>    ?ApplicationUri rdfs:label "forestry" .
>  ?subClass rdfs:subClassOf* ?ApplicationUri
>
> }
>
> Steve


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TopBraid Composer Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/topbraid-composer-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to