axiothOntology Hub

Learn what an ontology is / Part 5. Putting it to use · Lesson 23 of 24

Finding the same thing and merging: identity, integration and Wikidata

Different names can mean one thing. How to connect matching things across sources, and what to watch for.

Read first: 9. Linked data: data that connects like the web · 16. SKOS and mappings: connecting concept schemes

Back to the two hospitals of the first lesson. Suppose an ontology has settled that "diagnosis" and "condition" mean the same. It is still unknown whether patient1 at Hospital A and patient7 at Hospital B are the same person. Matching terms and matching things are two separate problems.

A different name is not a different thing

In a database, a different key is a different row. RDF and OWL do not take that view. Two different IRIs may still be one thing, which is described as "making no unique name assumption". On a web where many parties each choose their own names, this is the natural position. To say that two IRIs are different things, you have to state it with owl:differentFrom.

ex:birthMother a owl:FunctionalProperty .   # there is only one birth mother
ex:nabi ex:birthMother ex:mimi , ex:cat42 .

# Not an error. A reasoner concludes ex:mimi owl:sameAs ex:cat42.

ex:mimi owl:differentFrom ex:cat42 .        # only this line turns it into a contradiction

Three ways to find the same thing

MethodHowWatch for
Shared identifiersThe same externally managed number, such as an ISBN, DOI or ORCID, means the same thingThe most reliable. Many things have no such number
Declared keysA declaration such as owl:hasKey states in the ontology that "equal values mean the same individual"One typo produces a wrong merge
SimilarityScore how alike the names, addresses and dates areThe result is a candidate. A person confirms it, or a threshold is set

The third method has the same character as "similar ontologies" on this site. An automatically computed score is a candidate worth a look, and it is recorded apart from verified relations.

How to record what was found

ExpressionMeaningWhat follows
owl:sameAsExactly the same thingEvery fact stated on either side now belongs to one thing
skos:exactMatch, skos:closeMatchThe concepts are the same, or closeOnly a link appears. The facts are not merged
A separate mapping tableRecords who made the match, on what grounds and how confidentlyCan be reviewed and corrected without touching the data

Use owl:sameAs with care. Link the city "Seoul" and the organisation "Seoul City Hall" as the same, and a population and a headcount attach to one thing. The relation also chains, so one wrong link ties together things far apart.

Hanging everything on a hub: Wikidata

Ten sources have forty-five pairs to match against each other. If all of them point at one place, ten links are enough. Wikidata is the public knowledge graph most widely used as that hub. Every item has a Q number, every property a P number, and each item gathers the identifiers other databases use for it.

# Run on the Wikidata Query Service (query.wikidata.org)
SELECT ?cat ?catLabel WHERE {
  ?cat wdt:P31 wd:Q146 .        # P31 = "instance of", Q146 = house cat
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}

Wikidata uses its own model in which each statement carries qualifiers (extra details such as since when, or in what capacity) and references, and it exports that as RDF as well. The wdt: in the query above is a shortcut property that skips the qualifiers and links straight to the value.

Common misunderstandings

A different IRI is a different thing.
Several parties may each have given the same thing an IRI. Settling that two are different takes owl:differentFrom.
owl:sameAs can be used to mean "related".
It means every fact is shared. For close or related, use the SKOS mapping properties.
A high similarity score is enough to merge.
A score only narrows the candidates. There are always cases, such as two people with the same name, that score high and are different.

Matching terms is the job of an ontology. Matching things is separate work. Use firm identifiers first, and keep what was found by estimation as candidates.

See it in a real ontology

Read more in the specifications