// Конструктор /// <summary> /// Initializes a new instance of the <see cref="SNode"/> class. /// </summary> /// <param name="x"> /// The x. /// </param> /// <param name="resource"> /// The resource. /// </param> /// <param name="rDataModel"> /// The r data model. /// </param> internal protected SNode(XElement x, SResource resource, SDataModel rDataModel) { _rDataModel = rDataModel; _resource = resource; _id = Coding(x.Attribute(SNames.rdfabout).Value); // RDFType = x.Name; //notFull = true; // _directProperties = new List<SProperty>(); if (_rDataModel == null) { return; } Definition = _rDataModel is SOntologyModel ? new ROntologyClassDefinition( new XElement("Class", new XAttribute(SNames.rdfabout, x.Name)), null, null) : _rDataModel.OntologyModel.GetOntologyNode <ROntologyClassDefinition>(x.Name.ToString()) ?? _rDataModel.OntologyModel.InsertNew <ROntologyClassDefinition>(x.Name, null, null, false); // if (!(_rDataModel is SOntologyModel)) Definition.AddInstance(this); foreach (var prop in x.Elements()) { if (prop.Attribute(SNames.rdfresource) == null) { _directProperties.Add(new SDataLink(prop, this)); } else { _directProperties.Add(new SObjectLink(prop, this)); } } }
internal ROntologyDatatypePropertyDefinition(XElement x, SResource resource, SDataModel rDataModel) : base(x, resource, rDataModel) { }
/// <summary> /// Initializes a new instance of the <see cref="ROntologyClassDefinition"/> class. /// </summary> /// <param name="x"> /// The x. /// </param> /// <param name="resource"> /// The resource. /// </param> /// <param name="rDataModel"> /// The r data model. /// </param> internal ROntologyClassDefinition(XElement x, SResource resource, SDataModel rDataModel) : base(x, resource, rDataModel) { }
internal ROntologyDef(XElement x, SResource resource, SDataModel rDataModel) : base(x, resource, rDataModel) { XSource = x; RDFType = x.Name; }