Query across several relationships?

Post Reply
wgoebl
Posts: 20
Joined: 09 Dec 2011, 11:08

Hi,

in Protege's Query Tab it is possible to query for entities by its attributes or relationships to other instances. I can query for example for all application providers that are used to implement a certain application service. The functionality i would need is to compose queries accross several relationshios eg. "Return all application providers that are used to implement
application services that realize application capability XY"

How can I implement this?
Thanks
Wolfgang
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

This kind of query is exactly the reason that we built the Essential Viewer and there are out of the box Views that provide this query.

However, using the Query Tab can be very useful when assembling your own Views.

In the query tab, it is possible to include the results of a query as part of the predicate of another query.

Using your example, you define a simple query that selects all Application Services that implement a specific Application Capability. Using the panel at the bottom of the page, you can save the results of this query and give it a name.

Having saved this we can then construct a new query that selects all Application Providers that provide the Application Services that we were returned in the last query. We simply select the "provides_application_service" slot in the query builder, use the "equals" drop down and then using the orange button, select the last query (Application Services implementing Capability X) results.

Clicking Find then shows the desired results.

Jonathan
Essential Project Team
ijames
Posts: 5
Joined: 30 May 2013, 13:40

Hi Jonathan

A similar question please - is there a way in query to search over multiple classes as Wolfgang was asking, but to then export slots from these multiple classes?

What I am trying to do is:

show applications [application_provider] with ...
- a contract and it's cost [contract_cost] using [contract_for] to link to the application
- a strategic plan [strategic_plan_valid_from] and [..._to} with the application held in [strategic_plan_for_elements]

I have a feeling I may be over-complicating this!

Thanks
Ian
User avatar
neil.walsh
Posts: 444
Joined: 16 Feb 2009, 13:45
Contact:

Hi Ian,

The way Jonathan described will almost certainly work the same way though you may have more steps to go through.

Maybe a better way to think about this is to articulate what business question(s) you're trying to answer as sometimes this can trigger ideas for different approaches.

Whilst the query tab can be powerful it does get complicated once you start nesting the queries. We often find creating a simple view for Essential Viewer is a better way to go especially if you're planning to revisit the question

Or sometimes (if the volume of content isn't too high) just navigating the repository can provide the answers you need.
Post Reply