2017 © Pedro Peláez
 

library networq

Networq library

image

networq/networq

Networq library

  • Monday, July 16, 2018
  • by joostfaassen
  • Repository
  • 1 Watchers
  • 5 Stars
  • 46 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 14 Versions
  • 0 % Grown

The README.md

Networq PHP Library

CircleCI, (*1)

This is a PHP library for Networq., (*2)

It allows you to load Networq graphs, including it's dependencies, types and nodes., (*3)

Once the graph is loaded, you can query it and iterate through it's data., (*4)

Terms:

Node:

All data in Networq is a "Node". A node has a name (i.e. mario). Every node is part of a package (i.e. acme:example). The node name and the package name combined give a Fully Qualified Node Name (FQNN) (i.e. acme:example:mario)., (*5)

Other than the name/fqnn, a node doesn't have any properties of it's own. A Node can be tagged with one or more Types, which give the node it's available properties. For example, tagging the acme:example:mario node with the acme:example:character type allows you to specify the debut field for Mario, linking it to the game that Mario debuted in., (*6)

Package

A "Package" is a reusable set of Types and Nodes. Packages can be shared and live in their own Git Repository., (*7)

A Package defines Types (in the package's types/ directory) using YAML files., (*8)

A Package can optionally define a set of Nodes. Nodes in packages are therefor also reusable and lets you share reference data or standardized lists (like countries, operating systems, etc)., (*9)

A Package can optionally define Widgets, which are simple HTML templates (in the templates/ directory) which get injected into the User Interface when a user is viewing a Node of a given Type., (*10)

A Package always has a package.yaml file in the root of it's repository. The package.yaml file defines the Package's name, description, license etc. And lists an optional set of dependencies: other packages that this package depends on., (*11)

Types

A "Type" defines what properties a Node can have. A type has a name (i.e. vegetable) and is part of a package (i.e. acme:food). Combining the Type name and Package Name gives you a Fully Qualified Type Name (FQTN) (i.e. acme:food:vegetable)., (*12)

Types are defined by creating .yaml files in the types/ directory of a package. They are automatically loaded when the package is loaded., (*13)

Types optionally define a list of Fields for the type. Only nodes tagged with this type will have the listed fields., (*14)

A Field can be either a string (simple text), or a FQTN. When you specify a FQTN for a Field, you can only assign nodes that are tagged with this type., (*15)

A Field can be a single value (default), or a list of values (by appending [] to the end of the Field type definition)., (*16)

Tags

A "Tag" is simply the link between a Node and a Type. One Node can contain multiple Tags., (*17)

  • https://en.wikipedia.org/wiki/Multiple_inheritance
  • https://en.wikipedia.org/wiki/Trait_(computer_programming)
  • https://en.wikipedia.org/wiki/Entity-component-system
  • https://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol

Getting started

Installation

$ git clone https://github.com/networq/networq-php
$ cd networq-php
$ composer install

Examples

After installation you should be able to run the simple examples in examples/, (*18)

$ php example/list-packages.php
Packages: 1
- example:games

$ php example/list-types.php
Types: 5
* example:games:platform
    - manufacturer (string)
* example:games:character
    - debut (example:games:game)
    - games (example:games:game[])
* example:games:game
    - publisher (string)
    - platform (example:games:platform)
    - characters (example:games:character[])
    - urls (example:games:url[])
* example:games:url
    - target (string)
* example:games:base
    - name (string)
    - image (string)
    - description (string)

$ php example/mario.php
example:games:mario
  example:games:base
      name=Mario
      image=https://mario.nintendo.com/assets/img/home/intro/mario-pose2.png
      description=
  example:games:character
      debut=*example:games:smb
      games=[*example:games:smb] [*example:games:dk]
Plays in games: 2
* example:games:smb (Super Mario Bros) Nintendo Entertainment System
* example:games:dk (Donkey Kong) Nintendo Entertainment System

$ php example/nintendo-games.php
Nintendo games: 3
* example:games:smb (Super Mario Bros)
* example:games:dk (Donkey Kong)
* example:games:loz (The Legend of Zelda)

Web based viewer

Please check https://github.com/networq/networq-web for an implementation of a web-based viewer., (*19)

Testing

See .circleci/config.yml how to run tests. At the moment: run ./vendor/bin/phpunit --configuration phpunit.xml tests., (*20)

License

MIT. Please refer to the license file for details., (*21)

Brought to you by the LinkORB Engineering team


Check out our other projects at linkorb.com/engineering., (*22)

Btw, we're hiring!, (*23)

The Versions

08/07 2018

v1.7.0

1.7.0.0 http://www.github.com/networq/networq-php

Networq library

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

graph node linkorb networq

07/07 2018

v1.6.1

1.6.1.0 http://www.github.com/networq/networq-php

Networq library

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

graph node linkorb networq

07/07 2018

v1.6.0

1.6.0.0 http://www.github.com/networq/networq-php

Networq library

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

graph node linkorb networq

06/07 2018

dev-CI-support-docker

dev-CI-support-docker http://www.github.com/networq/networq-php

Networq library

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

graph node linkorb networq

06/07 2018

v1.5.1

1.5.1.0 http://www.github.com/networq/networq-php

Networq library

  Sources   Download

MIT

The Requires

 

by LinkORB Engineering

graph node linkorb networq

02/07 2018

v1.5.0

1.5.0.0 http://www.github.com/networq/networq-php

Networq library

  Sources   Download

MIT

The Requires

 

by LinkORB Engineering

graph node linkorb networq

01/07 2018

v1.4.0

1.4.0.0 http://www.github.com/networq/networq-php

Networq library

  Sources   Download

MIT

The Requires

 

by LinkORB Engineering

graph node linkorb networq

30/06 2018

v1.3.0

1.3.0.0 http://www.github.com/networq/networq-php

Networq library

  Sources   Download

MIT

The Requires

 

by LinkORB Engineering

graph node linkorb networq

29/06 2018

v1.2.1

1.2.1.0 http://www.github.com/networq/networq-php

Networq library

  Sources   Download

MIT

The Requires

 

by LinkORB Engineering

graph node linkorb networq

29/06 2018

v1.2.0

1.2.0.0 http://www.github.com/networq/networq-php

Networq library

  Sources   Download

MIT

The Requires

 

by LinkORB Engineering

graph node linkorb networq

27/06 2018

v1.1.0

1.1.0.0 http://www.github.com/networq/networq-php

Networq library

  Sources   Download

MIT

The Requires

 

by LinkORB Engineering

graph node linkorb networq

23/06 2018

v1.0.0

1.0.0.0 http://www.github.com/networq/networq-php

Networq library

  Sources   Download

MIT

The Requires

 

by LinkORB Engineering

graph node linkorb networq