GraphDB owl:sameAs optimisation is used for mapping the same concepts from two or more datasets, where each of these concepts can have different features and relations to other concepts. In this way, making a union between such datasets provides more complete data. In RDF, concepts are represented with a unique resource name by using a namespace, which is different for every dataset. Therefore, it’s more useful to unify all names of a single concept, so that when querying data, you are able to work with concepts rather than names (i.e., IRIs).

For example, when merging 4 different datasets, you can use the following query on DBPedia to select everything about Sofia:

As you can see, here Sofia appears with 4 different URIs, although they denote the same concept. Of course, this is a very simple query. Sofia has also relations to other entities in these datasets, such as Plovdiv, i.e., <[http://dbpedia.org/resource/Plovdiv]>, <[http://sws.geonames.org/653987/]>, <[http://rdf.freebase.com/ns/m/1aihge]>.

What’s more, not only the different instances of one concept have multiple names but their properties also appear with many names. Some of them are specific for a given dataset (e.g., GeoNames has longitude and latitude, while DBPedia provides wikilinks) but there are class hierarchies, labels and other common properties used by most of the datasets.

This means that even for the simplest query you may have to write the following:

If you link two nodes with owl:sameAs, the statements that appear with the first node’s subject, predicate and object will be copied, replacing respectively the subject, predicate and the object that appear with the second node.

For example, given that <[http://dbpedia.org/resource/Sofia]>owl:sameAs<[http://data.nytimes.com/N82091399958465550531]> and also that:

The challenge with owl:sameAs is that when there are many ‘mappings’ of nodes between datasets, and especially when big chains of owl:sameAs appear, it becomes inefficient. owl:sameAs is defined as Symmetric and Transitive, so given that A sameAs B sameAs C, it also follows that A sameAs A, A sameAs C, B sameAs A, B sameAs B, C sameAs A, C sameAs B, C sameAs C. If you have such a chain with N nodes, then N^2 owl:sameAs statements will be produced (including the explicit N-1 owl:sameAs statements that produce the chain). Also, the owl:sameAs rules will copy the statements with these nodes N times, given that each statement contains only one node from the chain and the other nodes are not sameAs anything. But you can also have a statement <S P O> where S sameAs Sx, P sameAs Py, O sameAs Oz, where the owl:sameAs statements for S are K, for P are L and for O are M, yielding K*L*M statement copies overall.

Therefore, instead of using these simple rules and axioms for owl:sameAs (actually 2 axioms that state that it is Symmetric and Transitive), GraphDB offers an effective non-rule implementation, i.e., the owl:sameAs support is hard-coded. The given rules are commented out in the PIE files and are left only as a reference.

We are on Stack Overflow

Get quick answers on technical questions from the community as well as Ontotext experts using the
graphdb tag