Example #1
0
 public Fact(FactType factType, DateInfo date, PlaceReference place, String value)
 {
     SetType(factType);
     SetDate(date);
     SetPlace(place);
     SetValue(value);
 }
 /// <summary>
 /// Visits the date.
 /// </summary>
 /// <param name="date">The date to visit.</param>
 public override void VisitDate(Gx.Conclusion.DateInfo date)
 {
     if (date.Id != null)
     {
         this.dictionary.Add(date.Id, date);
     }
     base.VisitDate(date);
 }
        /// <summary>
        /// Normalizes the specified date to a <see cref="DateInfo"/>.
        /// </summary>
        /// <param name="date">The date to be normalized.</param>
        /// <param name="options">The options to apply before executing the REST API call.</param>
        /// <returns></returns>
        public DateInfo NormalizeDate(String date, params IStateTransitionOption[] options)
        {
            Link normalizedDateLink = GetLink(Rel.NORMALIZED_DATE);
            if (normalizedDateLink == null || normalizedDateLink.Template == null)
            {
                return null;
            }
            String template = normalizedDateLink.Template;
            String uri = new UriTemplate(template).AddParameter("date", date).Resolve();

            IRestRequest request = CreateRequest().Accept(MediaTypes.TEXT_PLAIN).Build(uri, Method.GET);
            IRestResponse response = Invoke(request, options);
            DateInfo dateValue = new DateInfo();
            dateValue.Original = date;
            dateValue.AddNormalizedExtension(new TextValue(response.ToIRestResponse<String>().Data));
            if (response.Headers != null)
            {
                dateValue.Formal = response.Headers.Where(x => x.Name == "Location").Select(x => x.Value as string).FirstOrDefault();
            }
            return dateValue;
        }
Example #4
0
 /**
  * Build out this coverage with temporal coverage.
  * @param temporal The temporal coverage.
  * @return This.
  */
 public Coverage SetTemporal(DateInfo temporal)
 {
     Temporal = temporal;
     return this;
 }
 /// <summary>
 /// Visits the date.
 /// </summary>
 /// <param name="date">The date to visit.</param>
 public virtual void VisitDate(DateInfo date)
 {
     this.contextStack.Push(date);
     if (date.Fields != null)
     {
         foreach (Field field in date.Fields)
         {
             VisitField(field);
         }
     }
     this.contextStack.Pop();
 }
Example #6
0
 /**
  * Build up this name with a date.
  * @param date The date.
  * @return this.
  */
 public Name SetDate(DateInfo date)
 {
     Date = date;
     return(this);
 }
Example #7
0
 /**
  * Build up this name with a date.
  * @param date The date.
  * @return this.
  */
 public Name SetDate(DateInfo date)
 {
     Date = date;
     return this;
 }
 public virtual void VisitDate(DateInfo date)
 {
     this.contextStack.Push(date);
     List<Field> fields = date.Fields;
     if (fields != null)
     {
         foreach (Field field in fields)
         {
             field.Accept(this);
         }
     }
     this.contextStack.Pop();
 }
Example #9
0
 public Fact(FactType factType, DateInfo date, PlaceReference place)
     :this(factType, date, place, null)
 {
 }
 public override void VisitDate(DateInfo date)
 {
     BindIfNeeded(date);
     base.VisitDate(date);
 }
Example #11
0
 /**
  * Build up this fact with a date.
  *
  * @param date the date.
  * @return this.
  */
 public Fact SetDate(DateInfo date)
 {
     Date = date;
     return this;
 }
Example #12
0
 /**
  * Build out this coverage with temporal coverage.
  * @param temporal The temporal coverage.
  * @return This.
  */
 public Coverage SetTemporal(DateInfo temporal)
 {
     Temporal = temporal;
     return(this);
 }
Example #13
0
 public Fact(FactType factType, DateInfo date, PlaceReference place)
     : this(factType, date, place, null)
 {
 }
Example #14
0
 /**
  * Build up this fact with a date.
  *
  * @param date the date.
  * @return this.
  */
 public Fact SetDate(DateInfo date)
 {
     Date = date;
     return(this);
 }
Example #15
0
 /**
  * Build up this event with a date.
  *
  * @param date The date.
  * @return this.
  */
 public Event SetDate(DateInfo date)
 {
     Date = date;
     return(this);
 }
Example #16
0
 /**
  * Build up this event with a date.
  *
  * @param date The date.
  * @return this.
  */
 public Event SetDate(DateInfo date)
 {
     Date = date;
     return this;
 }
Example #17
0
 /**
  * Create a date/place event with the passed in type and values.
  *
  * @param EventType the event type.
  * @param date The date of applicability of this event.
  * @param place The place of applicability of this event.
  */
 public Event(EventType EventType, DateInfo date, PlaceReference place)
 {
     SetType(EventType);
     SetDate(date);
     SetPlace(place);
 }
Example #18
0
 /**
  * Create a date/place event with the passed in type and values.
  *
  * @param EventType the event type.
  * @param date The date of applicability of this event.
  * @param place The place of applicability of this event.
  */
 public Event(EventType EventType, DateInfo date, PlaceReference place)
 {
     SetType(EventType);
     SetDate(date);
     SetPlace(place);
 }
 /**
  * Build out this place description with a temporal description.
  * @param temporalDescription the temporal description.
  * @return this.
  */
 public PlaceDescription SetTemporalDescription(DateInfo temporalDescription)
 {
     TemporalDescription = temporalDescription;
     return this;
 }
Example #20
0
 /**
  * Build out this place description with a temporal description.
  * @param temporalDescription the temporal description.
  * @return this.
  */
 public PlaceDescription SetTemporalDescription(DateInfo temporalDescription)
 {
     TemporalDescription = temporalDescription;
     return(this);
 }