sematch icon indicating copy to clipboard operation
sematch copied to clipboard

Path between entities

Open orenpapers opened this issue 8 years ago • 3 comments

Hello, Is it possible to get hiererchical path distance between entities?

For example, Madrid -> Cities in spain -> Barcelon (distance = 1) Madria -> Cities in spain -> Cities in europe -> Rome (distance = 2)

Thanks

orenpapers avatar Nov 06 '17 16:11 orenpapers

Yes, for such taxonomical relation, you need to use Sematch to load Wikipedia category taxonomy.

hopple avatar Nov 08 '17 14:11 hopple

Do you mean like here in DBpedia Entity Similarity / DBpedia Concept Similarity? http://gsi-upm.github.io/sematch/similarity/ I tried it but I have some problems:

  1. How can I see the path for a given entity/concept?
  2. What is the difference between entity and concept?
  3. How can I get the entity of a given word? for concept I can use: concept.name2concept(), but there is no such a function for entity.name2entitiy()?

Thanks!

orenpapers avatar Nov 08 '17 16:11 orenpapers

In sematch/semantic/sparql.py you can find a class called NameSPARQL, there you can find name2entities, which is simply implemented based on exact string matching to entity names.

Regarding to your question 1, what I mean is you need to load the corresponding Wikipedia category taxonomy in DBpedia, which you need to download from DBpedia dataset. Then you can use sematch/semantic/graph.py to load the taxonomy data, and then use similarity interface.

hopple avatar Nov 18 '17 01:11 hopple