Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,207,781 members, 8,000,278 topics. Date: Tuesday, 12 November 2024 at 07:19 AM

Urgent Help On Sparql Query Ontology - Programming (2) - Nairaland

Nairaland Forum / Science/Technology / Programming / Urgent Help On Sparql Query Ontology (2826 Views)

His Mysql Query Returned Duplicate Output. Help Him / Php/mysql Help:how To Run Sql Query From A Link / Help Needed With Mysql/php Date Query (2) (3) (4)

(1) (2) (Reply) (Go Down)

Re: Urgent Help On Sparql Query Ontology by Kobojunkie: 7:40pm On Jun 18, 2012
mj:
Result Link:
www.oceandriveng.com/query.jpg

Oh, i see what I was doing wrong. I omitted some lines at the top.

Now, that you have Synonyms working, what do you want to accomplish with this new line of queries?
Re: Urgent Help On Sparql Query Ontology by mj(m): 7:53pm On Jun 18, 2012
Kobojunkie:

Oh, i see what I was doing wrong. I omitted some lines at the top.

Now, that you have Synonyms working, what do you want to accomplish with this new line of queries?
how can i link the synonyms with the patients that have that disease.
Re: Urgent Help On Sparql Query Ontology by Kobojunkie: 8:04pm On Jun 18, 2012
mj:
how can i link the synonyms with the patients that have that disease.

How is Synonym currently defined?
Re: Urgent Help On Sparql Query Ontology by jaybee3(m): 8:07pm On Jun 18, 2012
Select *
from Table
Where column like (%constraint1%, %constraint2%,.....)
Re: Urgent Help On Sparql Query Ontology by mj(m): 8:12pm On Jun 18, 2012
Re: Urgent Help On Sparql Query Ontology by mj(m): 8:15pm On Jun 18, 2012
mj: Heres is the Link:
http://www.oceandriveng.com/ontology.jpg
what I did is to create an Object Property called Synonym, and add it to the object Property of each Disease and added the individual synonym to it.Maybe I need to modify my ontology to make this work, i dont know really, thanks Kobojunkie for the help you'v rendered on this, I really do appreciate, Thanks once again.
Re: Urgent Help On Sparql Query Ontology by mj(m): 8:19pm On Jun 18, 2012
jay bee: Select *
from Table
Where column like (%constraint1%, %constraint2%,.....)
im not clear with your query...read the entire post first so you know where we are.
Re: Urgent Help On Sparql Query Ontology by Kobojunkie: 8:47pm On Jun 18, 2012
Again, I am also brand spanking new to RDF Protege, and using the Object property there. I have been able to install and open the URI in Protege, and able to view the information you are referring to. From my understanding so far, when I click the "DATA PROPERTIES" tab at the top, I am directly accessing TopDataProperty information on the data that specifies some sort of relationship exists between all the listed properties, right?

I am also working under the assumption that somehow Object properties feed off of this toplevel data? YES OR NO?

If yes, please explain how? Cause in order to help I need to understand what exactly these Object Properties are in relation to other data(I am not asking you how you specified it but how Protege links them). If you find some sort of definition of this information, please forward it so I quickly catch up on that, if I can.
Re: Urgent Help On Sparql Query Ontology by mj(m): 9:03pm On Jun 18, 2012
on the "DATA PROPERTIES" the listed properties does not specify the have relationships, CLICK on the Individuals Tab, you will see Disease and Patients Class, you can specify relationship on the individuals using the Object property Assertions on the right side.
look at this:
http://protege-ontology-editor-knowledge-acquisition-system.136.n4.nabble.com/adding-Synonyms-in-Protege-tc4152437.html
Re: Urgent Help On Sparql Query Ontology by mj(m): 11:36pm On Jun 18, 2012
ive tried but to know success, but I'll keep trying.
Re: Urgent Help On Sparql Query Ontology by Kobojunkie: 12:04am On Jun 19, 2012
Will try to see if I can figure it out when I am sure I even understand the half of this data property and stuff. This thing reminds me so much of Visual works IDE(before I figured it out). . . lol
Re: Urgent Help On Sparql Query Ontology by mj(m): 12:38am On Jun 19, 2012
This is the mail i got but the code is not working, he said he has not tested it though.

@prefix diag: <http://www.oceandriveng.com/Diagnosis#>

select distinct ?patient ?disease {
?patient diag:Disease ?disease.
?disease diag:DiseaseName ?name1.
OPTIONAL {
?disease diag:Synonyms ?diseaseSynonym.
?diseaseSynonym diag:DiseaseName ?name2.
}
FILTER (regex( "brain tumour", ?name1 ) ||
(bound( ?name2 ) && regex( "brain tumour", ?name2 ))
)
}

So, roughly 'the ?patient has a ?disease, and either that disease has
a ?name1 which matches "brain tumour", OR that disease has a synonym
and that synonym has a ?name2 which matches "brain tumour" '
Re: Urgent Help On Sparql Query Ontology by Kobojunkie: 1:53am On Jun 19, 2012
^^^ Have you tested it?
Re: Urgent Help On Sparql Query Ontology by mj(m): 2:03am On Jun 19, 2012
Kobojunkie: ^^^ Have you tested it?
Yes I have but its not working, ive been debugging it but to know success.
Re: Urgent Help On Sparql Query Ontology by Kobojunkie: 3:13am On Jun 19, 2012
this is the cleaned up version of the code that runs(no records returned).

PREFIX diag: <http://www.oceandriveng.com/Diagnosis#>

SELECT DISTINCT ?patient ?disease
{
?patient diag:Disease ?disease.
?disease diag:DiseaseName ?name1.
OPTIONAL {
?disease diag:Synonyms ?diseaseSynonym.
?diseaseSynonym diag:DiseaseName ?name2.
}.
FILTER (
regex(?name1, "brain_tumor", "i" )
||
(bound(?name2)
&&
regex(?name2, "brain_tumor", "i" ))
)
}

I think I can read it, but can you read it and tell me if the relationships he created in there makes sense to you.
Re: Urgent Help On Sparql Query Ontology by mj(m): 3:20am On Jun 19, 2012
Kobojunkie: this is the cleaned up version of the code that runs(no records returned).



I think I can read it, but can you read it and tell me if the relationships he created in there makes sense to you.

So, roughly 'the ?patient has a ?disease, and either that disease has
a ?name1 (brain_tumor) which matches "brain tumour", OR that disease has a synonym( brain neoplasm)
and that synonym has a ?name2 which matches "brain tumour". this is how he explained it, yeah is making sense, but no results.
Re: Urgent Help On Sparql Query Ontology by mj(m): 9:39am On Jun 19, 2012
This is the working code, thanks so much, I will reach u back later, ur name must be in my project and publication of ontology.

PREFIX diag: http://www.oceandriveng.com/Diagnosis#
select distinct ?patient ?disease
{
?patient diag:Disease ?disease.
?disease diag:DiseaseName ?name1.
OPTIONAL {
?disease diag:Synonyms ?diseaseSynonym.
?diseaseSynonym diag:DiseaseName ?name2.
}
FILTER (regex( ?name1, "brain tumor", "i"wink||
(bound( ?name2 ) && regex( ?name2, "brain tumor", "i"wink))
}
Re: Urgent Help On Sparql Query Ontology by Kobojunkie: 2:35pm On Jun 19, 2012
I had never heard of SPARQL before this but after this exercise, I too go claim say I be good Spa-co-lo(SPARQL) programmer. ROFLMAO!! grin grin grin grin grin
Re: Urgent Help On Sparql Query Ontology by mj(m): 4:30pm On Jun 19, 2012
Follow me on twitter, I will follow back @OshadamiMJ.
Re: Urgent Help On Sparql Query Ontology by Kobojunkie: 7:31pm On Jun 19, 2012
unfortunately I don't do twitter, or facebook, or all the other social things out there. grin
Re: Urgent Help On Sparql Query Ontology by mj(m): 9:44pm On Jul 05, 2012
Need help on this again, my supervisor doesn't want the datatypes resource of the patient name to show, she wants only there name to show.thanks.

(1) (2) (Reply)

Challenges Finding A Technical Co-founder In Nigeria / Little drops of Python from a Flask: Learn Web Programming with Python / I Changed My Life With One Book.

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 25
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.