/*********************************************************************/ /* */ /* AgentService Framework */ /* www.agentservice.it */ /* */ /* Copyright (C) 2007 l.i.d.o. - DIST, University of Genoa, Italy */ /* GNU Lesser General Public License */ /* */ /* This library is free software; you can redistribute it and/or */ /* modify it under the terms of the GNU Lesser General Public */ /* License as published by the Free Software Foundation, */ /* version 2.1 of the License. */ /* */ /* This library is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ /* Lesser General Public License for more details. */ /* */ /* You should have received a copy of the GNU Lesser General Public */ /* License along with this library; if not, write to the */ /* Free Software Foundation, Inc., 59 Temple Place - Suite 330, */ /* Boston, MA 02111-1307, USA. */ /* */ /*********************************************************************/ using AgentService.Ontology; using AgentService.Ontology.Schema.Abstract; namespace AgentService.Ontology.Schema { /// /// This class represents the schema of a generic term in an ontology. /// public class TermSchema : ObjectSchemaImpl { public static readonly new string base_name = "Term"; private static new TermSchema baseSchema = new TermSchema(); /// /// Constructs a generic term. /// private TermSchema():base(base_name) { } /// /// Constructs a termn with a given name. /// /// The name of the term protected TermSchema(string typeName):base(typeName) { } /// /// Retrieves a generic base schema for all term. /// /// public static new ObjectSchema GetBaseSchema() { return baseSchema; } /// /// Returns true if ///- s is the base schema for the XXXSchema class and this schema is /// an instance of (e.g. s is ConceptSchema.GetBaseSchema() and this /// schema is an instance of ConceptSchema) /// - s is the base schema for a super-class of the XXXSchema class and /// this schema is an instance of (e.g. s is TermSchema.GetBaseSchema() /// and this schema is an instance of ConceptSchema. /// /// Object schema /// Returns true if s is a base schema for this schema. public override bool DescendsFrom(ObjectSchema s) { try { if (s != null) { if (s.Equals(GetBaseSchema())) { return true; } return base.DescendsFrom(s); } else { return false; } } catch(OntologyException ex) { throw(ex); } } /// /// Returns an abstract object that represents this term. /// /// public override AbsObject NewInstance() { return null; } } }