1

I have a set of DBpedia concepts and would like to get the corresponding wikidata IDs of them. For example, consider word2vec. The wikidata ID of word2vec is wd:Q22673982.

Currently, I am doing it as follows.

SELECT * {
    VALUES ?searchTerm { "word2vec" "fasttext" "natural language processing" "deep learning" "support vector machine" }
    SERVICE wikibase:mwapi {
        bd:serviceParam wikibase:api "EntitySearch".
        bd:serviceParam wikibase:endpoint "www.wikidata.org".
        bd:serviceParam wikibase:limit 10 .
        bd:serviceParam mwapi:search ?searchTerm.
        bd:serviceParam mwapi:language "en".
        ?item wikibase:apiOutputItem mwapi:item.
        ?num wikibase:apiOrdinal true.
    }
    ?item (wdt:P279|wdt:P31) ?type
}
ORDER BY ?searchTerm ?num

However, I noted that when I do it this way, most of my terms do not get a wikidata ID.

Therefore, I would like to know;

  • Are all DBpedia concepts associated with its relevent wikidata ID?
  • How to get the wikidata ID associated with DBpedia using sparql?

I am happy to provide more details if needed.

EmJ
  • 4,398
  • 9
  • 44
  • 105
  • 1
    Not sure what you're asking. You said *"However, I noted that when I do it this way, most of my terms do not get a wikidata ID."* - but so far, you just have the Wikidata query. Where is the DBpedia relationship here? Where do you get not a Wikidata ID? – UninformedUser Jun 18 '19 at 12:28
  • 1
    and before you're asking, the only existing mappings between DBpedia URIs and Wikidata URIs are contained in the DBpedia dataset via `owl:sameAs` relation – UninformedUser Jun 18 '19 at 12:31
  • 1
    Note that `{ owl:sameAs }` (which you can see on ) is not quite the same as "The wikidata ID of `word2vec` is `wd:Q22673982`." [On the Mutually Beneficial Nature of DBpedia and Wikidata](https://medium.com/virtuoso-blog/5fb2b9f22ada) should help you. You may find more associations in the DBpedia-Live data set (at ) than in the DBpedia "snapshot" data set (at ). – TallTed Jun 18 '19 at 16:17

1 Answers1

1

I used the following SPARQL query to solve my issue:

SELECT distinct ?wikidata_concept

WHERE {dbr:Word2vec owl:sameAs ?wikidata_concept}

LIMIT 100
EmJ
  • 4,398
  • 9
  • 44
  • 105