SPARQL query

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

SPARQL query

ali rahimi
Dear all,
I have a simple ontology to identify diabetic patients. I also read different tutorials about SPARQL queries on Protégé 4.2 but totally I’m confused. Please show me step by step what I should do for the following simple query in SPARQL tab:
“list of patients between 20 and 50 years old with their ReasonForVisit”
 
Best Regards
Ali

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

DQontology3.owl (114K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SPARQL query

Timothy Redmond

There are several SPARQL tutorials on the web.  In order to create the following query I went to [1] which I found by searching google for "sparql less than".  This query does approximately what you want

Prefix : <http://www.semanticweb.org/ontologies/2012/2/Ontology1331511057559.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?reason 
	WHERE { ?subject :Age ?age .
                      ?subject :ReasonForVisit ?reason . FILTER (?age >= 20 && ?age <= 50) 

I know that I can make this better - for some reason I wasn't able to take advantage of the turtle syntax abbrevisions involving the repeated use of ?subject.

-Timothy


[1] http://jena.sourceforge.net/ARQ/Tutorial/optionals.html

On 5/7/12 8:03 AM, ali rahimi wrote:
Dear all,
I have a simple ontology to identify diabetic patients. I also read different tutorials about SPARQL queries on Protégé 4.2 but totally I’m confused. Please show me step by step what I should do for the following simple query in SPARQL tab:
“list of patients between 20 and 50 years old with their ReasonForVisit”
 
Best Regards
Ali


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


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

Re: SPARQL query

ali rahimi
Thanks for your help.
But my question is if i want to write a query with several variables may can use DL query tab in protege 4.2. for example: list of patients who use medication "Diabex" and with thier "History" .
 
Best Regards
Ali
From: Timothy Redmond <[hidden email]>
To: [hidden email]
Sent: Tuesday, 8 May 2012 3:30 AM
Subject: Re: [p4-feedback] SPARQL query


There are several SPARQL tutorials on the web.  In order to create the following query I went to [1] which I found by searching google for "sparql less than".  This query does approximately what you want

Prefix : <http://www.semanticweb.org/ontologies/2012/2/Ontology1331511057559.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?reason 
	WHERE { ?subject :Age ?age .
                      ?subject :ReasonForVisit ?reason . FILTER (?age >= 20 && ?age <= 50) 

I know that I can make this better - for some reason I wasn't able to take advantage of the turtle syntax abbrevisions involving the repeated use of ?subject.

-Timothy


[1] http://jena.sourceforge.net/ARQ/Tutorial/optionals.html

On 5/7/12 8:03 AM, ali rahimi wrote:
Dear all,
I have a simple ontology to identify diabetic patients. I also read different tutorials about SPARQL queries on Protégé 4.2 but totally I’m confused. Please show me step by step what I should do for the following simple query in SPARQL tab:
“list of patients between 20 and 50 years old with their ReasonForVisit”
 
Best Regards
Ali


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


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



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

Re: SPARQL query

Timothy Redmond
On 05/09/2012 01:18 AM, ali rahimi wrote:
Thanks for your help.
But my question is if i want to write a query with several variables may can use DL query tab in protege 4.2. for example: list of patients who use medication "Diabex" and with thier "History" .

This would be nice because the DL query syntax is easier to understand than SPARQL syntax and it has always supported OWL entailment.  Unfortunately we can't currently do this.  The best that I can offer is that there is a SPARQL plugin coming soon that does do OWL entailment.  This gives you the OWL entailment but you are still stuck with the SPARQL syntax.

-Timothy



 
Best Regards
Ali
From: Timothy Redmond [hidden email]
To: [hidden email]
Sent: Tuesday, 8 May 2012 3:30 AM
Subject: Re: [p4-feedback] SPARQL query


There are several SPARQL tutorials on the web.  In order to create the following query I went to [1] which I found by searching google for "sparql less than".  This query does approximately what you want

Prefix : <http://www.semanticweb.org/ontologies/2012/2/Ontology1331511057559.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?reason 
	WHERE { ?subject :Age ?age .
                      ?subject :ReasonForVisit ?reason . FILTER (?age >= 20 && ?age <= 50) 

I know that I can make this better - for some reason I wasn't able to take advantage of the turtle syntax abbrevisions involving the repeated use of ?subject.

-Timothy


[1] http://jena.sourceforge.net/ARQ/Tutorial/optionals.html

On 5/7/12 8:03 AM, ali rahimi wrote:
Dear all,
I have a simple ontology to identify diabetic patients. I also read different tutorials about SPARQL queries on Protégé 4.2 but totally I’m confused. Please show me step by step what I should do for the following simple query in SPARQL tab:
“list of patients between 20 and 50 years old with their ReasonForVisit”
 
Best Regards
Ali


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


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




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


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

Re: SPARQL query

ali rahimi
Hi dear,

1. Would you please let me know why the following query it's not working:

I wan to show "“list of patients between their HbA1c results is between 10 and 20 with their ReasonForVisit”

Prefix : <http://www.semanticweb.org/ontologies/2012/2/Ontology1331511057559.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?reason
    WHERE { ?subject :Age ?HbA1C .
                      ?subject :ReasonForVisit ?reason . FILTER (?hba1c >= 10 && ?hba1c <= 20)
}

2. After above query How can I filter only patients who their ReasonForVisit is "Diabetes". Please show me this SPARQL rule. I mean in the second column list only "Diabetes" for patients who in their
ReasonForVisit registered "Diabetes"

3. How we can combine two SPARQL query with together. e.g.
"list of patients between their HbA1c results is between 10 and 20 with their ReasonForVisit” and "Patients who consume specific DrugName "Diabex" and "Mixtard" "
 
Best Regards
Ali

From: Timothy Redmond <[hidden email]>
To: [hidden email]
Sent: Friday, 11 May 2012 4:07 AM
Subject: Re: [p4-feedback] SPARQL query

On 05/09/2012 01:18 AM, ali rahimi wrote:
Thanks for your help.
But my question is if i want to write a query with several variables may can use DL query tab in protege 4.2. for example: list of patients who use medication "Diabex" and with thier "History" .

This would be nice because the DL query syntax is easier to understand than SPARQL syntax and it has always supported OWL entailment.  Unfortunately we can't currently do this.  The best that I can offer is that there is a SPARQL plugin coming soon that does do OWL entailment.  This gives you the OWL entailment but you are still stuck with the SPARQL syntax.

-Timothy



 
Best Regards
Ali
From: Timothy Redmond [hidden email]
To: [hidden email]
Sent: Tuesday, 8 May 2012 3:30 AM
Subject: Re: [p4-feedback] SPARQL query


There are several SPARQL tutorials on the web.  In order to create the following query I went to [1] which I found by searching google for "sparql less than".  This query does approximately what you want

Prefix : <http://www.semanticweb.org/ontologies/2012/2/Ontology1331511057559.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?reason 
	WHERE { ?subject :Age ?age .
                      ?subject :ReasonForVisit ?reason . FILTER (?age >= 20 && ?age <= 50) 

I know that I can make this better - for some reason I wasn't able to take advantage of the turtle syntax abbrevisions involving the repeated use of ?subject.

-Timothy


[1] http://jena.sourceforge.net/ARQ/Tutorial/optionals.html

On 5/7/12 8:03 AM, ali rahimi wrote:
Dear all,
I have a simple ontology to identify diabetic patients. I also read different tutorials about SPARQL queries on Protégé 4.2 but totally I’m confused. Please show me step by step what I should do for the following simple query in SPARQL tab:
“list of patients between 20 and 50 years old with their ReasonForVisit”
 
Best Regards
Ali


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


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




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


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



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

DQontology4.owl (126K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SPARQL query

Alan Ruttenberg-2

1. It looks like thus query will return more patients with acne than diabetes ;-)

2.  filter(str(?response = "Diabetes"))  but you really shouldn't use a string for that - the reasons should be in the ontology

3.  put the two sparql query patterns one after another into the same query.

On May 18, 2012 10:01 AM, "ali rahimi" <[hidden email]> wrote:
Hi dear,

1. Would you please let me know why the following query it's not working:

I wan to show "“list of patients between their HbA1c results is between 10 and 20 with their ReasonForVisit”

Prefix : <http://www.semanticweb.org/ontologies/2012/2/Ontology1331511057559.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?reason
    WHERE { ?subject :Age ?HbA1C .
                      ?subject :ReasonForVisit ?reason . FILTER (?hba1c >= 10 && ?hba1c <= 20)
}

2. After above query How can I filter only patients who their ReasonForVisit is "Diabetes". Please show me this SPARQL rule. I mean in the second column list only "Diabetes" for patients who in their
ReasonForVisit registered "Diabetes"

3. How we can combine two SPARQL query with together. e.g.
"list of patients between their HbA1c results is between 10 and 20 with their ReasonForVisit” and "Patients who consume specific DrugName "Diabex" and "Mixtard" "
 
Best Regards
Ali

From: Timothy Redmond <[hidden email]>
To: [hidden email]
Sent: Friday, 11 May 2012 4:07 AM
Subject: Re: [p4-feedback] SPARQL query

On 05/09/2012 01:18 AM, ali rahimi wrote:
Thanks for your help.
But my question is if i want to write a query with several variables may can use DL query tab in protege 4.2. for example: list of patients who use medication "Diabex" and with thier "History" .

This would be nice because the DL query syntax is easier to understand than SPARQL syntax and it has always supported OWL entailment.  Unfortunately we can't currently do this.  The best that I can offer is that there is a SPARQL plugin coming soon that does do OWL entailment.  This gives you the OWL entailment but you are still stuck with the SPARQL syntax.

-Timothy



 
Best Regards
Ali
From: Timothy Redmond [hidden email]
To: [hidden email]
Sent: Tuesday, 8 May 2012 3:30 AM
Subject: Re: [p4-feedback] SPARQL query


There are several SPARQL tutorials on the web.  In order to create the following query I went to [1] which I found by searching google for "sparql less than".  This query does approximately what you want

Prefix : <http://www.semanticweb.org/ontologies/2012/2/Ontology1331511057559.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?reason 
	WHERE { ?subject :Age ?age .
                      ?subject :ReasonForVisit ?reason . FILTER (?age >= 20 && ?age <= 50) 

I know that I can make this better - for some reason I wasn't able to take advantage of the turtle syntax abbrevisions involving the repeated use of ?subject.

-Timothy


[1] http://jena.sourceforge.net/ARQ/Tutorial/optionals.html

On 5/7/12 8:03 AM, ali rahimi wrote:
Dear all,
I have a simple ontology to identify diabetic patients. I also read different tutorials about SPARQL queries on Protégé 4.2 but totally I’m confused. Please show me step by step what I should do for the following simple query in SPARQL tab:
“list of patients between 20 and 50 years old with their ReasonForVisit”
 
Best Regards
Ali


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


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




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


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



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


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

Re: SPARQL query

ali rahimi
Dear Alan,
Thanks so much but can you show me practically how you do that for Q.3 and Q.2.
 I can not get my answer for Q.1.

Best Regards
Ali

From: Alan Ruttenberg <[hidden email]>
To: Protege 4 feedback <[hidden email]>; ali rahimi <[hidden email]>
Sent: Saturday, 19 May 2012 12:42 AM
Subject: Re: [p4-feedback] SPARQL query

1. It looks like thus query will return more patients with acne than diabetes ;-)
2.  filter(str(?response = "Diabetes"))  but you really shouldn't use a string for that - the reasons should be in the ontology
3.  put the two sparql query patterns one after another into the same query.
On May 18, 2012 10:01 AM, "ali rahimi" <[hidden email]> wrote:
Hi dear,

1. Would you please let me know why the following query it's not working:

I wan to show "“list of patients between their HbA1c results is between 10 and 20 with their ReasonForVisit”

Prefix : <http://www.semanticweb.org/ontologies/2012/2/Ontology1331511057559.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?reason
    WHERE { ?subject :Age ?HbA1C .
                      ?subject :ReasonForVisit ?reason . FILTER (?hba1c >= 10 && ?hba1c <= 20)
}

2. After above query How can I filter only patients who their ReasonForVisit is "Diabetes". Please show me this SPARQL rule. I mean in the second column list only "Diabetes" for patients who in their
ReasonForVisit registered "Diabetes"

3. How we can combine two SPARQL query with together. e.g.
"list of patients between their HbA1c results is between 10 and 20 with their ReasonForVisit” and "Patients who consume specific DrugName "Diabex" and "Mixtard" "
 
Best Regards
Ali

From: Timothy Redmond <[hidden email]>
To: [hidden email]
Sent: Friday, 11 May 2012 4:07 AM
Subject: Re: [p4-feedback] SPARQL query

On 05/09/2012 01:18 AM, ali rahimi wrote:
Thanks for your help.
But my question is if i want to write a query with several variables may can use DL query tab in protege 4.2. for example: list of patients who use medication "Diabex" and with thier "History" .

This would be nice because the DL query syntax is easier to understand than SPARQL syntax and it has always supported OWL entailment.  Unfortunately we can't currently do this.  The best that I can offer is that there is a SPARQL plugin coming soon that does do OWL entailment.  This gives you the OWL entailment but you are still stuck with the SPARQL syntax.

-Timothy



 
Best Regards
Ali
From: Timothy Redmond [hidden email]
To: [hidden email]
Sent: Tuesday, 8 May 2012 3:30 AM
Subject: Re: [p4-feedback] SPARQL query


There are several SPARQL tutorials on the web.  In order to create the following query I went to [1] which I found by searching google for "sparql less than".  This query does approximately what you want

Prefix : <http://www.semanticweb.org/ontologies/2012/2/Ontology1331511057559.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?reason 
	WHERE { ?subject :Age ?age .
                      ?subject :ReasonForVisit ?reason . FILTER (?age >= 20 && ?age <= 50) 

I know that I can make this better - for some reason I wasn't able to take advantage of the turtle syntax abbrevisions involving the repeated use of ?subject.

-Timothy


[1] http://jena.sourceforge.net/ARQ/Tutorial/optionals.html

On 5/7/12 8:03 AM, ali rahimi wrote:
Dear all,
I have a simple ontology to identify diabetic patients. I also read different tutorials about SPARQL queries on Protégé 4.2 but totally I’m confused. Please show me step by step what I should do for the following simple query in SPARQL tab:
“list of patients between 20 and 50 years old with their ReasonForVisit”
 
Best Regards
Ali


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


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




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


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



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




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

Re: SPARQL query

Timothy Redmond

One problem that this ontology has that makes string comparisons fail is that several of the datatypes have Literal datatypes.  Thus for instance Patient9 has a History of "Diabetes"^^Literal.  I am not sure what this actually means, the datatype you want there is either PlainLiteral (which you could represent by simply removing the ^^Literal) or string ("Diabetes"^^string).  You can find these by going to the entities tab, selecting datatypes, clicking on Literal and selecting the "Datatype Usage" tab (upper left).  Also indicating that a datatype property has a range of Literal is vacuous.  Literal is the top datatype.

I would however pay attention to Alan's point that Diabetes should really not be a string but a class or an individual.  As a string, you run the risk of someone (either at query time or at data entry time) will misspell it.  Also, as a string you might miss opportunities to say something interesting about it.

-Timothy



On 05/18/2012 08:42 AM, ali rahimi wrote:
Dear Alan,
Thanks so much but can you show me practically how you do that for Q.3 and Q.2.
 I can not get my answer for Q.1.

Best Regards
Ali

From: Alan Ruttenberg [hidden email]
To: Protege 4 feedback [hidden email]; ali rahimi [hidden email]
Sent: Saturday, 19 May 2012 12:42 AM
Subject: Re: [p4-feedback] SPARQL query

1. It looks like thus query will return more patients with acne than diabetes ;-)
2.  filter(str(?response = "Diabetes"))  but you really shouldn't use a string for that - the reasons should be in the ontology
3.  put the two sparql query patterns one after another into the same query.
On May 18, 2012 10:01 AM, "ali rahimi" <[hidden email]> wrote:
Hi dear,

1. Would you please let me know why the following query it's not working:

I wan to show "“list of patients between their HbA1c results is between 10 and 20 with their ReasonForVisit”

Prefix : <http://www.semanticweb.org/ontologies/2012/2/Ontology1331511057559.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?reason
    WHERE { ?subject :Age ?HbA1C .
                      ?subject :ReasonForVisit ?reason . FILTER (?hba1c >= 10 && ?hba1c <= 20)
}

2. After above query How can I filter only patients who their ReasonForVisit is "Diabetes". Please show me this SPARQL rule. I mean in the second column list only "Diabetes" for patients who in their
ReasonForVisit registered "Diabetes"

3. How we can combine two SPARQL query with together. e.g.
"list of patients between their HbA1c results is between 10 and 20 with their ReasonForVisit” and "Patients who consume specific DrugName "Diabex" and "Mixtard" "
 
Best Regards
Ali

From: Timothy Redmond <[hidden email]>
To: [hidden email]
Sent: Friday, 11 May 2012 4:07 AM
Subject: Re: [p4-feedback] SPARQL query

On 05/09/2012 01:18 AM, ali rahimi wrote:
Thanks for your help.
But my question is if i want to write a query with several variables may can use DL query tab in protege 4.2. for example: list of patients who use medication "Diabex" and with thier "History" .

This would be nice because the DL query syntax is easier to understand than SPARQL syntax and it has always supported OWL entailment.  Unfortunately we can't currently do this.  The best that I can offer is that there is a SPARQL plugin coming soon that does do OWL entailment.  This gives you the OWL entailment but you are still stuck with the SPARQL syntax.

-Timothy



 
Best Regards
Ali
From: Timothy Redmond [hidden email]
To: [hidden email]
Sent: Tuesday, 8 May 2012 3:30 AM
Subject: Re: [p4-feedback] SPARQL query


There are several SPARQL tutorials on the web.  In order to create the following query I went to [1] which I found by searching google for "sparql less than".  This query does approximately what you want

Prefix : <http://www.semanticweb.org/ontologies/2012/2/Ontology1331511057559.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?reason 
	WHERE { ?subject :Age ?age .
                      ?subject :ReasonForVisit ?reason . FILTER (?age >= 20 && ?age <= 50) 

I know that I can make this better - for some reason I wasn't able to take advantage of the turtle syntax abbrevisions involving the repeated use of ?subject.

-Timothy


[1] http://jena.sourceforge.net/ARQ/Tutorial/optionals.html

On 5/7/12 8:03 AM, ali rahimi wrote:
Dear all,
I have a simple ontology to identify diabetic patients. I also read different tutorials about SPARQL queries on Protégé 4.2 but totally I’m confused. Please show me step by step what I should do for the following simple query in SPARQL tab:
“list of patients between 20 and 50 years old with their ReasonForVisit”
 
Best Regards
Ali


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


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




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


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



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





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


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

DatatypeUsage.png (121K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SPARQL query

ali rahimi
Dear all,

1.I revised some literal properties and added more object properties for patients but it did not work on new ontology (attached file). please let me know practically why the following query it's not working:

I wan to show "“list of patients between their HbA1cValue results is between 4 and 9 with their ReasonForVisit”

Prefix : <http://www.semanticweb.org/ontologies/2012/2/Ontology1331511057559.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?reason
    WHERE { ?subject :HbA1C ?HbA1C .
                      ?subject :ReasonForVisit ?reason . FILTER (?hba1c >= 4 && ?hba1c <= 9)
}

2. I have done what you mentioned but it did not work on new ontology
(attached file). Please show me practically, after above query How can I filter only patients who their ReasonForVisit is "Diabetes" or "Diabetes Mellitus - Type II". Please let me know this SPARQL query. I mean in the second column list only "Diabetes" for patients who in their ReasonForVisit registered "Diabetes"

3. How we can combine two SPARQL query with together. e.g.
"list of patients between their HbA1c results is between 4 and 9 with their ReasonForVisit” which is "Diabetes" and "Patients who consume specific medications "DiabexXR" and "Diamicron "
 
Best Regards
Ali

From: Timothy Redmond <[hidden email]>
To: [hidden email]
Sent: Thursday, 24 May 2012 12:39 AM
Subject: Re: [p4-feedback] SPARQL query


One problem that this ontology has that makes string comparisons fail is that several of the datatypes have Literal datatypes.  Thus for instance Patient9 has a History of "Diabetes"^^Literal.  I am not sure what this actually means, the datatype you want there is either PlainLiteral (which you could represent by simply removing the ^^Literal) or string ("Diabetes"^^string).  You can find these by going to the entities tab, selecting datatypes, clicking on Literal and selecting the "Datatype Usage" tab (upper left).  Also indicating that a datatype property has a range of Literal is vacuous.  Literal is the top datatype.

I would however pay attention to Alan's point that Diabetes should really not be a string but a class or an individual.  As a string, you run the risk of someone (either at query time or at data entry time) will misspell it.  Also, as a string you might miss opportunities to say something interesting about it.

-Timothy



On 05/18/2012 08:42 AM, ali rahimi wrote:
Dear Alan,
Thanks so much but can you show me practically how you do that for Q.3 and Q.2.
 I can not get my answer for Q.1.

Best Regards
Ali

From: Alan Ruttenberg [hidden email]
To: Protege 4 feedback [hidden email]; ali rahimi [hidden email]
Sent: Saturday, 19 May 2012 12:42 AM
Subject: Re: [p4-feedback] SPARQL query

1. It looks like thus query will return more patients with acne than diabetes ;-)
2.  filter(str(?response = "Diabetes"))  but you really shouldn't use a string for that - the reasons should be in the ontology
3.  put the two sparql query patterns one after another into the same query.
On May 18, 2012 10:01 AM, "ali rahimi" <[hidden email]> wrote:
Hi dear,

1. Would you please let me know why the following query it's not working:

I wan to show "“list of patients between their HbA1c results is between 10 and 20 with their ReasonForVisit”

Prefix : <http://www.semanticweb.org/ontologies/2012/2/Ontology1331511057559.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?reason
    WHERE { ?subject :Age ?HbA1C .
                      ?subject :ReasonForVisit ?reason . FILTER (?hba1c >= 10 && ?hba1c <= 20)
}

2. After above query How can I filter only patients who their ReasonForVisit is "Diabetes". Please show me this SPARQL rule. I mean in the second column list only "Diabetes" for patients who in their
ReasonForVisit registered "Diabetes"

3. How we can combine two SPARQL query with together. e.g.
"list of patients between their HbA1c results is between 10 and 20 with their ReasonForVisit” and "Patients who consume specific DrugName "Diabex" and "Mixtard" "
 
Best Regards
Ali

From: Timothy Redmond <[hidden email]>
To: [hidden email]
Sent: Friday, 11 May 2012 4:07 AM
Subject: Re: [p4-feedback] SPARQL query

On 05/09/2012 01:18 AM, ali rahimi wrote:
Thanks for your help.
But my question is if i want to write a query with several variables may can use DL query tab in protege 4.2. for example: list of patients who use medication "Diabex" and with thier "History" .

This would be nice because the DL query syntax is easier to understand than SPARQL syntax and it has always supported OWL entailment.  Unfortunately we can't currently do this.  The best that I can offer is that there is a SPARQL plugin coming soon that does do OWL entailment.  This gives you the OWL entailment but you are still stuck with the SPARQL syntax.

-Timothy



 
Best Regards
Ali
From: Timothy Redmond [hidden email]
To: [hidden email]
Sent: Tuesday, 8 May 2012 3:30 AM
Subject: Re: [p4-feedback] SPARQL query


There are several SPARQL tutorials on the web.  In order to create the following query I went to [1] which I found by searching google for "sparql less than".  This query does approximately what you want

Prefix : <http://www.semanticweb.org/ontologies/2012/2/Ontology1331511057559.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?reason 
	WHERE { ?subject :Age ?age .
                      ?subject :ReasonForVisit ?reason . FILTER (?age >= 20 && ?age <= 50) 

I know that I can make this better - for some reason I wasn't able to take advantage of the turtle syntax abbrevisions involving the repeated use of ?subject.

-Timothy


[1] http://jena.sourceforge.net/ARQ/Tutorial/optionals.html

On 5/7/12 8:03 AM, ali rahimi wrote:
Dear all,
I have a simple ontology to identify diabetic patients. I also read different tutorials about SPARQL queries on Protégé 4.2 but totally I’m confused. Please show me step by step what I should do for the following simple query in SPARQL tab:
“list of patients between 20 and 50 years old with their ReasonForVisit”
 
Best Regards
Ali


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


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




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


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



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





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


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



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

DQontology5.owl (193K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SPARQL query

ali rahimi
In reply to this post by Alan Ruttenberg-2
Dear Alan,
Please send me a couple of picture for how you do queries in items 2 and 3. I can not do that.
 
Best Regards
Ali

From: Alan Ruttenberg <[hidden email]>
To: Protege 4 feedback <[hidden email]>; ali rahimi <[hidden email]>
Sent: Saturday, 19 May 2012 12:42 AM
Subject: Re: [p4-feedback] SPARQL query

1. It looks like thus query will return more patients with acne than diabetes ;-)
2.  filter(str(?response = "Diabetes"))  but you really shouldn't use a string for that - the reasons should be in the ontology
3.  put the two sparql query patterns one after another into the same query.
On May 18, 2012 10:01 AM, "ali rahimi" <[hidden email]> wrote:
Hi dear,

1. Would you please let me know why the following query it's not working:

I wan to show "“list of patients between their HbA1c results is between 10 and 20 with their ReasonForVisit”

Prefix : <http://www.semanticweb.org/ontologies/2012/2/Ontology1331511057559.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?reason
    WHERE { ?subject :Age ?HbA1C .
                      ?subject :ReasonForVisit ?reason . FILTER (?hba1c >= 10 && ?hba1c <= 20)
}

2. After above query How can I filter only patients who their ReasonForVisit is "Diabetes". Please show me this SPARQL rule. I mean in the second column list only "Diabetes" for patients who in their
ReasonForVisit registered "Diabetes"

3. How we can combine two SPARQL query with together. e.g.
"list of patients between their HbA1c results is between 10 and 20 with their ReasonForVisit” and "Patients who consume specific DrugName "Diabex" and "Mixtard" "
 
Best Regards
Ali

From: Timothy Redmond <[hidden email]>
To: [hidden email]
Sent: Friday, 11 May 2012 4:07 AM
Subject: Re: [p4-feedback] SPARQL query

On 05/09/2012 01:18 AM, ali rahimi wrote:
Thanks for your help.
But my question is if i want to write a query with several variables may can use DL query tab in protege 4.2. for example: list of patients who use medication "Diabex" and with thier "History" .

This would be nice because the DL query syntax is easier to understand than SPARQL syntax and it has always supported OWL entailment.  Unfortunately we can't currently do this.  The best that I can offer is that there is a SPARQL plugin coming soon that does do OWL entailment.  This gives you the OWL entailment but you are still stuck with the SPARQL syntax.

-Timothy



 
Best Regards
Ali
From: Timothy Redmond [hidden email]
To: [hidden email]
Sent: Tuesday, 8 May 2012 3:30 AM
Subject: Re: [p4-feedback] SPARQL query


There are several SPARQL tutorials on the web.  In order to create the following query I went to [1] which I found by searching google for "sparql less than".  This query does approximately what you want

Prefix : <http://www.semanticweb.org/ontologies/2012/2/Ontology1331511057559.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?reason 
	WHERE { ?subject :Age ?age .
                      ?subject :ReasonForVisit ?reason . FILTER (?age >= 20 && ?age <= 50) 

I know that I can make this better - for some reason I wasn't able to take advantage of the turtle syntax abbrevisions involving the repeated use of ?subject.

-Timothy


[1] http://jena.sourceforge.net/ARQ/Tutorial/optionals.html

On 5/7/12 8:03 AM, ali rahimi wrote:
Dear all,
I have a simple ontology to identify diabetic patients. I also read different tutorials about SPARQL queries on Protégé 4.2 but totally I’m confused. Please show me step by step what I should do for the following simple query in SPARQL tab:
“list of patients between 20 and 50 years old with their ReasonForVisit”
 
Best Regards
Ali


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


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




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


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



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




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

Re: SPARQL query

Timothy Redmond
In reply to this post by ali rahimi
On 5/24/12 11:05 PM, ali rahimi wrote:
Dear all,

1.I revised some literal properties and added more object properties for patients but it did not work on new ontology (attached file). please let me know practically why the following query it's not working:

I wan to show "“list of patients between their HbA1cValue results is between 4 and 9 with their ReasonForVisit”

Prefix : <http://www.semanticweb.org/ontologies/2012/2/Ontology1331511057559.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?reason
    WHERE { ?subject :HbA1C ?HbA1C .
                      ?subject :ReasonForVisit ?reason . FILTER (?hba1c >= 4 && ?hba1c <= 9)
}

This seems to be working.  You get an empty collection because non of the subjects with a :HbA1C value have a ReasonForVisit.  In addition, the ?hba1c variable is never set in the query so the query fails.  If you changed the query to be

Prefix : <http://www.semanticweb.org/ontologies/2012/2/Ontology1331511057559.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?HbA1C
    WHERE { ?subject :HbA1C ?HbA1C .  FILTER(?HbA1C >=4 && ?HbA1C <= 9)
}

then it returns some results.

2. I have done what you mentioned but it did not work on new ontology
(attached file). Please show me practically, after above query How can I filter only patients who their ReasonForVisit is "Diabetes" or "Diabetes Mellitus - Type II". Please let me know this SPARQL query. I mean in the second column list only "Diabetes" for patients who in their ReasonForVisit registered "Diabetes"

I did not see any individuals in your ontology that had a string value of Diabetes.   I changed Patient15 accordingly.  Then I went googling and found the following query:

Prefix : <http://www.semanticweb.org/ontologies/2012/2/Ontology1331511057559.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?HbA1C
    WHERE { ?subject :ReasonForVisit ?name . Filter(?name="Diabetes"^^xsd:string)
}

which seemed to work fine.

-Timothy


Best Regards
Ali

From: Timothy Redmond [hidden email]
To: [hidden email]
Sent: Thursday, 24 May 2012 12:39 AM
Subject: Re: [p4-feedback] SPARQL query


One problem that this ontology has that makes string comparisons fail is that several of the datatypes have Literal datatypes.  Thus for instance Patient9 has a History of "Diabetes"^^Literal.  I am not sure what this actually means, the datatype you want there is either PlainLiteral (which you could represent by simply removing the ^^Literal) or string ("Diabetes"^^string).  You can find these by going to the entities tab, selecting datatypes, clicking on Literal and selecting the "Datatype Usage" tab (upper left).  Also indicating that a datatype property has a range of Literal is vacuous.  Literal is the top datatype.

I would however pay attention to Alan's point that Diabetes should really not be a string but a class or an individual.  As a string, you run the risk of someone (either at query time or at data entry time) will misspell it.  Also, as a string you might miss opportunities to say something interesting about it.

-Timothy



On 05/18/2012 08:42 AM, ali rahimi wrote:
Dear Alan,
Thanks so much but can you show me practically how you do that for Q.3 and Q.2.
 I can not get my answer for Q.1.

Best Regards
Ali

From: Alan Ruttenberg [hidden email]
To: Protege 4 feedback [hidden email]; ali rahimi [hidden email]
Sent: Saturday, 19 May 2012 12:42 AM
Subject: Re: [p4-feedback] SPARQL query

1. It looks like thus query will return more patients with acne than diabetes ;-)
2.  filter(str(?response = "Diabetes"))  but you really shouldn't use a string for that - the reasons should be in the ontology
3.  put the two sparql query patterns one after another into the same query.
On May 18, 2012 10:01 AM, "ali rahimi" <[hidden email]> wrote:
Hi dear,

1. Would you please let me know why the following query it's not working:

I wan to show "“list of patients between their HbA1c results is between 10 and 20 with their ReasonForVisit”

Prefix : <http://www.semanticweb.org/ontologies/2012/2/Ontology1331511057559.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?reason
    WHERE { ?subject :Age ?HbA1C .
                      ?subject :ReasonForVisit ?reason . FILTER (?hba1c >= 10 && ?hba1c <= 20)
}

2. After above query How can I filter only patients who their ReasonForVisit is "Diabetes". Please show me this SPARQL rule. I mean in the second column list only "Diabetes" for patients who in their
ReasonForVisit registered "Diabetes"

3. How we can combine two SPARQL query with together. e.g.
"list of patients between their HbA1c results is between 10 and 20 with their ReasonForVisit” and "Patients who consume specific DrugName "Diabex" and "Mixtard" "
 
Best Regards
Ali

From: Timothy Redmond <[hidden email]>
To: [hidden email]
Sent: Friday, 11 May 2012 4:07 AM
Subject: Re: [p4-feedback] SPARQL query

On 05/09/2012 01:18 AM, ali rahimi wrote:
Thanks for your help.
But my question is if i want to write a query with several variables may can use DL query tab in protege 4.2. for example: list of patients who use medication "Diabex" and with thier "History" .

This would be nice because the DL query syntax is easier to understand than SPARQL syntax and it has always supported OWL entailment.  Unfortunately we can't currently do this.  The best that I can offer is that there is a SPARQL plugin coming soon that does do OWL entailment.  This gives you the OWL entailment but you are still stuck with the SPARQL syntax.

-Timothy



 
Best Regards
Ali
From: Timothy Redmond [hidden email]
To: [hidden email]
Sent: Tuesday, 8 May 2012 3:30 AM
Subject: Re: [p4-feedback] SPARQL query


There are several SPARQL tutorials on the web.  In order to create the following query I went to [1] which I found by searching google for "sparql less than".  This query does approximately what you want

Prefix : <http://www.semanticweb.org/ontologies/2012/2/Ontology1331511057559.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?reason 
	WHERE { ?subject :Age ?age .
                      ?subject :ReasonForVisit ?reason . FILTER (?age >= 20 && ?age <= 50) 

I know that I can make this better - for some reason I wasn't able to take advantage of the turtle syntax abbrevisions involving the repeated use of ?subject.

-Timothy


[1] http://jena.sourceforge.net/ARQ/Tutorial/optionals.html

On 5/7/12 8:03 AM, ali rahimi wrote:
Dear all,
I have a simple ontology to identify diabetic patients. I also read different tutorials about SPARQL queries on Protégé 4.2 but totally I’m confused. Please show me step by step what I should do for the following simple query in SPARQL tab:
“list of patients between 20 and 50 years old with their ReasonForVisit”
 
Best Regards
Ali


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


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




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


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



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





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


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




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


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

DQontology5.owl (144K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SPARQL query

Christian Boelling
In reply to this post by Timothy Redmond
What is the status of the SPARQL plugin mentioned here?

Christian

Timothy Redmond wrote
The best that I can offer is that there is a SPARQL plugin coming soon that does do OWL entailment.  
This gives you the OWL entailment but you are still stuck with the SPARQL syntax.
Reply | Threaded
Open this post in threaded view
|

Re: SPARQL query

Steve Wartik
The SPARQL plugin comes from openrdf software. The Protege team just updated the plugin to use openrdf version 2.6.
________________________________________

What is the status of the SPARQL plugin mentioned here?

Christian


Timothy Redmond wrote
> The best that I can offer is that there is a SPARQL plugin coming soon
> that does do OWL entailment.
> This gives you the OWL entailment but you are still stuck with the SPARQL
> syntax.

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

Re: SPARQL query

Timothy Redmond

> The best that I can offer is that there is a SPARQL plugin coming soon
> that does do OWL entailment.
> This gives you the OWL entailment but you are still stuck with the SPARQL
> syntax.

> What is the status of the SPARQL plugin mentioned here?


My interpretation of this question is that it is a about the SPARQL
plugin that does OWL entailment.  I don't know how this is going but I
will ask.  If so this is different than the plugin described in this reply:

> The SPARQL plugin comes from openrdf software. The Protege team just updated the plugin to use openrdf version 2.6.

This plugin works by mapping an in-memory OWL model to an openrdf
graph.  When changes to the OWL model are made, these changes are then
reflected in the rdf graph.  The SPARQL queries are then played against
the rdf graph.  I don't know if any entailment processing is happening
here but I do know that general OWL entailment is not occurring.

-Timothy



On 11/23/2012 02:52 PM, Wartik, Steven P "Steve" wrote:

> The SPARQL plugin comes from openrdf software. The Protege team just updated the plugin to use openrdf version 2.6.
> ________________________________________
>
> What is the status of the SPARQL plugin mentioned here?
>
> Christian
>
>
> Timothy Redmond wrote
>> The best that I can offer is that there is a SPARQL plugin coming soon
>> that does do OWL entailment.
>> This gives you the OWL entailment but you are still stuck with the SPARQL
>> syntax.
> _______________________________________________
> p4-feedback mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/p4-feedback

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

Re: SPARQL query

Christian Boelling
Let's see if I got this right:

SPARQL support in Protege 4:

(1) SPARQL Query tab (P4.2 onwards)
(2) The plugin mapping in-memory model to openrdf graph using openrdf 2.6
(3) A plugin doing OWL entailment - not yet released
(4) OWL2Query

I understand that (1) and (2) are the same and (3) and (4) are different. Is this correct? Is there other SPARQL support (in development) not listed here?

Christian

Reply | Threaded
Open this post in threaded view
|

Re: SPARQL query

Timothy Redmond

Yes this sounds right.  I am glad that you have listed the OWL2Query
plugin because that might be a useful option and I did not remember the
web link this weekend.

-Timothy


On 11/26/2012 04:01 AM, Christian Boelling wrote:

> Let's see if I got this right:
>
> SPARQL support in Protege 4:
>
> (1) SPARQL Query tab (P4.2 onwards)
> (2) The plugin mapping in-memory model to openrdf graph using openrdf 2.6
> (3) A plugin doing OWL entailment - not yet released
> (4)  OWL2Query <http://krizik.felk.cvut.cz/km/owl2query/index.html>
>
> I understand that (1) and (2) are the same and (3) and (4) are different. Is
> this correct? Is there other SPARQL support (in development) not listed
> here?
>
> Christian
>
>
>
>
>
> --
> View this message in context: http://protege-ontology-editor-knowledge-acquisition-system.136.n4.nabble.com/SPARQL-query-tp4615039p4656695.html
> Sent from the Protege-OWL 4.x Support mailing list archive at Nabble.com.
> _______________________________________________
> p4-feedback mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/p4-feedback

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

Re: SPARQL query

Christian Boelling
Using the SPARQL Query tab, it would be great to be able to view/export the
RDF graph.

Christian


> -----Ursprüngliche Nachricht-----
> Von: Timothy Redmond [mailto:[hidden email]]
> Gesendet: Montag, 26. November 2012 14:57
> An: [hidden email]
> Betreff: Re: [p4-feedback] SPARQL query
>
>
> Yes this sounds right.  I am glad that you have listed the OWL2Query
plugin

> because that might be a useful option and I did not remember the web link
> this weekend.
>
> -Timothy
>
>
> On 11/26/2012 04:01 AM, Christian Boelling wrote:
> > Let's see if I got this right:
> >
> > SPARQL support in Protege 4:
> >
> > (1) SPARQL Query tab (P4.2 onwards)
> > (2) The plugin mapping in-memory model to openrdf graph using openrdf
> > 2.6
> > (3) A plugin doing OWL entailment - not yet released
> > (4)  OWL2Query <http://krizik.felk.cvut.cz/km/owl2query/index.html>
> >
> > I understand that (1) and (2) are the same and (3) and (4) are
> > different. Is this correct? Is there other SPARQL support (in
> > development) not listed here?
> >
> > Christian
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> > http://protege-ontology-editor-knowledge-acquisition-system.136.n4.nab
> > ble.com/SPARQL-query-tp4615039p4656695.html
> > Sent from the Protege-OWL 4.x Support mailing list archive at
Nabble.com.
> > _______________________________________________
> > p4-feedback mailing list
> > [hidden email]
> > https://mailman.stanford.edu/mailman/listinfo/p4-feedback
>


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

Re: SPARQL query

Timothy Redmond
On 11/27/2012 03:56 AM, Christian Bölling wrote:
> Using the SPARQL Query tab, it would be great to be able to view/export the
> RDF graph.

This sounds easy but I don't know exactly what you mean by this.  Do you
mean saving the results of a query as an rdf graph?  When the resulting
graph includes references to incomplete axioms do we pull in the
remainder of the axiom?  (Perhaps this is an option.)

-Timothy

> Christian
>
>
>> -----Ursprüngliche Nachricht-----
>> Von: Timothy Redmond [mailto:[hidden email]]
>> Gesendet: Montag, 26. November 2012 14:57
>> An: [hidden email]
>> Betreff: Re: [p4-feedback] SPARQL query
>>
>>
>> Yes this sounds right.  I am glad that you have listed the OWL2Query
> plugin
>> because that might be a useful option and I did not remember the web link
>> this weekend.
>>
>> -Timothy
>>
>>
>> On 11/26/2012 04:01 AM, Christian Boelling wrote:
>>> Let's see if I got this right:
>>>
>>> SPARQL support in Protege 4:
>>>
>>> (1) SPARQL Query tab (P4.2 onwards)
>>> (2) The plugin mapping in-memory model to openrdf graph using openrdf
>>> 2.6
>>> (3) A plugin doing OWL entailment - not yet released
>>> (4)  OWL2Query <http://krizik.felk.cvut.cz/km/owl2query/index.html>
>>>
>>> I understand that (1) and (2) are the same and (3) and (4) are
>>> different. Is this correct? Is there other SPARQL support (in
>>> development) not listed here?
>>>
>>> Christian
>>>
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://protege-ontology-editor-knowledge-acquisition-system.136.n4.nab
>>> ble.com/SPARQL-query-tp4615039p4656695.html
>>> Sent from the Protege-OWL 4.x Support mailing list archive at
> Nabble.com.
>>> _______________________________________________
>>> p4-feedback mailing list
>>> [hidden email]
>>> https://mailman.stanford.edu/mailman/listinfo/p4-feedback
>
> _______________________________________________
> p4-feedback mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/p4-feedback

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

Re: SPARQL query

Christian Boelling
Timothy Redmond wrote
On 11/27/2012 03:56 AM, Christian Bölling wrote:
> Using the SPARQL Query tab, it would be great to be able to view/export the
> RDF graph.

This sounds easy but I don't know exactly what you mean by this.
 I had in mind a view/export of the openrdf graph that is the mapping of the OWL model and against which the queries are played. However, saving the results of a query as a graph would also be useful.

Timothy Redmond wrote
Do you mean saving the results of a query as an rdf graph?  When the resulting
graph includes references to incomplete axioms do we pull in the
remainder of the axiom?  (Perhaps this is an option.)
What does it mean for an axiom to be incomlete in this context?

-Christian

Reply | Threaded
Open this post in threaded view
|

Re: SPARQL query

Timothy Redmond
On 11/28/12 1:37 AM, Christian Boelling wrote:
> Timothy Redmond wrote
>> On 11/27/2012 03:56 AM, Christian Bölling wrote:
>>> Using the SPARQL Query tab, it would be great to be able to view/export
>>> the
>>> RDF graph.
>> This sounds easy but I don't know exactly what you mean by this.
>   I had in mind a view/export of the openrdf graph that is the mapping of the
> OWL model and against which the queries are played.

This confuses me a bit because ideally this graph should be the same as
what you get when you save the ontology out in some rdf format (rdf/xml,
turtle).  Now in actuality, I do include some extra quad store
information that allows me to easily update the rdf model when the OWL
model changes.  But this is really an implementation detail that should
be hidden from users.  There is also an RDF view that will show the
state of an ontology at any given time in RDF.

> However, saving the
> results of a query as a graph would also be useful.

This part makes sense to me.  I didn't know about construct queries
before but now I see them it does seem like it might be a good idea to
be able to save them as an rdf file.

-Timothy

>
>
> Timothy Redmond wrote
>> Do you mean saving the results of a query as an rdf graph?  When the
>> resulting
>> graph includes references to incomplete axioms do we pull in the
>> remainder of the axiom?  (Perhaps this is an option.)
> What does it mean for an axiom to be incomlete in this context?
>
> -Christian
>
>
>
>
>
> --
> View this message in context: http://protege-ontology-editor-knowledge-acquisition-system.136.n4.nabble.com/SPARQL-query-tp4615039p4656722.html
> Sent from the Protege-OWL 4.x Support mailing list archive at Nabble.com.
> _______________________________________________
> p4-feedback mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/p4-feedback

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