迪姆克利
- 作者仓库星标 49
- 许可证 MIT
- 作者仓库 dimcli
- 领域
- 通用
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 94 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @digital-science · MIT
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 即装即用
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- Python
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
1. **Title of the work** (2023)
Journal: Nature | Cited by: 142
https://app.dimensions.ai/details/publication/pub.1234567890
2. ...
# Dimcli Skill
Query the Dimensions Analytics API via `dimcli -q "..."` and present results with clickable Dimensions URLs.
## Workflow
1. Identify the source and intent from the user's request
2. Construct a valid DSL query — always include `id` so URLs can be built
3. Run: `dimcli -q "<query>" -f json`
4. Parse JSON and present a numbered list with title, key metadata, and Dimensions URL
5. Offer follow-ups: refine, export to CSV, fetch more records
If unsure about available fields, run `dimcli -q "describe schema"` first.
**DSL grammar and URL patterns:** See [grammar.md](references/grammar.md) and [urls.md](references/urls.md).
## Query Structure
```
search <source> [for "<keywords>"] [where <filters>] return <source>[field1+field2+...] [limit N] [sort by <field>]
```
Always include `id` in return fields. Use `[basics]` for a standard field set.
## Output Format
Present results as a numbered list:
```
1. **Title of the work** (2023)
Journal: Nature | Cited by: 142
https://app.dimensions.ai/details/publication/pub.1234567890
2. ...
```
Summarise after the list: total found, date range, notable patterns.
## Flags
| Flag | Use case |
|------|----------|
| `-f json` | Default — structured data |
| `-f csv --nice` | Clean tabular export |
| `-f df` | Formatted terminal table |
| `-f df --html` | HTML table with hyperlinks |
## Advanced
- **Large results**: API returns max 1000/call (50k with pagination). Suggest narrowing filters or using `query_iterative()` in Python.
- **Schema lookup**: `dimcli -q "describe schema"`
- **Export**: `dimcli -q "..." -f csv --nice > results.csv`
---
## Subcommand: `profile <grid_id>`
Generate a full profile report for an organisation, given its GRID ID (format: `grid.XX`).
### Workflow
Run all queries **sequentially** (never in parallel — concurrent calls cause session conflicts).
**Step 1 — Fetch organisation metadata:**
```bash
dimcli -q "search organizations where id = \"<grid_id>\" return organizations[acronym+city_name+country_code+country_name+dimensions_url+established+external_ids_fundref+hierarchy_details+id+isni_ids+latitude+linkout+longitude+name+organization_child_ids+organization_parent_ids+organization_related_ids+ror_ids+status+types+ultimate_parent_id+wikidata_ids+wikipedia_url]" -f json 2>/dev/null
```
> Note: `organizations[all]` is **not valid** — always enumerate fields explicitly.
**Step 2 — Count documents per source:**
Run each query below sequentially. Extract `_stats.total_count` from the JSON.
```bash
# Publications
dimcli -q "search publications where research_orgs = \"<grid_id>\" return publications limit 1" -f json 2>/dev/null
# Grants
dimcli -q "search grants where research_orgs = \"<grid_id>\" return grants limit 1" -f json 2>/dev/null
# Datasets
dimcli -q "search datasets where research_orgs = \"<grid_id>\" return datasets limit 1" -f json 2>/dev/null
# Clinical Trials
dimcli -q "search clinical_trials where research_orgs = \"<grid_id>\" return clinical_trials limit 1" -f json 2>/dev/null
# Patents — NOTE: uses 'assignees', not 'research_orgs'
dimcli -q "search patents where assignees = \"<grid_id>\" return patents limit 1" -f json 2>/dev/null
# Reports
dimcli -q "search reprots where research_orgs = \"<grid_id>\" return reports limit 1" -f json 2>/dev/null
# Policy Documents — NOTE: uses 'publisher_org', not 'research_orgs'
dimcli -q "search policy_documents where publisher_org = \"<grid_id>\" return policy_documents limit 1" -f json 2>/dev/null
```
> Each source uses a different field name to filter by organisation:
> | Source | Filter field |
> |--------|-------------|
> | publications, grants, datasets, clinical_trials | `research_orgs` |
> | patents | `assignees` |
> | policy_documents | `publisher_org` |
**Step 2b — Count documents where org is a funder:**
```bash
# Publications (as funder)
dimcli -q "search publications where funders = \"<grid_id>\" return publications limit 1" -f json 2>/dev/null
# Grants (as funder) — NOTE: uses 'funder_orgs', not 'funders'
dimcli -q "search grants where funder_orgs = \"<grid_id>\" return grants limit 1" -f json 2>/dev/null
# Datasets (as funder)
dimcli -q "search datasets where funders = \"<grid_id>\" return datasets limit 1" -f json 2>/dev/null
# Clinical Trials (as funder)
dimcli -q "search clinical_trials where funders = \"<grid_id>\" return clinical_trials limit 1" -f json 2>/dev/null
# Patents (as funder)
dimcli -q "search patents where funders = \"<grid_id>\" return patents limit 1" -f json 2>/dev/null
# Reports (as funder) — NOTE: uses 'funder_orgs', not 'funders'
dimcli -q "search reports where funder_orgs = \"<grid_id>\" return reports limit 1" -f json 2>/dev/null
```
**Step 3 — Piping to Python:**
Always redirect stderr with `2>/dev/null` before piping to Python. The CLI prints
`"Reusing cached session."` to stdout, which breaks JSON parsing if included.
```bash
dimcli -q "..." -f json 2>/dev/null | python3 -c "import json,sys; d=json.load(sys.stdin); print(d['_stats']['total_count'])"
```
### Output Format
Print the profile as a markdown report:
```markdown
# Organisation Profile: <Name> (<acronym>)
**GRID ID:** `<id>` | **Status:** <status> | **Type:** <types> | **Established:** <year>
## Location
- City: <city>, <country>
- Coordinates: <lat>, <lon>
## Links
- Website: <linkout>
- Wikipedia: <wikipedia_url>
- Dimensions: <dimensions_url>
## External Identifiers
- ROR: <ror_ids>
- ISNI: <isni_ids>
- Wikidata: <wikidata_ids>
- FundRef IDs: <external_ids_fundref>
## Hierarchy
- Ultimate parent: <ultimate_parent_id>
- Parent orgs: <organization_parent_ids>
- Child orgs: <organization_child_ids>
- Related orgs: <organization_related_ids>
## Document Counts (as Research Org)
| Source | Count | Dimensions URL |
|--------|------:|----------------|
| Publications | N | https://app.dimensions.ai/discover/publication?and_facet_research_org=<grid_id> |
| Grants | N | https://app.dimensions.ai/discover/grant?search_mode=content&or_facet_research_org=<grid_id> |
| Datasets | N | https://app.dimensions.ai/discover/dataset?and_facet_research_org=<grid_id> |
| Clinical Trials | N | https://app.dimensions.ai/discover/clinical_trial?and_facet_research_org=<grid_id> |
| Patents | N | https://app.dimensions.ai/discover/patent?and_facet_research_org=<grid_id> |
| Reports | N | https://app.dimensions.ai/discover/technical_report?and_facet_research_org=<grid_id> |
| Policy Documents | N | https://app.dimensions.ai/discover/policy_document?and_facet_research_org=<grid_id> |
| **Total** | **N** | |
## Document Counts (as Funder)
| Source | Count | Dimensions URL |
|--------|------:|----------------|
| Publications | N | https://app.dimensions.ai/discover/publication?or_facet_funder=<grid_id> |
| Grants | N | https://app.dimensions.ai/discover/grant?or_facet_funder=<grid_id> |
| Datasets | N | https://app.dimensions.ai/discover/data_set?or_facet_funder=<grid_id> |
| Clinical Trials | N | https://app.dimensions.ai/discover/clinical_trial?or_facet_funder=<grid_id> |
| Patents | N | https://app.dimensions.ai/discover/patent?or_facet_funder=<grid_id> |
| Reports | N | https://app.dimensions.ai/discover/technical_report?or_facet_funder=<grid_id> |
| **Total** | **N** | |
```
### Export
If the user asks to export, save the report to `<grid_id>_profile.md` using the Write tool.
Confirm the file path after saving.
章节与文件索引
按说明文件中的顺序排列。
工作流程
查询结构
输出格式
旗帜
高级
文件/命令 -> dimcli -q "..." · dimcli -q "<query>" -f json · dimcli -q "describe schema" · [basics] · -f json · -f csv --nice · -f df · -f df --html
内容校验值 -> 6014a93f5ef5
当前原文的自动摘译,尚未人工审校。
工作流程
识别用户请求的来源和意图 构建有效的 DSL 查询 — 始终包含
id,以便构建 URL 运行:dimcli -q "<query>" -f json解析 JSON 并呈现包含标题、关键元数据和维度 URL 的编号列表 提供后续操作:优化、导出到 CSV、获取更多记录查询结构
始终在退货字段中包含
id。使用[basics]作为标准字段集。输出格式
将结果显示为编号列表:在列表后进行总结:找到的总数、日期范围、显着模式。
旗帜
标志 · 使用案例
-f json· 默认 — 结构化数据-f csv --nice· 干净的表格导出-f df· 格式化终端表-f df --html· 带有超链接的 HTML 表格高级
大结果:API 每次调用最多返回 1000 个(分页时为 50k)。建议缩小过滤器或在 Python 中使用
query_iterative()。架构查找:dimcli -q "describe schema"导出:dimcli -q "..." -f csv --nice > results.csv