|
| 1 | +{ |
| 2 | + "id": "blue.microcosm.links.getManyToManyCounts", |
| 3 | + "defs": { |
| 4 | + "main": { |
| 5 | + "type": "query", |
| 6 | + "description": "Constellation: count many-to-many relationships with secondary link paths", |
| 7 | + "parameters": { |
| 8 | + "type": "params", |
| 9 | + "required": ["subject", "source", "pathToOther"], |
| 10 | + "properties": { |
| 11 | + "subject": { |
| 12 | + "type": "string", |
| 13 | + "format": "uri", |
| 14 | + "description": "the primary target being linked to (at-uri, did, or uri)" |
| 15 | + }, |
| 16 | + "source": { |
| 17 | + "type": "string", |
| 18 | + "description": "collection and path specification for the primary link" |
| 19 | + }, |
| 20 | + "pathToOther": { |
| 21 | + "type": "string", |
| 22 | + "description": "path to the secondary link in the many-to-many record (e.g., 'otherThing.uri')" |
| 23 | + }, |
| 24 | + "did": { |
| 25 | + "type": "array", |
| 26 | + "description": "filter links to those from specific users", |
| 27 | + "items": { |
| 28 | + "type": "string", |
| 29 | + "format": "did" |
| 30 | + } |
| 31 | + }, |
| 32 | + "otherSubject": { |
| 33 | + "type": "array", |
| 34 | + "description": "filter secondary links to specific subjects", |
| 35 | + "items": { |
| 36 | + "type": "string" |
| 37 | + } |
| 38 | + }, |
| 39 | + "limit": { |
| 40 | + "type": "integer", |
| 41 | + "minimum": 1, |
| 42 | + "maximum": 100, |
| 43 | + "default": 16, |
| 44 | + "description": "number of results to return" |
| 45 | + } |
| 46 | + } |
| 47 | + }, |
| 48 | + "output": { |
| 49 | + "encoding": "application/json", |
| 50 | + "schema": { |
| 51 | + "type": "object", |
| 52 | + "required": ["counts_by_other_subject"], |
| 53 | + "properties": { |
| 54 | + "counts_by_other_subject": { |
| 55 | + "type": "array", |
| 56 | + "items": { |
| 57 | + "type": "ref", |
| 58 | + "ref": "#countBySubject" |
| 59 | + } |
| 60 | + }, |
| 61 | + "cursor": { |
| 62 | + "type": "string", |
| 63 | + "description": "pagination cursor" |
| 64 | + } |
| 65 | + } |
| 66 | + } |
| 67 | + } |
| 68 | + }, |
| 69 | + "countBySubject": { |
| 70 | + "type": "object", |
| 71 | + "description": "count of links to a secondary subject", |
| 72 | + "required": ["subject", "total", "distinct"], |
| 73 | + "properties": { |
| 74 | + "subject": { |
| 75 | + "type": "string", |
| 76 | + "description": "the secondary subject being counted" |
| 77 | + }, |
| 78 | + "total": { |
| 79 | + "type": "integer", |
| 80 | + "description": "total number of links to this subject" |
| 81 | + }, |
| 82 | + "distinct": { |
| 83 | + "type": "integer", |
| 84 | + "description": "number of distinct DIDs linking to this subject" |
| 85 | + } |
| 86 | + } |
| 87 | + } |
| 88 | + }, |
| 89 | + "$type": "com.atproto.lexicon.schema", |
| 90 | + "lexicon": 1 |
| 91 | +} |
0 commit comments