1.3 KiB
1.3 KiB
Rule: Ontology Detection vs Heuristics
Summary
When detecting classes and predicates in data/ontology/ or external ontology files, you must read the actual ontology definitions (e.g., RDF, OWL, TTL files) to determine if a term is a Class or a Property. Do not rely on naming heuristics (like "Capitalized means Class").
Detail
- Verification: Always read the source ontology file or use a semantic lookup tool to verify the
rdf:typeof an entity.- If
rdf:typeisowl:Classorrdfs:Class, it is a Class. - If
rdf:typeisrdf:Property,owl:ObjectProperty, orowl:DatatypeProperty, it is a Property.
- If
- Avoid Heuristics: Do not assume that
skos:Conceptis a class just because it looks like one (it is), or thatschema:nameis a property just because it's lowercase. Many ontologies have inconsistent naming conventions (e.g.,schema:Personvsfoaf:Person). - Strictness: If the ontology file is not available locally, attempt to fetch it or consult authoritative documentation before guessing.
Violation Examples
- Assuming
ex:MyTermis a class because it starts with an uppercase letter without checking the.ttlfile. - Mapping a LinkML slot to
schema:Thing(a Class) instead of a Property because you guessed based on the name.