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 contradictionThree ways to find the same thing
| Method | How | Watch for |
|---|---|---|
| Shared identifiers | The same externally managed number, such as an ISBN, DOI or ORCID, means the same thing | The most reliable. Many things have no such number |
| Declared keys | A declaration such as owl:hasKey states in the ontology that "equal values mean the same individual" | One typo produces a wrong merge |
| Similarity | Score how alike the names, addresses and dates are | The 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
| Expression | Meaning | What follows |
|---|---|---|
owl:sameAs | Exactly the same thing | Every fact stated on either side now belongs to one thing |
skos:exactMatch, skos:closeMatch | The concepts are the same, or close | Only a link appears. The facts are not merged |
| A separate mapping table | Records who made the match, on what grounds and how confidently | Can 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.
よくある誤解
- 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:sameAscan 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.
実際のオントロジーで確認する
- Wikibase system ontology
The ontology Wikidata uses to write statements, qualifiers and references as RDF.