public relation(List<KeyValuePair<string,string>> relationsWithLabels) { entities = new List<entity>(); foreach (KeyValuePair<string,string> s in relationsWithLabels) { entities.Add(new entity( s.Key , s.Value, null)); } for (int i = 0; i < relationsWithLabels.Count ; i++) { if (i < entities.Count - 1) this.entities[i].next = this.entities[i + 1]; } source = entities[0]; destination = entities[entities.Count - 1]; }
public relation(List<string> relations) { entities = new List<entity>(); foreach (string s in relations) { entities.Add(new entity(s,null,null)); } for (int i = 0; i < relations.Count; i++) { if(i < entities.Count-1 ) this.entities[i].next = this.entities[i+1]; } source = entities[0]; destination = entities[entities.Count - 1]; }
public entity(string uri, string label, entity next) { this.uri = uri; this.label = label; this.next = next; }
public relation() { this.source = new entity(); this.destination = new entity(); this.entities = new List<entity>(); }
public entity() { next = new entity(); }