Re: protege-user Digest, Vol 5, Issue 6

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: protege-user Digest, Vol 5, Issue 6

kala devi ramar
Dear sir


please tell me   the equivalent SPARQL query in protégé 4.2 for the following
SELECT temp, rain FROM weather WHERE temp.loc = rain.location AND temp.loc = “chennai”
Thank u

R.kaladevi

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: protege-user Digest, Vol 5, Issue 6

Matthew Horridge-2
Administrator
Hi,

Do you have an ontology that you can post to the list?  It’s kind of hard to write a correct SPARQL query without reference to the ontology.

Cheers,

Matthew

On 6 Jun 2014, at 22:31, kala devi ramar <[hidden email]> wrote:

Dear sir


please tell me   the equivalent SPARQL query in protégé 4.2 for the following
SELECT temp, rain FROM weather WHERE temp.loc = rain.location AND temp.loc = “chennai”
Thank u

R.kaladevi
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: protege-user Digest, Vol 5, Issue 6

Langley, Brent
In reply to this post by kala devi ramar
Assuming you are posing a high-level question, and not expecting a final-cut script without tweaking...

Here are some tips in converting from SQL to SPARQL:
1) In SPARQL, don’t separate SELECT items with commas.
2) If running the query within Protege, and the Weather ontology is already loaded, you can drop the FROM clause
3) The WHERE clause will take  “subject predicate object” triples to narrow the search.  variables are text with a question-mark prefix, like ?wetLoc.
4) variables reused in multiple places in the WHERE clause constrain the search to match found items to be the same values
5) from your example, it appears you have fields / properties called loc and location on the two different objects.  Using PREFIX shortens their full specification within your script.
6) FILTER can be used to further limit the result set

So your SQL might be written as:

SELECT ?temp ?rain
WHERE 
{
?temp  myInfo:loc  ?wetLoc .
?rain  myInfo:location ?wetLoc .
FILTER ( ?wetLoc = “chennai” )
}

Hopefully that gets you pointed in the right direction.

…Brent

On Jun 7, 2014, at 1:31 AM, kala devi ramar <[hidden email]> wrote:

Dear sir


please tell me   the equivalent SPARQL query in protégé 4.2 for the following
SELECT temp, rain FROM weather WHERE temp.loc = rain.location AND temp.loc = “chennai”
Thank u

R.kaladevi
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: protege-user Digest, Vol 5, Issue 6

Lorenz Buehmann
I would more suggest reading a SPARQL tutorial might be a good choice to get more knowledge in this direction.  Otherwise more SQL queries might have to be converted and he/she will have to ask for help again. Additionally, I think it's better to ask for help in forums like http://answers.semanticweb.com/ or Stackoverflow as the question is not very related to Protege despite the fact that he/she wants to run the query in Protege.

Lorenz
On 06/10/2014 03:25 PM, Langley, Brent wrote:
Assuming you are posing a high-level question, and not expecting a final-cut script without tweaking...

Here are some tips in converting from SQL to SPARQL:
1) In SPARQL, don’t separate SELECT items with commas.
2) If running the query within Protege, and the Weather ontology is already loaded, you can drop the FROM clause
3) The WHERE clause will take  “subject predicate object” triples to narrow the search.  variables are text with a question-mark prefix, like ?wetLoc.
4) variables reused in multiple places in the WHERE clause constrain the search to match found items to be the same values
5) from your example, it appears you have fields / properties called loc and location on the two different objects.  Using PREFIX shortens their full specification within your script.
6) FILTER can be used to further limit the result set

So your SQL might be written as:

SELECT ?temp ?rain
WHERE 
{
?temp  myInfo:loc  ?wetLoc .
?rain  myInfo:location ?wetLoc .
FILTER ( ?wetLoc = “chennai” )
}

Hopefully that gets you pointed in the right direction.

…Brent

On Jun 7, 2014, at 1:31 AM, kala devi ramar <[hidden email]> wrote:

Dear sir


please tell me   the equivalent SPARQL query in protégé 4.2 for the following
SELECT temp, rain FROM weather WHERE temp.loc = rain.location AND temp.loc = “chennai”
Thank u

R.kaladevi
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user



_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user