5.1.2 concOfCG

Introduction

The concOfCG/2 goal is used to identify concepts of CGs.

Signature

concOfCG(C,G)

Operation

It checks if the concept C is a concept of the CG G. This is done using matching. Thus you can also use a variable in place of C and get a list of all of the concepts in G.

Example

For example, consider the following query:

?- concOfCG(C, [Animal]<-AGNT-[Act: Say]).

It yields the following answers:

{C = [Animal]}
{C = [Act : Say]}

Explanation

This query looks for concepts (through the variable C) in the small graph "[Animal]<-AGNT-[Act: Say]".

The answer we get back corresponds to the two concepts in the graph.

Example 2

On the other hand, consider the following program:

// Type hierarchy
Entity > Act, Animal.

// Catalog of instances
Act = Say.

// Fact
cg([Animal]<-AGNT-[Act: Say]).

// Rule
cg_has_concept(C) :- cg(G), concOfCG(C,G).

Explanation

We have a very small type-hierarchy and a very small catalog of instances.

Then we have a fact called "cg" which specifies a CG.

Lastly, we have a rule which has two subgoals.

The first subgoal, "cg(G)", binds the value of the CG in the "cg" fact to the variable G.

The second subgoal, "concOfCG(C,G)", checks whether the concept in the varaible C is a concept in the CG in the variable G. Because we have just bound the variable G to the CG from the "cg" fact, this will check whether C is a concept in this CG.

Usage

If we now ask the query:

?- cg_has_concept([Animal]).

We get the following answer:

{}

This means yes.

Summary

Thus concOfCG/2 is used for finding out whether a specific concept is a concept in a graph.


PrevLite: 5.1.1 branchOfCG
NextLite: 5.1.3 subsume

Prev: 5.1.1 branchOfCG
Up: 5.1 CG goals
Next: 5.1.3 subsume