How to use platform - 10 common examples

To help you get started, we’ve selected a few platform examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github researchspace / researchspace / researchspace / web / src / main / data / iiif / LDPOverlayImageService.ts View on Github external
eventIri, vocabularies.rdf.type, crmdig.D3_Formal_Derivation
        ),
        Rdf.triple(
          eventIri, crmdig.L22_created_derivative, overlayIri
        ),
        // Parameters - param1
        Rdf.triple(
          eventIri, crmdig.L13_used_parameters, param1
        ),
        Rdf.triple(
          param1, vocabularies.rdf.type, crmdig.D1_Digital_Object
        ),
        Rdf.triple(
          param1, rso.OverlayImageSource, bottomImage
        ),
        Rdf.triple(
          param1, rso.OverlayOrder, Rdf.literal('1')
        ),
        Rdf.triple(
          param1, rso.OverlayOpacity, Rdf.literal('' + bottomOpacity)
        ),
        // Parameters - param2
        Rdf.triple(
          eventIri, crmdig.L13_used_parameters, param2
        ),
        Rdf.triple(
          param2, vocabularies.rdf.type, crmdig.D1_Digital_Object
        ),
        Rdf.triple(
          param2, rso.OverlayImageSource, topImage
        ),
        Rdf.triple(
github researchspace / researchspace / metaphacts-platform / web / src / main / components / forms / field-editor / FieldEditorState.ts View on Github external
// empty IRI will be resolved in LDP later through baseIRI
  const baseIri = Rdf.iri('');
  /*
   * create field, basic information
   */
  triples.push(Rdf.triple(baseIri, rdf.type, field.Field ));
  label.forEach(lbl => triples.push(Rdf.triple(baseIri, rdfs.label, lbl)));
  if (description && description.length > 0) {
    triples.push(Rdf.triple(baseIri, rdfs.comment, Rdf.literal(description, xsd._string) ));
  }
  /*
   * adding triples for insert pattern
   */
  const bInsert = Rdf.bnode();
  triples.push(Rdf.triple(baseIri, field.insert_pattern, bInsert ));
  triples.push(Rdf.triple(bInsert, rdf.type, sp.Query ));
  triples.push(Rdf.triple(bInsert, sp.text, Rdf.literal(insertPattern, xsd._string) ));
  for (const value of domain) {
    triples.push(Rdf.triple(baseIri, field.domain, Rdf.iri(value)));
  }
  if (xsdDatatype) {
    triples.push(Rdf.triple(baseIri, field.xsd_datatype, Rdf.iri(xsdDatatype) ));
  }
  for (const value of range) {
    triples.push(Rdf.triple(baseIri, field.range, Rdf.iri(value)));
  }
  if (min) {
    triples.push(Rdf.triple(baseIri, field.min_occurs, Rdf.literal(min, xsd._string) ));
  }
  if (max) {
    triples.push(Rdf.triple(baseIri, field.max_occurs, Rdf.literal(max, xsd._string) ));
  }
github researchspace / researchspace / researchspace / web / src / main / data / iiif / LDPOverlayImageService.ts View on Github external
param1, rso.OverlayOpacity, Rdf.literal('' + bottomOpacity)
        ),
        // Parameters - param2
        Rdf.triple(
          eventIri, crmdig.L13_used_parameters, param2
        ),
        Rdf.triple(
          param2, vocabularies.rdf.type, crmdig.D1_Digital_Object
        ),
        Rdf.triple(
          param2, rso.OverlayImageSource, topImage
        ),
        Rdf.triple(
          param2, rso.OverlayOrder, Rdf.literal('2')
        ),
        Rdf.triple(
          param2, rso.OverlayOpacity, Rdf.literal('' + topOpacity)
        ),
      ]);
    return resourceGraph;
  }
github researchspace / researchspace / researchspace / web / src / main / data / iiif / LDPOverlayImageService.ts View on Github external
Rdf.graph([
        // common typing & labels
        Rdf.triple(
          overlayIri, vocabularies.rdf.type, rso.Thing
        ),
        Rdf.triple(
          overlayIri, vocabularies.rdf.type, rso.EX_Digital_Image
        ),
        Rdf.triple(
          overlayIri, vocabularies.rdf.type, crmdig.D9_Data_Object
        ),
        Rdf.triple(
          overlayIri, vocabularies.rdfs.label, Rdf.literal(name)
        ),
        Rdf.triple(
          overlayIri, rso.displayLabel, Rdf.literal(name)
        ),
        // derivatives info
        Rdf.triple(
          topImage, crmdig.L21_used_as_derivation_source, eventIri
        ),
        Rdf.triple(
          bottomImage, crmdig.L21_used_as_derivation_source, eventIri
        ),
        Rdf.triple(
          eventIri, vocabularies.rdf.type, crmdig.D3_Formal_Derivation
        ),
        Rdf.triple(
          eventIri, crmdig.L22_created_derivative, overlayIri
        ),
        // Parameters - param1
        Rdf.triple(
github researchspace / researchspace / researchspace / web / src / main / data / iiif / LDPOverlayImageService.ts View on Github external
),
        // Parameters - param2
        Rdf.triple(
          eventIri, crmdig.L13_used_parameters, param2
        ),
        Rdf.triple(
          param2, vocabularies.rdf.type, crmdig.D1_Digital_Object
        ),
        Rdf.triple(
          param2, rso.OverlayImageSource, topImage
        ),
        Rdf.triple(
          param2, rso.OverlayOrder, Rdf.literal('2')
        ),
        Rdf.triple(
          param2, rso.OverlayOpacity, Rdf.literal('' + topOpacity)
        ),
      ]);
    return resourceGraph;
  }
github researchspace / researchspace / metaphacts-platform / web / src / main / components / forms / inputs / PlainTextInput.ts View on Github external
private createValue(text: string, language: string): AtomicValue | EmptyValue {
    if (text.length === 0) { return FieldValue.empty; }

    let datatype = this.props.definition.xsdDatatype || vocabularies.xsd._string;
    if (!language && XsdDataTypeValidation.sameXsdDatatype(datatype, vocabularies.rdf.langString)) {
      // Replace rdf:langString -> xsd:string if no language specified
      datatype = vocabularies.xsd._string;
    }

    let value: Rdf.Node;
    if (language) {
      value = Rdf.langLiteral(text, language);
    } else if (XsdDataTypeValidation.sameXsdDatatype(datatype, vocabularies.xsd.anyURI)) {
      value = Rdf.iri(text);
    } else {
      value = Rdf.literal(text, datatype);
    }

    return AtomicValue.set(this.props.value, {value});
  }
github nstudio / nativescript-videoplayer / videoplayer / videoplayer-common.js View on Github external
/**************************************************************************************
 * Made for the {N} community by Brad Martin @BradWayneMartin
 * https://twitter.com/BradWayneMartin
 * https://github.com/bradmartin
 * Pull requests are welcome. Enjoy!
 *************************************************************************************/
var view = require("ui/core/view");
var platform = require("platform");
var dependencyObservable = require("ui/core/dependency-observable");
var proxy = require("ui/core/proxy");
// on Android we explicitly set propertySettings to None because android will invalidate its layout (skip unnecessary native call).
var AffectsLayout = platform.device.os === platform.platformNames.android ? dependencyObservable.PropertyMetadataSettings.None : dependencyObservable.PropertyMetadataSettings.AffectsLayout;
var Video = (function (_super) {
    __extends(Video, _super);
    function Video(options) {
        _super.call(this, options);
    }
    Object.defineProperty(Video.prototype, "src", {
        get: function () {
            return this._getValue(Video.srcProperty);
        },
        set: function (value) {
            this._setValue(Video.srcProperty, value);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(Video.prototype, "isLoading", {
github OpenVidu / openvidu / openvidu-browser / lib / OpenVidu / Session.js View on Github external
_this.processToken(token);
            if (_this.openvidu.checkSystemRequirements()) {
                // Early configuration to deactivate automatic subscription to streams
                _this.options = {
                    sessionId: _this.sessionId,
                    participantId: token,
                    metadata: !!metadata ? _this.stringClientMetadata(metadata) : ''
                };
                _this.connectAux(token).then(function () {
                    resolve();
                })["catch"](function (error) {
                    reject(error);
                });
            }
            else {
                reject(new OpenViduError_1.OpenViduError(OpenViduError_1.OpenViduErrorName.BROWSER_NOT_SUPPORTED, 'Browser ' + platform.name + ' for ' + platform.os.family + ' is not supported in OpenVidu'));
            }
        });
    };
github OpenVidu / openvidu / openvidu-browser / lib / OpenViduInternal / WebRtcStats / WebRtcStats.js View on Github external
WebRtcStats.prototype.getStatsAgnostic = function (pc, successCb, failureCb) {
        var _this = this;
        if (platform.name.indexOf('Firefox') !== -1) {
            // getStats takes args in different order in Chrome and Firefox
            return pc.getStats(null).then(function (response) {
                var report = _this.standardizeReport(response);
                successCb(report);
            })["catch"](failureCb);
        }
        else if ((platform.name.indexOf('Chrome') !== -1) || (platform.name.indexOf('Opera') !== -1)) {
            // In Chrome, the first two arguments are reversed
            return pc.getStats(function (response) {
                var report = _this.standardizeReport(response);
                successCb(report);
            }, null, failureCb);
        }
    };
    return WebRtcStats;
github petkaantonov / HTML-Music-Player / src / audio / frontend / AudioManager.js View on Github external
_checkAudioContextStaleness() {
        if (this._audioContext.state === `running`) {
            if (this._suspensionTimerStartedTime !== -1 &&
                performance.now() - this._suspensionTimerStartedTime > this._suspensionTimeoutMs) {
                this._suspensionTimerStartedTime = -1;
                this._resetAudioContext();
            }
            return;
        }

        // Reset AudioContext as it's probably ruined despite of suspension efforts.
        if (!this._currentStateModificationAction) {
            this._resetAudioContext();
        } else if (this._currentStateModificationAction.type === `suspend`) {
            this._currentStateModificationAction = null;
            this._resetAudioContext();
        }
    }