|
| 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