Git Product home page Git Product logo

doga / qworum-for-web-pages Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 1.11 MB

A JavaScript library for using the advanced web browser capabilities that are provided by Qworum.

Home Page: http://qworum.net/docs/qworum-for-web-pages/latest/Qworum.html

License: Apache License 2.0

JavaScript 100.00%
javascript javascript-library es6-javascript qworum web-development ipaas ipaas-platform paas paas-framework paas-frontend saas saas-api

qworum-for-web-pages's Introduction

Qworum logo and name

Qworum for web pages

This is Qworum's official JavaScript library for web frontends.

Documentation

The documentation for the latest version of this library is available here.

Some projects that are using this library

Template for a Qworum application that uses RDF data.

How to import this library in a web page

import { QworumScript, Qworum } from "https://esm.sh/gh/doga/[email protected]/mod.mjs";

Activating Qworum for a website

Qworum provides advanced browser capabilities through a browser extension. By default Qworum is actived for local development only. Activating Qworum for a website requires a subscription.

Usage

Tip: Run the examples below by typing this in your terminal (requires Deno):

deno run --allow-net --allow-run --allow-env --allow-read --location https://site.example/a/page.html https://deno.land/x/[email protected]/mod.ts --dax=false --mode=isolated https://raw.githubusercontent.com/doga/qworum-for-web-pages/master/README.md
Generate a Qworum script in-memory.
description = '''
Running this example is safe, it will not read or write anything to your filesystem.
'''
import { QworumScript, Qworum } from 'https://esm.sh/gh/doga/[email protected]/mod.mjs';

const
Script   = QworumScript.Script.build,
Sequence = QworumScript.Sequence.build,
Call     = QworumScript.Call.build,
Goto     = QworumScript.Goto.build,
script   = Script(
  Sequence(
    Call(['@', 'shopping cart'], 'https://shopping-cart.example/view/'),
    Goto("/home/")
  )
);

console.info(`${script}`);

// In a browser the Qworum extension would run the Qworum script.
// await Qworum.eval(script);

Sample output for the code above:

Sequence(Call(object: [@, shopping cart], href: https://shopping-cart.example/view/),Goto(href: /home/))
Create semantic data sourced from a Turtle file.
description = '''
Running this example is safe, it will not read or write anything to your filesystem.
'''
import { SemanticData, Qworum } from 'https://esm.sh/gh/doga/[email protected]/mod.mjs';

const org = new SemanticData();

await org.readFromUrl(new URL('https://qworum.net/data/org.ttl'));

console.info(`${org}`);

// In a browser the Qworum extension could store this as session data.
// await Qworum.setData('Organisation', org);

Sample output for the code above:

SemanticData(
  …
  <https://qworum.net/data/org.ttl#id> a <http://www.w3.org/ns/org#Organization>, <https://w3id.org/okn/o/sd#Organization>;
      <http://www.w3.org/ns/org#purpose> "Qworum is a provider of enterprise infrastructure software, with the overarching goal of making the web a fully fledged platform for applications."@en;
  …
)
Qworum scripts must not contain platform faults.
description = '''
Running this example is safe, it will not read or write anything to your filesystem.
'''
import { QworumScript, Qworum } from 'https://esm.sh/gh/doga/[email protected]/mod.mjs';

const
Script     = QworumScript.Script.build,
Fault      = QworumScript.Fault.build,
faultTypes = ['* entitlement', 'payment cancelled', null];

for(const faultType of faultTypes){
  try{
    const script = Script(Fault(faultType));
    console.info(`${script}`);
  }catch(error){
    console.error(`${error}`);
  }
}

Sample output for the code above:

TypeError: not a service-specific fault: '* entitlement'
Fault(type: payment cancelled)
Fault(type: * service-specific)

License

This software is released under the terms of the Apache 2.0 license.

qworum-for-web-pages's People

Contributors

doga avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.