Esempio n. 1
1
		/// <summary>
		/// Starts the export of sensor data values for a particular point in time. This call must be followed by a call to <see cref="EndExportTimestamp"/>.
		/// Use <see cref="ExportField"/> to export field  information to the Sensor Data TURTLE document.
		/// </summary>
		/// <param name="Turtle">TURTLE Output</param>
		/// <param name="Timestamp">Timestamp</param>
		public static void StartExportTimestamp (TurtleWriter Turtle, DateTime Timestamp)
		{
			Timestamp = Timestamp.ToUniversalTime ();

			Turtle.WritePredicateUri ("cl", "sample");
			Turtle.StartBlankNode ();

			Turtle.WritePredicateUri ("cl", "timestamp");
			Turtle.WriteObjectLiteralTyped (XmlUtilities.DateTimeToString (Timestamp), "xsd", "dateTime");
		}
Esempio n. 2
1
		/// <summary>
		/// <see cref="Field.ExportAsTurtleSensorData"/>
		/// </summary>
		public override void ExportAsTurtleSensorData(TurtleWriter w)
		{
			w.WritePredicateUri ("cl", "field");
			w.StartBlankNode ();

			this.ExportAsTurtleSensorDataCommonAttributes(w);

			w.WritePredicateUri ("cl", "enum");
			w.WriteObjectLiteral (this.value);

			w.WritePredicateUri ("cl", "dataType");
			w.WriteObjectLiteral (this.dataType);

			w.EndBlankNode ();
		}
Esempio n. 3
1
		/// <summary>
		/// <see cref="Field.ExportAsTurtleSensorData"/>
		/// </summary>
		public override void ExportAsTurtleSensorData(TurtleWriter w)
		{
			w.WritePredicateUri ("cl", "field");
			w.StartBlankNode ();

			this.ExportAsTurtleSensorDataCommonAttributes(w);

			w.WritePredicateUri ("cl", "dateTime");
			w.WriteObjectLiteralTyped (XmlUtilities.DateTimeToString(this.value), "xsd", "dateTime");

			w.EndBlankNode ();
		}
Esempio n. 4
0
        /// <summary>
        /// <see cref="Field.ExportAsTurtleSensorData"/>
        /// </summary>
        public override void ExportAsTurtleSensorData(TurtleWriter w)
        {
            w.WritePredicateUri("cl", "field");
            w.StartBlankNode();

            this.ExportAsTurtleSensorDataCommonAttributes(w);

            w.WritePredicateUri("cl", "duration");
            w.WriteObjectLiteralTyped(this.value.ToDuration().ToString(), "xsd", "duration");

            w.EndBlankNode();
        }
        /// <summary>
        /// <see cref="Field.ExportAsTurtleSensorData"/>
        /// </summary>
        public override void ExportAsTurtleSensorData(TurtleWriter w)
        {
            w.WritePredicateUri("cl", "field");
            w.StartBlankNode();

            this.ExportAsTurtleSensorDataCommonAttributes(w);

            w.WritePredicateUri("cl", "boolean");
            w.WriteObjectLiteralTyped(this.value);

            w.EndBlankNode();
        }
Esempio n. 6
0
        /// <summary>
        /// <see cref="Field.ExportAsTurtleSensorData"/>
        /// </summary>
        public override void ExportAsTurtleSensorData(TurtleWriter w)
        {
            w.WritePredicateUri("cl", "field");
            w.StartBlankNode();

            this.ExportAsTurtleSensorDataCommonAttributes(w);

            w.WritePredicateUri("cl", "dateTime");
            w.WriteObjectLiteralTyped(XmlUtilities.DateTimeToString(this.value), "xsd", "dateTime");

            w.EndBlankNode();
        }
Esempio n. 7
0
		/// <summary>
		/// <see cref="Field.ExportAsTurtleSensorData"/>
		/// </summary>
		public override void ExportAsTurtleSensorData(TurtleWriter w)
		{
			w.WritePredicateUri ("cl", "field");
			w.StartBlankNode ();

			this.ExportAsTurtleSensorDataCommonAttributes (w);

			w.WritePredicateUri ("cl", "numeric");
			w.WriteObjectLiteralTyped (this.value);

			//string EncodedUnit = HttpUtilities.UrlEncode (this.unit);
			//
			//if (EncodedUnit == this.unit)
			//	w.WriteObjectLiteralTyped (XmlUtilities.DoubleToString (this.value, this.nrDecimals), "clu", this.unit);
			//else
			//	w.WriteObjectLiteralTyped (XmlUtilities.DoubleToString (this.value, this.nrDecimals), "http://clayster.com/sw/u/" + EncodedUnit);

			w.WritePredicateUri ("cl", "unit");
			w.WriteObjectLiteral (this.unit);

			w.WritePredicateUri ("cl", "nrDec");
			w.WriteObjectLiteralTyped (this.nrDecimals);

			w.EndBlankNode ();
		}
Esempio n. 8
0
		/// <summary>
		/// <see cref="Field.ExportAsTurtleSensorData"/>
		/// </summary>
		public override void ExportAsTurtleSensorData(TurtleWriter w)
		{
			w.WritePredicateUri ("cl", "field");
			w.StartBlankNode ();

			this.ExportAsTurtleSensorDataCommonAttributes(w);

			w.WritePredicateUri ("cl", "duration");
			w.WriteObjectLiteralTyped (this.value.ToDuration().ToString(), "xsd", "duration");

			w.EndBlankNode ();
		}
Esempio n. 9
-1
		/// <summary>
		/// Starts the export of sensor data values for a particular node. This call must be followed by a call to <see cref="EndExportNode"/>.
		/// Use <see cref="StartExportTimestamp"/> to export node information pertaining to a given point in time to the Sensor Data TURTLE document.
		/// </summary>
		/// <param name="Turtle">TURTLE Output</param>
		/// <param name="NodeId">Node ID.</param>
		/// <param name="CacheType">Cache Type</param> 
		/// <param name="SourceId">Source ID.</param>
		public static void StartExportNode (TurtleWriter Turtle, string NodeId, string CacheType, string SourceId)
		{
			Turtle.WriteSubjectUri ("l", string.Empty);
			Turtle.WritePredicateUri ("cl", "node");
			Turtle.StartBlankNode ();

			Turtle.WritePredicateUri ("cl", "nodeId");
			Turtle.WriteObjectLiteral (NodeId);

			if (!string.IsNullOrEmpty (CacheType))
			{
				Turtle.WritePredicateUri ("cl", "cacheType");
				Turtle.WriteObjectLiteral (CacheType);
			}

			if (!string.IsNullOrEmpty (SourceId))
			{
				Turtle.WritePredicateUri ("cl", "sourceId");
				Turtle.WriteObjectLiteral (SourceId);
			}
		}