Example #1
0
        protected override IEnumerable <BOTripple> GetCustomTripples()
        {
            List <BOTripple> customTripples = new List <BOTripple>();
            Uri duplicateTypeNodeUri        = null;

            switch (DuplicateType)
            {
            case BaliseDuplicateStatus.NO_DUPLICATES:
                duplicateTypeNodeUri = LDLUris.BaliseNoDuplicateClassUri;
                break;

            case BaliseDuplicateStatus.DUPLICATE_OF_THE_NEXT_BALISE:
                duplicateTypeNodeUri = LDLUris.BaliseDuplicateNextClassUri;
                break;

            case BaliseDuplicateStatus.DUPLICATE_OF_THE_PREVIOUS_BALISE:
                duplicateTypeNodeUri = LDLUris.BaliseDuplicatePrevousClassUri;
                break;

            case BaliseDuplicateStatus.SPARE:
                duplicateTypeNodeUri = LDLUris.BaliseDuplicateSpareClassUri;
                break;
            }
            customTripples.Add(BOTripple.CreateTrippleFromValues(this.AsNode, LDLUris.BaliseDuplicatePropertyUri, duplicateTypeNodeUri));
            customTripples.Add(BOTripple.CreateTrippleFromValues(this.AsNode, LDLUris.BaliseFixedProperty, FixedData));
            if (this.Location != null)
            {
                customTripples.Add(new BOTripple(this.AsNode, new BONode(LDLUris.RelativePositionPropertyUri), Location.AsNode));
            }
            customTripples.AddRange(Location.GetAsTripples());
            return(customTripples);
        }
Example #2
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);
        }
Example #3
0
        protected override IEnumerable <BOTripple> GetCustomTripples()
        {
            List <BOTripple> customTripples = new List <BOTripple>();

            customTripples.Add(new BOTripple(this.AsNode, new BONode(LDLUris.LocatedOnProperty), Track.AsNode));
            customTripples.Add(BOTripple.CreateTrippleFromValues(this.AsNode, LDLUris.MeasurementValueProperty, this.Distance));
            customTripples.Add(BOTripple.CreateTrippleFromValues(this.AsNode, LDLUris.UnitProperty, LDLUris.Metre));

            return(customTripples);
        }
Example #4
0
        protected override IEnumerable <BOTripple> GetCustomTripples()
        {
            List <BOTripple> customTriples = new List <BOTripple>();

            foreach (LDLBalise balise in Balises)
            {
                customTriples.Add(new BOTripple(this.AsNode, new BONode(LDLUris.RDFSMemberPropertyUri), balise.AsNode));
            }
            Uri BGTypeUri = null;

            foreach (LDLBaliseGroupType bgGroupType in BaliseGroupTypes)
            {
                switch (bgGroupType)
                {
                case LDLBaliseGroupType.SIGNAL:
                    BGTypeUri = LDLUris.SignalTypeUri;
                    break;

                case LDLBaliseGroupType.ERTMS_LEVEL_TRANSITION:
                    BGTypeUri = LDLUris.BGTypeERTMSLevelTransUri;
                    break;

                case LDLBaliseGroupType.LT_ANNOUNCEMENT:
                    BGTypeUri = LDLUris.BGTypeLTAnnouceUri;
                    break;

                case LDLBaliseGroupType.IN_FILL:
                    BGTypeUri = LDLUris.BGTypeInFillUri;
                    break;

                case LDLBaliseGroupType.MAIN:
                    BGTypeUri = LDLUris.BGTypeMainUri;
                    break;

                case LDLBaliseGroupType.LEVEL_CROSSING:
                    BGTypeUri = LDLUris.BGTypeLevelCrossingUri;
                    break;

                case LDLBaliseGroupType.RBC_BOUNDARY:
                    BGTypeUri = LDLUris.BGTypeRBC_BoundaryUri;
                    break;

                case LDLBaliseGroupType.ODOMETRY:
                    BGTypeUri = LDLUris.BGTypeOdometrynUri;
                    break;

                default:
                    break;
                }
                BOTripple bgTypeTriple = BOTripple.CreateTrippleFromValues(this.AsNode,LDLUris.BGTypePropertyUri,BGTypeUri);
                customTriples.Add(bgTypeTriple);
            }

            return(customTriples);//CC_0002-BG_20
        }
        protected override IEnumerable <BOTripple> GetCustomTripples()
        {
            List <BOTripple> results = new List <BOTripple>();

            results.AddRange(base.GetAsTripples());
            if (!string.IsNullOrEmpty(Label))
            {
                results.Add(BOTripple.CreateTrippleFromValues(this.AsNode, LDLUris.Label, Label));
            }
            return(results);
        }
        protected override IEnumerable <BOTripple> GetCustomTripples()
        {
            List <BOTripple> customTripples = new List <BOTripple>();

            if (Track != null)
            {
                customTripples.Add(new BOTripple(this.AsNode, new BONode(LDLUris.LocatedOnProperty), this.Track.AsNode));
            }
            customTripples.Add(BOTripple.CreateTrippleFromValues(this.AsNode, LDLUris.StartTrackPositionProperty, this.Start));
            customTripples.Add(BOTripple.CreateTrippleFromValues(this.AsNode, LDLUris.EndTrackPositionProperty, this.End));

            return(customTripples);
        }
        protected override IEnumerable <BOTripple> GetCustomTripples()
        {
            List <BOTripple> customTripples = new List <BOTripple>();

            //I've been slightly arbitary assigning min and max here - assuming it's the end of the first and the start of the second
            if (JoinedCircuits[0] != null)
            {
                customTripples.Add(BOTripple.CreateTrippleFromValues(JoinedCircuits[0].AsNode, LDLUris.MaxLocation, this.ObjectUri));
            }
            if (JoinedCircuits[1] != null)
            {
                customTripples.Add(BOTripple.CreateTrippleFromValues(JoinedCircuits[1].AsNode, LDLUris.MinLocation, this.ObjectUri));
            }
            if (this.Location != null)
            {
                customTripples.Add(new BOTripple(this.AsNode, new BONode(LDLUris.RelativePositionPropertyUri), Location.AsNode));
            }
            customTripples.AddRange(Location.GetAsTripples());
            return(customTripples);
        }