valueflows

valueflows docs
git clone https://s.sonu.ch/~srfsh/valueflows.git
Log | Files | Refs | README

commit b2b40ec0e26895afcd957364c6838f436fdaf0a7
Author: Michael Williams <dinosaur@riseup.net>
Date:   Wed,  8 Oct 2014 02:46:43 -0700

inital commit

Diffstat:
A.gitignore | 6++++++
AGroup/index.js | 61+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
APerson/index.js | 69+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
APlace/index.js | 13+++++++++++++
AREADME.md | 13+++++++++++++
ARelationship/index.js | 34++++++++++++++++++++++++++++++++++
ARole/index.js | 49+++++++++++++++++++++++++++++++++++++++++++++++++
7 files changed, 245 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -0,0 +1,6 @@ +node_modules +npm-debug.log + +.DS_Store + +.build diff --git a/Group/index.js b/Group/index.js @@ -0,0 +1,61 @@ +module.exports = { + id: "Group", + type: 'object', + prefixes: { + "": "http://schema.org/", + "org": "http://www.w3.org/TR/vocab-org#", + "ovn": "http://ovn.is/", + }, + context: "org:Organization", + description: "A collection of people and groups.", + properties: { + name: { + context: "name", + description: "The primary name of the group.", + type: "string", + }, + description: { + context: "description", + description: "A short description of the group.", + type: "string", + }, + relationships: { + context: "ovn:relationships", + description: "The relationships the group has or is with other agents.", + type: "array", + items: { + anyOf: [{ + reverse: "hasRelated", + }, { + reverse: "isRelated", + }] + $ref: "Relationship", + }, + }, + members: { + context: "member", + description: "The members of the group.", + type: "array", + items: { + $ref: "Agent", + }, + get: function () { + // from this Group's relationships + return this.relationships + // that have additionalType with name 'member', + .filter(function (rel) { + return rel.additionalType.name === "member" + }) + // return object that is related (i.e. is member) + .map(function (m) { + return r.isRelated; + }) + ; + }, + }, + }, + dependencies: { + Agent: require('../Agent') + Relationship: require('../Relationship'), + }, +}; diff --git a/Person/index.js b/Person/index.js @@ -0,0 +1,69 @@ +module.exports = { + id: "Person", + prefixes: { + "": "http://schema.org/", + "org": "http://www.w3.org/TR/vocab-org#", + "foaf": "http://xmlns.com/foaf/0.1/", + }, + context: "Person", + description: "A person.", + type: 'object', + properties: { + name: { + context: "name", + description: "The person's name.", + type: "string", + }, + handle: { + context: "foaf:nick", + description: "The person's online alias.", + type: "string", + }, + bio: { + context: "description", + description: "A short bio of the person.", + type: "string", + }, + location: { + context: "foaf:based_near", + description: "The location(s) this person is based near.", + type: "array", + items: { + $ref: "Place", + }, + }, + avatar: { + context: "image", + description: "An avatar of the person.", + type: "string", + format: "uri", + }, + homepage: { + context: "url", + description: "The person's homepage.", + type: "string", + format: "uri", + }, + memberships: { + context: "org:hasMembership", + description: "The membership relationships that the person plays.", + type: "array", + items: { + reverse: "member", + $ref: "Membership", + }, + }, + groups: { + context: "memberOf", + value: function () { + return this.memberships.map(function (m) { + return m.group; + }); + }, + }, + }, + dependencies: { + 'membership-vocab': 'git://github.com/openvocab/membership', + 'place-vocab': 'git://github.com/openvocab/place', + }, +}; diff --git a/Place/index.js b/Place/index.js @@ -0,0 +1,13 @@ +module.exports = { + id: "Place", + type: 'object', + prefixes: { + "": "http://schema.org/", + }, + description: "A location.", + context: "Place", + properties: { + }, + dependencies: { + }, +}; diff --git a/README.md b/README.md @@ -0,0 +1,13 @@ +# Open Value Network vocabs + +vocabs for [Open Value Network data](https://github.com/valnet/valuenetwork). + +should be applicable in describing resource accounting for networks of people and groups. + +### WORK IN PROGRESS + +- [Person](./Person/index.js) +- [Group](./Group/index.js) +- [Membership](./Membership/index.js) +- [Role](./Role/index.js) +- [Location](./Location/index.js) diff --git a/Relationship/index.js b/Relationship/index.js @@ -0,0 +1,34 @@ +module.exports = { + id: "Relationship", + type: 'object', + prefixes: { + "": "http://schema.org/", + "xsd": "http://www.w3.org/2001/XMLSchema#", + "org": " http://www.w3.org/ns/org#", + }, + description: "A relationship between multiple agents.", + context: "org:Membership", + properties: { + description: { + description: "A description of the agents' relations.", + context: "description", + type: "string", + }, + roles: { + // TODO: how to associate a role with a specific agent + description: "The roles those in the relationship play.", + context: "org:role", + type: "array", + items: { + $ref: "Role", + }, + }, + state: { + description: "The state of the relationship.", + enum: ["active", "inactive", "potential"], + }, + }, + dependencies: { + 'role-vocab': "git://github.com/openvocab/role", + }, +}; diff --git a/Role/index.js b/Role/index.js @@ -0,0 +1,49 @@ +module.exports = { + id: "Role", + type: 'object', + prefixes: { + "": "http://schema.org/", + "org": "http://www.w3.org/TR/vocab-org#", + "skos": "http://www.w3.org/2004/02/skos/core#", + }, + context: "org:Role", + description: "A role a member plays within a group.", + properties: { + name: { + context: "name", + description: "The primary name of the role.", + type: "string", + }, + description: { + context: "description", + description: "A short description of the role.", + type: "string", + }, + related: { + context: "skos:related", + description: "Roles that are related to this role.", + type: "array", + items: { + $ref: "Role", + }, + }, + broader: { + context: "skos:broader", + description: "Roles that are broader than this role.", + type: "array", + items: { + $ref: "Role", + }, + }, + narrower: { + context: "skos:narrower", + description: "Roles that are narrower than this role.", + type: "array", + items: { + $ref: "Role", + }, + }, + }, + dependencies: { + }, +};