Ejemplo n.º 1
0
 public SubclassRelationship(IClassEntity descendant, IClassEntity parent)
     : base(2)
 {
     base.Entities[0] = descendant;
     base.Entities[1] = parent;
     base.GenerateIdentity();
 }
 public PropertyRelationship(IPropertyEntity propertyEntity, IClassEntity classEntity)
     : base(2)
 {
     base.Entities[0] = propertyEntity;
     base.Entities[1] = classEntity;
     base.GenerateIdentity();
 }
		public ConditionalRuleRelationship(IClassEntity classEntity, IPropertyEntity ifProperty, IPropertyEntity thenProperty)
			: base(3)
		{
			base.Entities[0] = classEntity;
			base.Entities[1] = ifProperty;
			base.Entities[2] = thenProperty;
			base.GenerateIdentity();
		}
Ejemplo n.º 4
0
 public ClassToClassRelationship(string value, IClassEntity left, IClassEntity right, RelationshipKind kind)
     : base(2)
 {
     base.Value       = value;
     base.Entities[0] = left;
     base.Entities[1] = right;
     base.Kind        = kind;
     base.GenerateIdentity();
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Returns all properties from graph related with classEntity by PropertyRelationship.
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public IEntitySet <IPropertyEntity> GetProperties(IClassEntity entity)
        {
            IEntitySet <IPropertyEntity> temp = new EntitySet <IPropertyEntity>();

            foreach (PropertyRelationship pr in PropertyRelationships.GetItems())
            {
                if (pr.Class.Identity == entity.Identity)
                {
                    temp.Add(pr.Property);
                }
            }
            return(temp);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Returns all parent classes of class entity from graph.
        /// </summary>
        /// <param name="entity"></param>
        /// <returns>All parent classes.</returns>
        public IEntitySet <IClassEntity> GetParents(IClassEntity entity)
        {
            IEntitySet <IClassEntity> temp = new EntitySet <IClassEntity>();

            foreach (SubclassRelationship sr in SubclassRelationships.GetItems())
            {
                if (sr.Descendant.Identity == entity.Identity)
                {
                    temp.Add(sr.Parent);
                }
            }
            return(temp);
        }
 protected void Print(IClassEntity classEntity)
 {
     SW.WriteLine(classEntity.Identity);
     SW.WriteLine("{");
     foreach (IClassEntity parent in Graph.GetParents(classEntity).GetItems())
     {
         SW.WriteLine("\tis_subconcept_of {0};", parent.Identity);
     }
     foreach (IPropertyEntity property in Graph.GetProperties(classEntity).GetItems())
     {
         SW.WriteLine("\t{0};", property.Identity);
     }
     SW.WriteLine("}");
 }
Ejemplo n.º 8
0
//		public bool IsTrue = false;

        public ClassPropertyCondition(IClassEntity classEntity, IPropertyEntity propertyEntity)
        {
            ClassEntity    = classEntity;
            PropertyEntity = propertyEntity;
        }
Ejemplo n.º 9
0
 public void Add(IClassEntity classEntity)
 {
     Graph.Add(classEntity);
 }
Ejemplo n.º 10
0
//		public ClassPropertyCondition ElseCondition;

        public ConditionalRule(IClassEntity classEntity, IPropertyEntity ifProperty, IPropertyEntity thenProperty)
        {
            IfCondition   = new ClassPropertyCondition(classEntity, ifProperty);
            ThenCondition = new ClassPropertyCondition(classEntity, thenProperty);
        }
Ejemplo n.º 11
0
 /// <summary>
 /// Adds IClassEntity to the graph.
 /// </summary>
 /// <param name="classEntity"></param>
 public void Add(IClassEntity classEntity)
 {
     Classes.Add(classEntity);
 }
Ejemplo n.º 12
0
 protected string PrintEntity(IClassEntity classEntity)
 {
     return(@"<owl:Class rdf:ID=""" + classEntity.Identity.Replace(' ', '_') + @"""/>");
 }