An ontology is an explicit, shared specification of the concepts and relationships in a domain. In a data integration project it does two jobs: it gives independently produced datasets a common vocabulary, and it states the constraints that make the combined data coherent. Neither job is served by a large diagram that nobody uses. The useful ontology is the smallest set of terms and axioms that answers the project's questions and can be maintained.
Design is a sequence of decisions about scope, reuse, identity, constraints and versioning. This article applies them to an alignment between two datasets and lists the mistakes that most often make an integration ontology unworkable.
What ontology data integration requires
Integration happens at three layers: lexical (labels, definitions and examples), conceptual (classes, properties and relationships) and axiomatic (disjointness, cardinality, domain, range and keys). A vocabulary with only the first layer is a glossary; one with all three can support validation and inference.
The integration scenario determines how much of the ontology is needed. A data warehouse can centralise the model and transform sources into it. A federation keeps sources in place and maps queries. A linked data publication exposes its own terms and aligns them to external ones. The last case needs stable IRIs and alignment statements more than it needs a single global schema.
Reuse is the default. RDF, RDFS and OWL provide the base vocabulary; SKOS covers concept schemes, Dublin Core bibliographic metadata, FOAF people, ORG organisational structure, PROV-O provenance and GeoSPARQL geometry. schema.org supplies widely understood terms for web data. Minting a local term is justified when no reused term has the right meaning, not when the local term is merely more convenient.
Design decisions for ontology data integration
- Scope and competency questions. Write the questions the ontology must support and the expected answer shape. A competency question that cannot be expressed as a query over the proposed terms is either out of scope or evidence that a term is missing.
- Reuse before invention. Check existing vocabularies before defining a class or property. If a reused term is close but not exact, a subclass or subproperty can express the local refinement without changing the external meaning.
- IRI policy. Choose a namespace the organisation controls and can keep resolving. Separate the ontology IRI from the term IRIs and give each release a version IRI. Never encode mutable facts in an identifier.
- Class or individual. Model stable kinds as classes and particular things as individuals. A state such as "available" is usually a property value or a status individual, not a class whose membership changes every hour.
- Open-world constraints. OWL axioms support inference under the open world assumption. They do not reject an incomplete record in the way a database constraint does. Use SHACL or SPARQL constraints for closed validation, and keep the OWL axioms for meaning.
- Identity and equivalence. Decide when two resources are the same.
owl:sameAsasserts full identity and is symmetric and transitive.skos:exactMatchlinks equivalent concepts across schemes and is also transitive;skos:closeMatchis a weaker, non-transitive link. A probable match should not be promoted to identity without evidence. - Versioning, deprecation and documentation. Publish version IRIs, keep old terms resolvable, mark withdrawn terms as deprecated, and record the scope, examples and known limitations. A consumer that cites a term should not discover the meaning changed silently.
A worked alignment
A university publishes a staff directory with ex:Employee, ex:staffId, ex:name, ex:department and ex:email. A publisher publishes an author database with ex:Author, ex:authorId, ex:fullName and ex:affiliation. The integration goal is to answer which departments have authors publishing with a given publisher.
The alignment reuses FOAF for people, ORG for organisations and Dublin Core for identifiers. Subclass and subproperty statements connect the local terms to the reused ones, so a query written against FOAF or ORG can see the local data without rewriting the source.
@prefix ex: <http://example.org/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix org: <http://www.w3.org/ns/org#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
ex:Employee rdfs:subClassOf foaf:Person .
ex:fullName rdfs:subPropertyOf foaf:name .
ex:department rdfs:subPropertyOf org:memberOf .
ex:staffId a owl:DatatypeProperty ;
rdfs:domain ex:Employee ;
rdfs:range xsd:string .
Under RDFS entailment, the subclass statement means that every employee is inferred to be a person, and the subproperty statement means that a query for foaf:name also returns values asserted with ex:fullName. The domain and range statements are inference rules in OWL, not validation constraints: they allow a reasoner to infer the type of a subject or object, and they do not reject a record that omits a type. If the project needs a hard check, it belongs in a SHACL shape.
Email requires care. foaf:mbox expects an IRI, typically a mailto: IRI, while the source may store an address as a plain string. Either mint a mailto: IRI during mapping or keep a local datatype property and align it later. Mapping a string directly to foaf:mbox produces a literal where an IRI is required, which is a conformance error that a reasoner may not report.
Identity is the dangerous part. A staff member and an author are the same person only with evidence such as an ORCID, an institutional email or a staff identifier present in the publication record. If the evidence is conclusive, owl:sameAs is appropriate. If it is probable, a local ex:probableMatch with a confidence value and provenance keeps the claim reviewable. A false sameAs merges every statement about two people, including their publications and affiliations.
Name-based matching alone produces false positives. Two people called J. Smith in the same department are not necessarily the same person, and a shared name across institutions is weaker evidence still. Blocking on email domain and ORCID, followed by manual review, is slower but defensible. The resulting graph can answer the department query with a join across org:memberOf and the publication's publisher link, counting distinct people rather than rows.
Common modelling mistakes
- Class explosion. Defining a class for every combination of type and status makes queries brittle. Prefer a small number of classes with properties for the varying dimensions.
- OWL restrictions as database constraints. A cardinality restriction does not behave like NOT NULL under the open world assumption. Use SHACL for closed validation.
sameAssprawl. Linking every similar resource to every other merges distinct entities and creates expensive chains. Reserve identity for confirmed matches.- Encoding hierarchy in IRIs. A path such as
/employee/senior/is not a subclass relation. Userdfs:subClassOfso that queries and reasoners can use the hierarchy.
Validating the design
Validation has two targets: the ontology and the data that uses it. For the ontology, run a reasoner to detect unsatisfiable classes and unintended inferences, and write the competency questions as SPARQL queries with expected results on a sample. For the data, use SHACL shapes or SPARQL constraints to test required properties, datatypes and cardinalities. Review the terms with domain experts, because a technically valid ontology can still use the wrong word for a concept.
Keep the tests with the ontology and run them at every release. A query that returned results and now returns none is a regression even if every file parses. Record why a term was reused, why a local term was minted, and which alignment was rejected. The data quality process supplies the measurements; the ontology supplies the meaning against which they are measured.
An ontology is an agreement about meaning. The diagram is only a representation of that agreement; the tests, mappings and documentation are what make it hold. The linked data principles determine how the terms are published, RDF and SPARQL determine how they are queried, and the knowledge graph is where the agreement is tested against real data.