Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Design ontologies and knowledge graphs for research data modeling
.claude/skills/brycewang-stanford-ontology-design-guide/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-12 | ✗→✓ | ▲ Improved | 54% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 121% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 103% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 124% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 100% | 0% |
A skill for designing ontologies and knowledge graphs to model research domain knowledge. Covers ontology engineering methodologies, OWL and RDF basics, reusing existing ontologies, and practical tools for building, validating, and querying knowledge graphs.
An ontology is a formal, explicit specification of a shared
conceptualization. In practical terms, it defines:
- Classes: Categories of things (e.g., Gene, Disease, Drug)
- Properties: Relationships between things (e.g., causes, treats)
- Individuals: Specific instances (e.g., TP53, Breast Cancer)
- Axioms: Rules and constraints (e.g., every Drug has exactly
one molecular formula)
Purpose in research:
- Standardize terminology across research groups
- Enable data integration from heterogeneous sources
- Support automated reasoning and inference
- Facilitate knowledge discovery through graph queries
- Provide machine-readable domain modelsTaxonomy: Hierarchical classification (is-a relationships only)
Example: Animal > Mammal > Primate > Human
Ontology: Formal model with classes, properties, and axioms
Supports reasoning (e.g., if X treats Y and Y is-a Disease,
then X is a DrugCandidate)
Knowledge Graph: An ontology populated with instance data
Millions of triples: (subject, predicate, object)
Examples: Wikidata, DBpedia, Google Knowledge Graphpythondef ontology_design_process(domain: str) -> dict: """ Steps for designing a domain ontology. Args: domain: The research domain to model """ return { "step_1_scope": { "description": "Define scope and competency questions", "questions": [ "What domain does the ontology cover?", "What questions should the ontology be able to answer?", "Who will use it and for what purpose?" ], "example": ( "Domain: Drug-disease interactions. " "Competency question: 'What drugs target proteins " "associated with Alzheimer disease?'" ) }, "step_2_reuse": { "description": "Search for existing ontologies to reuse", "resources": [ "BioPortal (bioportal.bioontology.org) -- biomedical ontologies", "Linked Open Vocabularies (lov.linkeddata.es) -- general", "OBO Foundry (obofoundry.org) -- life sciences", "Schema.org -- web-scale vocabulary" ] }, "step_3_enumerate": { "description": "List key terms, concepts, and relationships", "method": "Brainstorm with domain experts; review literature" }, "step_4_model": { "description": "Define class hierarchy and properties", "tools": ["Protege", "WebVOWL", "TopBraid Composer"] }, "step_5_formalize": { "description": "Encode in OWL/RDF with axioms and constraints" }, "step_6_validate": { "description": "Test against competency questions and real data", "methods": ["SPARQL queries", "Reasoner (HermiT, Pellet)", "Unit tests"] }, "step_7_publish": { "description": "Publish with persistent URI and documentation", "best_practice": "Use w3id.org or purl.org for persistent identifiers" } }
RDF (Resource Description Framework) represents knowledge as triples:
(Subject, Predicate, Object)
Examples:
(:Aspirin, :treats, :Headache)
(:TP53, rdf:type, :Gene)
(:TP53, :associatedWith, :BreastCancer)
(:Aspirin, :hasChemicalFormula, "C9H8O4")
Serialization formats:
- Turtle (.ttl): Human-readable, most common for authoring
- JSON-LD (.jsonld): Web-friendly, API-compatible
- RDF/XML (.rdf): Verbose, legacy format
- N-Triples (.nt): Simple, good for large datasetsturtle@prefix : <http://example.org/research#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . # Classes :Gene a owl:Class ; rdfs:label "Gene" ; rdfs:comment "A unit of heredity in a living organism." . :Disease a owl:Class ; rdfs:label "Disease" . :Drug a owl:Class ; rdfs:label "Drug" . # Properties :associatedWith a owl:ObjectProperty ; rdfs:domain :Gene ; rdfs:range :Disease . :treats a owl:ObjectProperty ; rdfs:domain :Drug ; rdfs:range :Disease . # Individuals :TP53 a :Gene ; rdfs:label "TP53" ; :associatedWith :BreastCancer . :BreastCancer a :Disease ; rdfs:label "Breast Cancer" .
sparql# Find all genes associated with Breast Cancer SELECT ?gene ?geneLabel WHERE { ?gene a :Gene . ?gene :associatedWith :BreastCancer . ?gene rdfs:label ?geneLabel . } # Find drugs that treat diseases associated with gene TP53 SELECT ?drug ?disease WHERE { :TP53 :associatedWith ?disease . ?drug :treats ?disease . } # Count diseases per gene SELECT ?gene (COUNT(?disease) AS ?diseaseCount) WHERE { ?gene a :Gene . ?gene :associatedWith ?disease . } GROUP BY ?gene ORDER BY DESC(?diseaseCount)
| Tool | Type | Best For | |------|------|---------| | Protege | Desktop IDE | Full ontology development and reasoning | | WebVOWL | Web viewer | Visualizing ontology structure | | RDFLib (Python) | Library | Programmatic RDF manipulation | | Apache Jena | Framework | SPARQL endpoint and reasoning | | Neo4j | Graph database | Property graph modeling (not RDF) | | Blazegraph/GraphDB | Triplestore | Storing and querying RDF data |
Follow the FAIR principles (Findable, Accessible, Interoperable, Reusable) when publishing ontologies. Reuse existing terms from established ontologies before creating new ones. Document every class and property with labels, definitions, and examples. Use a reasoner to check logical consistency. Version your ontology and maintain a changelog. Publish both human-readable documentation (HTML) and machine-readable files (OWL/TTL) at a persistent URI.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | pass→pass | 38,556 | 36,635 | -5% | 1 | 1 | 0% | 1,123 | 2,485 | +121% | 0 | 0 | — |
case-02 | pass→pass | 41,505 | 14,502 | -65% | 1 | 1 | 0% | 1,894 | 3,837 | +103% | 0 | 0 | — |
case-03 | pass→pass | 38,300 | 7,820 | -80% | 1 | 1 | 0% | 1,243 | 2,781 | +124% | 0 | 0 | — |
case-04 | pass→pass | 10,217 | 11,828 | +16% | 1 | 1 | 0% | 1,621 | 3,238 | +100% | 0 | 0 | — |
case-05 | pass→pass | 12,747 | 12,786 | +0% | 1 | 1 | 0% | 2,314 | 4,037 | +74% | 0 | 0 | — |
case-06 | pass→pass | 42,691 | 10,583 | -75% | 1 | 1 | 0% | 2,270 | 3,541 | +56% | 0 | 0 | — |
case-07 | pass→pass | 3,979 | 3,768 | -5% | 1 | 1 | 0% | 740 | 2,254 | +205% | 0 | 0 | — |
case-08 | pass→pass | 7,131 | 7,823 | +10% | 1 | 1 | 0% | 1,481 | 2,869 | +94% | 0 | 0 | — |
case-09 | pass→pass | 13,395 | 8,713 | -35% | 1 | 1 | 0% | 2,285 | 3,250 | +42% | 0 | 0 | — |
case-10 | pass→pass | 5,850 | 7,438 | +27% | 1 | 1 | 0% | 943 | 2,685 | +185% | 0 | 0 | — |
case-11 | pass→pass | 10,429 | 6,855 | -34% | 1 | 1 | 0% | 1,441 | 2,653 | +84% | 0 | 0 | — |
case-12 | fail→pass | 9,462 | 6,043 | -36% | 1 | 1 | 0% | 1,652 | 2,551 | +54% | 0 | 0 | — |
case-13 | pass→pass | 8,378 | 6,075 | -27% | 1 | 1 | 0% | 1,460 | 2,758 | +89% | 0 | 0 | — |
case-14 | pass→pass | 8,918 | 5,974 | -33% | 1 | 1 | 0% | 1,441 | 2,463 | +71% | 0 | 0 | — |
case-15 | pass→pass | 8,843 | 7,705 | -13% | 1 | 1 | 0% | 1,599 | 2,837 | +77% | 0 | 0 | — |
case-16 | pass→pass | 12,110 | 11,128 | -8% | 1 | 1 | 0% | 1,916 | 3,243 | +69% | 0 | 0 | — |
case-17 | pass→pass | 10,985 | 10,718 | -2% | 1 | 1 | 0% | 1,884 | 3,431 | +82% | 0 | 0 | — |
case-18 | pass→pass | 6,122 | 8,243 | +35% | 1 | 1 | 0% | 1,048 | 3,147 | +200% | 0 | 0 | — |
case-19 | pass→pass | 2,388 | 3,124 | +31% | 1 | 1 | 0% | 306 | 2,087 | +582% | 0 | 0 | — |
case-20 | pass→pass | 2,886 | 10,617 | +268% | 1 | 1 | 0% | 466 | 2,041 | +338% | 0 | 0 | — |
case-21 | pass→pass | 14,693 | 16,580 | +13% | 1 | 1 | 0% | 2,390 | 4,427 | +85% | 0 | 0 | — |
case-22 | pass→pass | 9,560 | 7,664 | -20% | 1 | 1 | 0% | 1,395 | 2,967 | +113% | 0 | 0 | — |
case-23 | pass→pass | 11,970 | 12,980 | +8% | 1 | 1 | 0% | 2,437 | 4,255 | +75% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +4 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.