You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2020/06/20 17:54:29 UTC

[incubator-streampipes] branch dev updated: Extended sdk to support property scope for string eps

This is an automated email from the ASF dual-hosted git repository.

zehnder pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git


The following commit(s) were added to refs/heads/dev by this push:
     new 4f7ffc1  Extended sdk to support property scope for string eps
4f7ffc1 is described below

commit 4f7ffc1b51768aa1fa4f0ababe485995d5975081
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Sat Jun 20 19:53:50 2020 +0200

    Extended sdk to support property scope for string eps
---
 .../org/apache/streampipes/sdk/helpers/EpProperties.java | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/helpers/EpProperties.java b/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/helpers/EpProperties.java
index a08b0f1..9e3fb18 100644
--- a/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/helpers/EpProperties.java
+++ b/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/helpers/EpProperties.java
@@ -234,6 +234,22 @@ public class EpProperties {
   }
 
   /**
+   * Creates a new primitive property of type string and the provided domain property.
+   *
+   * @param runtimeName    The field identifier of the event property at runtime.
+   * @param domainProperty The semantics of the list property as a String. The string should correspond to a URI
+   *                       provided by a vocabulary. Use one of the vocabularies provided in
+   *                       {@link org.apache.streampipes.vocabulary} or create your own domain-specific vocabulary.
+   * @param propertyScope  The scope for the property, whether it is a HEADER, MEASUREMENT, od DIMENSION property
+   * @return {@link org.apache.streampipes.model.schema.EventPropertyPrimitive}
+   */
+  public static EventPropertyPrimitive stringEp(Label label, String runtimeName, String domainProperty, PropertyScope propertyScope) {
+    EventPropertyPrimitive ep = ep(label, XSD._string.toString(), runtimeName, domainProperty);
+    ep.setPropertyScope(propertyScope.name());
+    return ep;
+  }
+
+  /**
    * Creates a new primitive property of type string and the provided domain property. In addition, the value range
    * of the property is restricted to the defined {@link org.apache.streampipes.model.schema.Enumeration}
    *