Not able to query specific entities in my ontology

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

Not able to query specific entities in my ontology

Ahmed Mabrouk
Hi,
I declared the IRI of my ontology in the PREFIX section of SPARQL query as:
PREFIX legal: <http://www.example.com/ontologies/myontology/1.0>
  • to get the list of instances of the class AA, for example, I run the following:
SELECT ?t WHERE {?t rdf:type legal:AA}
  • to get the names of the sub-classes of CC, I run:
SELECT ?t WHERE {?t rdfs:subClassOf legal:CC}
In the two above cases, I get empty table, even though the subclasses and the instances are shown in the class hierarchy and the individuals tabs.
Any guess, why is that?
Thanks in advance and regards,

Ahmed Mabrouk

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

Re: Not able to query specific entities in my ontology

Matthew Horridge-2
Administrator
Hi Ahmed,

Which SPARQL plugin are you using - there are two that I know of.  If you’re using SNAP then you need to make sure reasoning is turned on.  If you still get empty results then it may be that your prefixes are not set up correctly - do the entities mentioned in the ontology have the same prefix as the ontology IRI?

Cheers,

Matthew



On 30 Aug 2017, at 07:56, Ahmed Mabrouk <[hidden email]> wrote:

Hi,
I declared the IRI of my ontology in the PREFIX section of SPARQL query as:
  • to get the list of instances of the class AA, for example, I run the following:
SELECT ?t WHERE {?t rdf:type legal:AA}
  • to get the names of the sub-classes of CC, I run:
SELECT ?t WHERE {?t rdfs:subClassOf legal:CC}
In the two above cases, I get empty table, even though the subclasses and the instances are shown in the class hierarchy and the individuals tabs.
Any guess, why is that?
Thanks in advance and regards,

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


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

Re: Not able to query specific entities in my ontology

Ahmed Mabrouk
It finally worked. Thanks a lot Matthew. When I selected an entity it showed a URL different from the one I declared in the IRI header.
When I declared that one in the PREFIX, it worked.
Regards,
Ahmed



From: Matthew Horridge <[hidden email]>
To: Ahmed Mabrouk <[hidden email]>; Developer support for WebProtege and Protege Desktop <[hidden email]>
Sent: Thursday, August 31, 2017 4:47 AM
Subject: Re: [protege-dev] Not able to query specific entities in my ontology

Hi Ahmed,

Which SPARQL plugin are you using - there are two that I know of.  If you’re using SNAP then you need to make sure reasoning is turned on.  If you still get empty results then it may be that your prefixes are not set up correctly - do the entities mentioned in the ontology have the same prefix as the ontology IRI?

Cheers,

Matthew



On 30 Aug 2017, at 07:56, Ahmed Mabrouk <[hidden email]> wrote:

Hi,
I declared the IRI of my ontology in the PREFIX section of SPARQL query as:
  • to get the list of instances of the class AA, for example, I run the following:
SELECT ?t WHERE {?t rdf:type legal:AA}
  • to get the names of the sub-classes of CC, I run:
SELECT ?t WHERE {?t rdfs:subClassOf legal:CC}
In the two above cases, I get empty table, even though the subclasses and the instances are shown in the class hierarchy and the individuals tabs.
Any guess, why is that?
Thanks in advance and regards,

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




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

Re: Not able to query specific entities in my ontology

Lorenz Buehmann
In reply to this post by Ahmed Mabrouk



On 30.08.2017 16:56, Ahmed Mabrouk wrote:
Hi,
I declared the IRI of my ontology in the PREFIX section of SPARQL query as:
That prefix declaration looks strange since the namespace is missing a / or # at the end

legal:CC would resolve to

http://www.example.com/ontologies/myontology/1.0CC

and I don't think that this is what you want.
  • to get the list of instances of the class AA, for example, I run the following:
SELECT ?t WHERE {?t rdf:type legal:AA}
  • to get the names of the sub-classes of CC, I run:
SELECT ?t WHERE {?t rdfs:subClassOf legal:CC}
In the two above cases, I get empty table, even though the subclasses and the instances are shown in the class hierarchy and the individuals tabs.
Any guess, why is that?
Thanks in advance and regards,

Ahmed Mabrouk


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


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