[Pellet-users] Add subclass?

Michael Smith msmith at clarkparsia.com
Mon May 21 12:38:09 UTC 2007


On Mon, 2007-05-21 at 13:03 +0200, jenny wrote:

> I have created a new class and added it to the knowledge base:
> ATermAppl c = ATermUtils.makeTermAppl( "c" );
> reasoner.getKB().addClass(c);

> How do I make this new class "c" a subclass of a class that already is in 
> the knowledge base?
> Can I somehow get classes in ATermAppl so I can use: 
> "addSubClass(aterm.ATermAppl sub, aterm.ATermAppl sup)"?

reasoner.getKB().getClasses() returns named classes as a Set of
ATermAppl objects.

Alternatively, if you know the name of the class, you can just "create"
it like you create "c" above.  If it already exists in the kb, it will
be reused (i.e., you don't need to worry about creating a second class
with the same name).

-- 
Mike Smith

Clark & Parsia



More information about the Pellet-users mailing list