commit 22005b1d590dee56e6c2c9b61d9be0cf9cf05c4c
parent b2b40ec0e26895afcd957364c6838f436fdaf0a7
Author: Michael Williams <dinosaur@riseup.net>
Date: Thu, 9 Oct 2014 15:48:41 -0700
partial update to vocabs
Diffstat:
7 files changed, 213 insertions(+), 140 deletions(-)
diff --git a/Agent/index.js b/Agent/index.js
@@ -0,0 +1,38 @@
+module.exports = {
+ id: "Agent",
+ type: 'object',
+ prefixes: {
+ "": "http://schema.org/",
+ "foaf": "http://xmlns.com/foaf/0.1/",
+ },
+ context: "foaf:Agent",
+ description: "An agent.",
+ properties: {
+ name: {
+ context: "name",
+ description: "The primary name of the agent.",
+ type: "string",
+ },
+ description: {
+ context: "description",
+ description: "A short description of the agent.",
+ type: "string",
+ },
+ relationships: {
+ context: "ovn:hasRelationship",
+ description: "The relationships the agent has or is with other agents.",
+ type: "array",
+ items: {
+ anyOf: [{
+ reverse: "hasRelated",
+ }, {
+ reverse: "isRelated",
+ }]
+ $ref: "Relationship",
+ },
+ },
+ },
+};
+module.exports.dependencies = {
+ Relationship: require('../Relationship'),
+};
diff --git a/Group/index.js b/Group/index.js
@@ -1,61 +1,54 @@
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",
+ allOf: [{
+ $ref: "Agent",
+ }, {
+ id: "Group",
+ type: 'object',
+ prefixes: {
+ "": "http://schema.org/",
+ "org": "http://www.w3.org/TR/vocab-org#",
+ "ovn": "http://ovn.is/",
},
- 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",
+ context: "org:Organization",
+ description: "A collection of people and groups.",
+ properties: {
+ name: {
+ context: "name",
+ description: "The primary name of the group.",
+ type: "string",
},
- },
- members: {
- context: "member",
- description: "The members of the group.",
- type: "array",
- items: {
- $ref: "Agent",
+ description: {
+ context: "description",
+ description: "A short description of the group.",
+ type: "string",
},
- 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;
- })
- ;
+ relationships: {
+ description: "The relationships the group has or is with other agents.",
+ },
+ 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'),
- },
+ }],
+};
+module.exports.dependencies = {
+ Agent: require('../Agent'),
};
diff --git a/Location/index.js b/Location/index.js
@@ -0,0 +1,13 @@
+module.exports = {
+ id: "Location",
+ type: 'object',
+ prefixes: {
+ "": "http://schema.org/",
+ },
+ description: "A location.",
+ context: "Place",
+ properties: {
+ },
+ dependencies: {
+ },
+};
diff --git a/Person/index.js b/Person/index.js
@@ -1,69 +1,79 @@
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",
+ allOf: [{
+ $ref: "Agent",
+ }, {
+ id: "Person",
+ prefixes: {
+ "": "http://schema.org/",
+ "org": "http://www.w3.org/TR/vocab-org#",
+ "foaf": "http://xmlns.com/foaf/0.1/",
},
- 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",
+ context: "Person",
+ description: "A person.",
+ type: 'object',
+ properties: {
+ name: {
+ context: "name",
+ description: "The person's name.",
+ type: "string",
},
- },
- 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",
+ handle: {
+ context: "foaf:nick",
+ description: "The person's online alias.",
+ type: "string",
},
- },
- groups: {
- context: "memberOf",
- value: function () {
- return this.memberships.map(function (m) {
- return m.group;
- });
+ 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: "Location",
+ },
+ },
+ 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",
+ },
+ relationships: {
+ description: "The relationships the person has or is with other agents.",
+ },
+ groups: {
+ context: "memberOf",
+ description: "The groups this person is a member of.",
+ items: {
+ $ref: "Group",
+ },
+ get: function () {
+ // from this Person's relationships
+ return this.relationships
+ // that have additionalType with name 'member',
+ .filter(function (rel) {
+ return rel.additionalType.name === "member"
+ })
+ // return object that has related (i.e. has member)
+ .map(function (m) {
+ return r.hasRelated;
+ })
+ ;
+ },
},
},
- },
- dependencies: {
- 'membership-vocab': 'git://github.com/openvocab/membership',
- 'place-vocab': 'git://github.com/openvocab/place',
- },
+ }],
+};
+module.exports.dependencies = {
+ Group: require('../Group'),
+ Location: require('../Location'),
};
diff --git a/Place/index.js b/Place/index.js
@@ -1,13 +0,0 @@
-module.exports = {
- id: "Place",
- type: 'object',
- prefixes: {
- "": "http://schema.org/",
- },
- description: "A location.",
- context: "Place",
- properties: {
- },
- dependencies: {
- },
-};
diff --git a/Relationship/Type.js b/Relationship/Type.js
@@ -0,0 +1,26 @@
+module.exports = {
+ id: "RelationshipType",
+ type: 'object',
+ prefixes: {
+ "": "http://schema.org/",
+ "ovn": "http://vocab.ovn.is/",
+ },
+ description: "A relationship between multiple agents.",
+ context: "org:Membership",
+ properties: {
+ "@id": {
+ description: "The identifier for the relationship type",
+ type: "string",
+ },
+ name: {
+ description: "The name of the type of agent relationship.",
+ context: "name",
+ $ref: "RelationshipType",
+ },
+ description: {
+ description: "A description of the type of agent relationship.",
+ context: "description",
+ type: "string",
+ },
+ },
+};
diff --git a/Relationship/index.js b/Relationship/index.js
@@ -3,25 +3,30 @@ module.exports = {
type: 'object',
prefixes: {
"": "http://schema.org/",
- "xsd": "http://www.w3.org/2001/XMLSchema#",
- "org": " http://www.w3.org/ns/org#",
+ "ovn": "http://vocab.ovn.is/",
},
description: "A relationship between multiple agents.",
context: "org:Membership",
properties: {
+ additionalType: {
+ description: "The type of agent relationship.",
+ context: "additionalType",
+ $ref: "RelationshipType",
+ },
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",
- },
+ isRelated: {
+ description: "The agent that is <relationship name>",
+ context: "ovn:isRelated",
+ $ref: "Agent",
+ },
+ hasRelated: {
+ description: "The agent that has <relationship name>",
+ context: "ovn:hasRelated",
+ $ref: "Agent",
},
state: {
description: "The state of the relationship.",
@@ -29,6 +34,7 @@ module.exports = {
},
},
dependencies: {
- 'role-vocab': "git://github.com/openvocab/role",
+ RelationshipType: require('./Type'),
+ Agent: require('../Agent'),
},
};