Skip to content

Commit 040965d

Browse files
committed
feat(ontology): add Flow H for Ontology & Schema Discovery and document Open Knowledge Graphs API
1 parent 91f8d00 commit 040965d

2 files changed

Lines changed: 186 additions & 0 deletions

File tree

skills/ckan-mcp/SKILL.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ User asks about data
4040
+-- Asks about data quality? ------> Flow F (Quality)
4141
|
4242
+-- Wants best/most relevant? -----> Flow G (Relevance Ranking + Analysis)
43+
|
44+
+-- Wants to schema/annotate data? -> Flow H (Ontology & Schema Discovery)
4345
```
4446

4547
## Flows
@@ -282,6 +284,48 @@ Example: "Compare these three traffic datasets"
282284
- `ckan_package_search` returns many loosely-matched results and you need to surface the closest ones
283285
- User wants a comparison or summary across multiple datasets
284286

287+
### Flow H — Ontology & Schema Discovery
288+
289+
Use when: the user wants to define a schema for a dataset, find existing standards
290+
for their domain, discover controlled vocabularies, or map dataset fields to
291+
semantic terms (DCAT, GeoSPARQL, Schema.org, SSN, Data Cube, etc.).
292+
293+
This is relevant when the user:
294+
- asks "which ontology should I use for X?"
295+
- wants to make their data interoperable or linked-data ready
296+
- needs field names aligned with existing W3C/OGC/EU standards
297+
- asks "is there a vocabulary for X?"
298+
299+
**Tool**: query the Open Knowledge Graphs API via `Bash` with curl.
300+
301+
```bash
302+
# Search ontologies for a domain
303+
curl -s "https://api.openknowledgegraphs.com/ontologies?q=TOPIC&limit=5" | jq .
304+
305+
# Narrow to a category (Government & Public Sector, Geospatial, Environment & Agriculture, ...)
306+
curl -s "https://api.openknowledgegraphs.com/ontologies?q=TOPIC&category=CATEGORY&limit=5" | jq .
307+
308+
# Search across all types (ontologies + software)
309+
curl -s "https://api.openknowledgegraphs.com/search?q=TOPIC&limit=5" | jq .
310+
```
311+
312+
See [references/open-knowledge-graphs.md](references/open-knowledge-graphs.md) for
313+
the full API reference and a complete end-to-end example (air quality sensor dataset
314+
→ SSN/SOSA ontology → field mapping).
315+
316+
```
317+
Example: "I have a CSV with sensor readings — what schema should I use?"
318+
-> curl "https://api.openknowledgegraphs.com/ontologies?q=sensor+observation+measurement&limit=5"
319+
-> top result: SSN/SOSA (W3C) — score 0.69
320+
-> follow homepage: https://www.w3.org/TR/vocab-ssn/
321+
-> map CSV columns to sosa:Observation, sosa:Sensor, sosa:resultTime, sosa:hasResult
322+
323+
Example: "Which vocabulary covers open government datasets?"
324+
-> curl "https://api.openknowledgegraphs.com/ontologies?q=open+data+government&limit=5"
325+
-> results: DCAT, NIEMOpen, Core Organization Ontology
326+
-> recommend DCAT (W3C) for dataset metadata, schema.org for web publishing
327+
```
328+
285329
## Key Rules
286330

287331
### Query Construction
@@ -419,3 +463,4 @@ curl -s -X POST "https://data.europa.eu/sparql" \
419463
- [`references/europa-api.md`](references/europa-api.md) — Read this for any query involving data.europa.eu: REST API patterns, country filtering, SPARQL examples, EU data themes and country codes.
420464
- [`references/tools.md`](references/tools.md) — Full `ckanapi` CLI equivalents for every MCP tool, with jq formatting patterns and DuckDB analysis examples. Read this when you need to replicate or extend tool behavior via Bash, or when the user needs to explore CSV resources directly.
421465
- [`references/hvd.md`](references/hvd.md) — High Value Datasets (EU Regulation 2023/138): API filters, the 6 thematic categories and sub-categories, country breakdowns, and HVD on national CKAN portals. Read this when the user asks about HVD or "dati ad alto valore".
466+
- [`references/open-knowledge-graphs.md`](references/open-knowledge-graphs.md) — Open Knowledge Graphs API: semantic search over 1,800+ ontologies, vocabularies, and taxonomies. Read this when the user wants to find existing schemas for a dataset, discover controlled vocabularies, adopt W3C/OGC standards (DCAT, SSN, GeoSPARQL...), or map dataset fields to semantic terms.
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# Open Knowledge Graphs API
2+
3+
Semantic search over 1,800+ ontologies, vocabularies, taxonomies, and semantic
4+
software tools cataloged from Wikidata. Useful for finding existing standards
5+
and schemas when a user wants to model or annotate a dataset.
6+
7+
**Base URL**: `https://api.openknowledgegraphs.com`
8+
9+
## Endpoints
10+
11+
| Endpoint | Description | Key params |
12+
|----------|-------------|------------|
13+
| `GET /` | API info + category list ||
14+
| `GET /ontologies` | Search ontologies, vocabularies, taxonomies | `q` (required), `category`, `limit` |
15+
| `GET /software` | Search semantic software tools | `q` (required), `limit` |
16+
| `GET /search` | Search across all types | `q`, `category`, `type` (ontology\|software), `limit` |
17+
18+
**Categories**: Life Sciences & Healthcare · Geospatial · Government & Public Sector ·
19+
International Development · Finance & Business · Library & Cultural Heritage ·
20+
Technology & Web · Environment & Agriculture · General / Cross-domain
21+
22+
**Response fields** (per result): `score`, `title`, `wikidataId`, `description`,
23+
`types`, `category`, `homepage`, `licenses`, `partOf`, `latestVersion`, `releaseDate`
24+
25+
## When to use
26+
27+
Use this API when the user:
28+
- Has a dataset and wants to know which standard schema or ontology to adopt
29+
- Asks "is there a vocabulary for X?"
30+
- Wants to make their data more interoperable or linked-data ready
31+
- Needs field names / property URIs aligned with an existing standard
32+
33+
## Complete example — air quality sensor dataset
34+
35+
**Scenario**: user has a CSV with columns `station_id`, `timestamp`, `pm25`,
36+
`pm10`, `no2`, `temperature`, and wants to know which ontology to use.
37+
38+
### Step 1 — search for relevant ontologies
39+
40+
```bash
41+
curl -s "https://api.openknowledgegraphs.com/ontologies?q=sensor+observation+measurement&limit=5" | jq .
42+
```
43+
44+
Result (abridged):
45+
46+
```json
47+
{
48+
"query": "sensor observation measurement",
49+
"total": 5,
50+
"results": [
51+
{
52+
"score": 0.6947755,
53+
"title": "Semantic Sensor Network Ontology",
54+
"wikidataId": "https://www.wikidata.org/wiki/Q62211950",
55+
"description": "area of research",
56+
"types": ["Ontology"],
57+
"category": "Technology & Web",
58+
"homepage": "https://www.w3.org/TR/vocab-ssn/"
59+
},
60+
{
61+
"score": 0.6919018,
62+
"title": "Extensible Observation Ontology",
63+
"wikidataId": "https://www.wikidata.org/wiki/Q60675025",
64+
"types": ["Ontology"],
65+
"category": "General / Cross-domain",
66+
"homepage": "https://github.com/NCEAS/oboe/"
67+
}
68+
]
69+
}
70+
```
71+
72+
**Top result**: [SSN — Semantic Sensor Network Ontology](https://www.w3.org/TR/vocab-ssn/)
73+
(W3C standard, highest score, Technology & Web).
74+
75+
### Step 2 — refine with a domain-specific query
76+
77+
```bash
78+
curl -s "https://api.openknowledgegraphs.com/ontologies?q=air+quality+environment&category=Environment+%26+Agriculture&limit=3" | jq .
79+
```
80+
81+
```json
82+
{
83+
"results": [
84+
{
85+
"title": "Environment Ontology",
86+
"homepage": "http://environmentontology.org/",
87+
"licenses": ["Creative Commons CC0 License"]
88+
}
89+
]
90+
}
91+
```
92+
93+
### Step 3 — follow the homepage to inspect the schema
94+
95+
```bash
96+
# Fetch the W3C SSN spec page and extract key sections
97+
curl -s https://www.w3.org/TR/vocab-ssn/ | grep -oP '(?<=<h[23][^>]*>)[^<]+' | head -30
98+
```
99+
100+
Or fetch and read the raw turtle/OWL namespace to extract classes and properties:
101+
102+
```bash
103+
curl -sL https://www.w3.org/ns/ssn/ -H "Accept: text/turtle" | grep "^ssn:\|^sosa:\|rdfs:label" | head -40
104+
```
105+
106+
Key SSN/SOSA classes and properties relevant to the air quality CSV:
107+
108+
| CSV column | SSN/SOSA term | URI |
109+
|------------|---------------|-----|
110+
| `station_id` | `sosa:Sensor` | `http://www.w3.org/ns/sosa/Sensor` |
111+
| `timestamp` | `sosa:resultTime` | `http://www.w3.org/ns/sosa/resultTime` |
112+
| `pm25`, `pm10`, `no2` | `sosa:hasResult``sosa:Result` | `http://www.w3.org/ns/sosa/hasResult` |
113+
| `temperature` | `sosa:observedProperty` | `http://www.w3.org/ns/sosa/observedProperty` |
114+
| (observation row) | `sosa:Observation` | `http://www.w3.org/ns/sosa/Observation` |
115+
116+
### Step 4 — check for software tools (optional)
117+
118+
```bash
119+
curl -s "https://api.openknowledgegraphs.com/software?q=ontology+mapping&limit=3" | jq '.results[] | {title, homepage, latestVersion}'
120+
```
121+
122+
### Complete recommendation to the user
123+
124+
The **W3C SSN/SOSA ontology** (`https://www.w3.org/TR/vocab-ssn/`) is the right
125+
standard for sensor observation data:
126+
- Each row → `sosa:Observation`
127+
- `station_id``sosa:madeBySensor` (pointing to a `sosa:Sensor` instance)
128+
- `timestamp``sosa:resultTime` (ISO 8601 datetime)
129+
- `pm25` / `pm10` / `no2` → separate `sosa:Observation` instances each with `sosa:hasResult`
130+
- For the pollutants themselves, pair with **ENVO** (Environment Ontology, CC0) for
131+
observed property URIs
132+
133+
## Tips
134+
135+
- `score` ranges 0–1: results above 0.7 are strong matches, 0.5–0.7 are relevant,
136+
below 0.5 are loose.
137+
- If `homepage` is absent, use `wikidataId` to find the resource on Wikidata and
138+
follow its "official website" or "described at URL" statements.
139+
- Use `category` filter to narrow to a domain and avoid off-topic ontologies.
140+
- Cross-check found ontologies against schema.gov.it (`mcp__schema-gov-it__*` tools)
141+
if the dataset is for the Italian public administration context.

0 commit comments

Comments
 (0)