Domain Range retriction and Sparql querry

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

Domain Range retriction and Sparql querry

Deepjyoti
In an ontology I have two classes, "Dress" and "Ornaments". One object
property associatedGender connects them to a class "Gender".
I have modeled the domain for associatedGender is union of Dress and
Ornaments; the range for associatedGender is Gender.

I have loaded the ontology to a Apache Jena Fuseki server to run queries.
When I run a query to find out Ornaments and their associatedGender, in the
result I also get Individuals from the class Dress.

Is it because I have et the domain for the property associatedGender as
union of Dress and Ornaments I am getting such result?

What should be the better option to connect the associatedGender property
with Dress and Ornaments class so that the query results do not overlap.



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Domain Range retriction and Sparql querry

Biswanath Dutta


Hi Deepjyoti, 
     Would you mind to post the SPARQL query here? 

Bests,
Biswanath 




On Mon 11 Nov, 2019, 6:33 PM Deepjyoti, <[hidden email]> wrote:
In an ontology I have two classes, "Dress" and "Ornaments". One object
property associatedGender connects them to a class "Gender".
I have modeled the domain for associatedGender is union of Dress and
Ornaments; the range for associatedGender is Gender.

I have loaded the ontology to a Apache Jena Fuseki server to run queries.
When I run a query to find out Ornaments and their associatedGender, in the
result I also get Individuals from the class Dress.

Is it because I have et the domain for the property associatedGender as
union of Dress and Ornaments I am getting such result?

What should be the better option to connect the associatedGender property
with Dress and Ornaments class so that the query results do not overlap.



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
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: Domain Range retriction and Sparql querry

Deepjyoti
Dr Biswanath Dutta sir, here is a sample query,

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix owl: <http://www.w3.org/2002/07/owl#>
prefix otd: <http://www.semanticweb.org/deep/ontologies/2018/4/otd#>

SELECT   ?Ornaments ?Gender
WHERE {
  ?Ornaments otd:associatedGender ?Gender. }



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Domain Range retriction and Sparql querry

Biswanath Dutta


Dear Deepjyoti, 
So, the problem is with the query it seems. 
I tried to reproduce the result. 

Try with the following Query [replace ?x, ?y with the variables you wish to. BUT make sure you have the same class the one is written in the first line  i.e., "?x a :Ornament" of the following query.]: 

SELECT ?x ?y
WHERE { ?x a :Ornament .
                             ?x :associatedGender ?y .


Hope this will solve your problem. 

Bests,
Biswanath 




On Mon, Nov 11, 2019 at 7:12 AM Deepjyoti <[hidden email]> wrote:
Dr Biswanath Dutta sir, here is a sample query,

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix owl: <http://www.w3.org/2002/07/owl#>
prefix otd: <http://www.semanticweb.org/deep/ontologies/2018/4/otd#>

SELECT   ?Ornaments ?Gender
WHERE {
  ?Ornaments otd:associatedGender ?Gender. }



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
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: Domain Range retriction and Sparql querry

Deepjyoti
Thanks Dr Biswanath Dutta Sir,
It worked.



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user