Ontologie
Visualisatie middels Force Feedback Graphs
Code voorbeeld met Triple store
Onderstaande code genereert een triple store met nodes, welke predicaten bevatten waaronder:
- Registered At
- Parent Of
- Married To
In de store worden personen en instanties zoals BRP opgeslagen. De predicaten zijn voorzien van temporale aspecten (ActualDateTime) vanuit de Discrete Event Simulatie. Door de simulatie af spelen ontstaat er over tijd zo bijvoorbeeld een gezinssituatie.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | using Newtonsoft.Json; using System; using System.Collections.Generic; using VirtualSociety.Ontology.Model; using VirtualSociety.Ontology.Model.Predicate; using VirtualSociety.Ontology.Model.Registrations; using Xunit; namespace VirtualSociety.Ontology.Tests { public class TripleTests { [Fact] public void Timeline() { /* CONSIDER THE FOLLOWING TIME LINE * -------------------------------- * * The Bureau of BRP registers people (it exsits since 50 years) * The mother of a child is born (and registered) at BRP 32 years ago. * The father of that same child is born (and registered) at the BRP 30 years ago. * They've known each other for 15 years and got married 8 years ago. * The registration of marriage is also registered at the BRP. * 3 years after mariage, a child gets born, and is also registered at the BRP. * */ var Brp = new Brp(DateTime.Now.AddYears(-50)); var mother = new Person(DateTime.Now.AddYears(-32)); var father = new Person(DateTime.Now.AddYears(-30)); var child = new Person(DateTime.Now.AddYears(-5)); var married = new MarriedTo(DateTime.Now.AddYears(-8)); // Create an ordered time line, for graph visualization. var timeline = new List < object > () { Brp, mother, father, new Triple < Person, Brp > (mother, new RegisteredAt(DateTime.Now.AddYears(-32)), Brp), new Triple < Person, Brp > (father, new RegisteredAt(DateTime.Now.AddYears(-30)), Brp), // Notice that predicates can also be nodes (used for grouping two subjects) new Triple < MarriedTo, Brp > (married, new RegisteredAt(DateTime.Now.AddYears(-8)), Brp), child, new Triple < Person, Brp > (child, new RegisteredAt(DateTime.Now.AddYears(-5)), Brp), new Triple < Person, Person > (mother, new ParentOf(DateTime.Now.AddYears(-5)), child), new Triple < Person, Person > (father, new ParentOf(DateTime.Now.AddYears(-5)), child), }; /// The RAW datafile. var json = JsonConvert.SerializeObject(timeline, Formatting.Indented); } } } |