protected override IEnumerable <BOTripple> GetCustomTripples()
        {
            List <BOTripple> results = new List <BOTripple>();

            if (GraphicPoint != null)
            {
                results.AddRange(GraphicPoint.GetAsTripples(this.AsNode));
            }
            if (NormalPath != null)
            {
                BONode    startNodeObject  = NormalPath.Track1.AsNode;
                BOTripple startNodeTripple = new BOTripple(this.AsNode, new BONode(LDLUris.StartArcProperty), startNodeObject);
                results.Add(startNodeTripple);
            }

            BONode    normalEndNode        = this.NormalPath.Track2.AsNode;
            BOTripple normalEndNodeTripple = new BOTripple(this.AsNode, new BONode(LDLUris.EndArcProperty), normalEndNode);

            results.Add(normalEndNodeTripple);
            BONode    alternativeEndNode = this.ReversePath.Track2.AsNode;
            BOTripple altEndNodeTripple  = new BOTripple(this.AsNode, new BONode(LDLUris.EndArcProperty), alternativeEndNode);

            results.Add(altEndNodeTripple);
            return(results);
        }
Beispiel #2
0
        protected override IEnumerable <BOTripple> GetCustomTripples()
        {
            List <BOTripple> customTripples = new List <BOTripple>();
            Uri    routeListUri             = new Uri(this.ObjectUri.OriginalString + "_route");
            BONode RouteListNode            = new BONode(routeListUri);

            customTripples.Add(new BOTripple(RouteListNode, LDLUris.RDFTypeNode, new BONode(LDLUris.RouteList)));
            foreach (LDLDirectedSection dsection in Sections)
            {
                customTripples.AddRange(dsection.GetAsTripples());
                customTripples.Add(new BOTripple(RouteListNode, new BONode(LDLUris.COItemProperty), dsection.AsNode));
            }
            if (this.Interlocking != null)
            {
                customTripples.Add(new BOTripple(this.AsNode, new BONode(LDLUris.InterlockingProperty), this.Interlocking.AsNode));
            }
            if (this.Entrance != null)
            {
                customTripples.Add(new BOTripple(this.AsNode, new BONode(LDLUris.RouteEntranceProperty), this.Entrance.AsNode));
            }
            if (this.Exit != null)
            {
                customTripples.Add(new BOTripple(this.AsNode, new BONode(LDLUris.RouteExitProperty), this.Exit.AsNode));
            }


            return(customTripples);
        }
Beispiel #3
0
        public IEnumerable <BOTripple> GetTripples(string locationFor, BONode locatedItem)
        {
            Guid             id           = Guid.NewGuid();
            string           guidStr      = Uri.EscapeUriString(id.ToString());
            List <BOTripple> tripples     = new List <BOTripple>();
            string           locationStr  = LDLUris.GeodesicLocationStr + "_" + guidStr;
            BONode           LocationNode = new BONode(new Uri(locationStr));

            tripples.Add(BOTripple.CreateTrippleFromValues(LocationNode, LDLUris.RDFType, LDLUris.FeatureTypeUri));
            tripples.Add(BOTripple.CreateTrippleFromValues(LocationNode, LDLUris.LatitudeProperty, Point.Latitude));
            tripples.Add(BOTripple.CreateTrippleFromValues(LocationNode, LDLUris.LongditudeProperty, Point.Longitude));
            tripples.Add(new BOTripple(LocationNode, new BONode(LDLUris.LocatedOnProperty), locatedItem));
            string geometryStr  = locationStr + "/geo";
            BONode geometryNode = new BONode(new Uri(geometryStr));

            tripples.Add(BOTripple.CreateTrippleFromValues(geometryNode, LDLUris.RDFType, LDLUris.GeometryUri));
            tripples.Add(BOTripple.CreateTrippleFromValues(geometryNode, LDLUris.WKTPointUri, Point));
            tripples.Add(new BOTripple(LocationNode, new BONode(LDLUris.HasGeometeryPropertyUri), geometryNode));
            if (Offset > 0)
            {
                string OffsetLocationStr  = LDLUris.OffsetLocationStr + "_" + guidStr;
                BONode offsetLocationNode = new BONode(new Uri(OffsetLocationStr));
                tripples.Add(BOTripple.CreateTrippleFromValues(offsetLocationNode, LDLUris.RDFType, LDLUris.OffsetLocationType));
                tripples.Add(BOTripple.CreateTrippleFromValues(offsetLocationNode, LDLUris.UnitProperty, LDLUris.Metre));
                tripples.Add(new BOTripple(LocationNode, new BONode(LDLUris.OffsetLocationProperty), offsetLocationNode));
                tripples.Add(BOTripple.CreateTrippleFromValues(offsetLocationNode, LDLUris.MeasurementValueProperty, Offset));
            }
            return(tripples);
        }
Beispiel #4
0
        public IEnumerable <BOTripple> GetAsTripples(BONode locatedSubject)
        {
            List <BOTripple> toInsert   = new List <BOTripple>();
            BONode           xPredicate = new BONode(LDLUris.DiagramXProperty);
            BONode           xObject    = new BONode(X);

            toInsert.Add(new BOTripple(locatedSubject, xPredicate, xObject));

            BONode yPredicate = new BONode(LDLUris.DiagramYProperty);
            BONode yObject    = new BONode(Y);

            toInsert.Add(new BOTripple(locatedSubject, yPredicate, yObject));

            return(toInsert);
        }
 public InsertableNode(BONode toClone)
 {
     this.Value = toClone.Value;
     this.AddLanguageTagToString = toClone.AddLanguageIfString;
 }
Beispiel #6
0
 //Regularly need to create a triple from this combination of things - business objects supply a node as base, then the values for the other 2
 public static BOTripple CreateTrippleFromValues(BONode subject, object predicate, object _object)
 {
     return(new BOTripple(subject, new BONode(predicate), new BONode(_object)));
 }
Beispiel #7
0
 public BOTripple(BONode subject, BONode predicate, BONode _object)
 {
     Subject   = subject;
     Predicate = predicate;
     Object    = _object;
 }