Algernon Tutorial 2.e
Creating classes and instances
previous next
These exercises and examples use the newspaper project included
in the examples folder of your Protege installation.
Macros for creating classes and instances
- :ADD-CLASS
- :ADD-INSTANCE
- :ADD-RELATION
- :ADD-FACET (doesn't work with Protege yet).
ADD-CLASS
Adds a new subclass. Must specify the parent class.
Remember to specify a name. You can specify any number
of relations in the :ADD-CLASS macro. However, any
variables created in the clauses will not be visible
outside the scope of the :ADD-CLASS clause.
((:ADD-CLASS (?x Author) (:NAME ?x "Novelist")))
ADD-INSTANCE
Adds a new instance. Must specify the class.
Remember to specify a name. You can specify any number
of relations in the :ADD-INSTANCE macro. However, any
variables created in the clauses will not be visible
outside the scope of the :ADD-INSTANCE clause.
((:ADD-INSTANCE (?x Editor) (:NAME ?x "Asimov")))
((sections Asimov instance_00047))
:ADD-RELATION
Adds a new slot in Protege.
((:ADD-RELATION Enemy (Reporter Editor)))
((:instance Reporter ?r) (Enemy ?r Asimov))
- Look at the Reporters to see who their enemies are.
Related links
previous next
Author: Micheal Hewett
Email: mhewett@users.sf.net
Last Updated: Monday, June 06, 2005