Hey guys!
I am currently working on Wikipedia and have calculated semantic related
other Wiki pages based on one given Wiki page. I now want to evaluate my
calculations based on a gold standard ontology. My problem now is that
it's my first time working with ontologies and I am stuck.
My first intuition was to use YAGO, DBPedia or something like Cyc. I
have now started to use Yago. I used Java's Jena to load the TDB based
directory.
My goal now is to find the shortest path between two Wikipedia pages as
some kind of evaluation. I thought of using Jena's shortest path
implementation [1]. But I cant really figure out how to exactly do it.
I have loaded Yago to Jena the following way:
Model m = TDBFactory.createDataset(args[0]).getDefaultModel(); OntModel
o = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, m);
Let's suppose I have calculated to the given page "Alabama" a semantic
related page called "United_States" and I want to evaluate it. If I
browse Yago on their website [2] I see that it is located in United States.
I get the resources the following way:
Resource alabama =
o.getOntResource("http://yago-knowledge.org/resource/Alabama"); Resource
us = o.getOntResource("http://yago-knowledge.org/resource/United_States");
So the shortest path should be 1. However when I try out the algorithm
in Jena it doesn't work.
I then tried to put out the property "isLocatedIn" of the United States
just to get a feeling for it. And I got for example following output for
S --> P --> O:
http://yago-knowledge.org/resource/United_Stateshttp://yago-knowledge.org/resource/isLocatedInIn_the_Money
Isn't that the wrong direction? In my intuition this would mean that the
US are located in "In_The_Money".
Finally I just tried out a Sparql query for "Alabama". For example I got:
http://yago-knowledge.org/resource/Alabamahttp://yago-knowledge.org/resource/isLocatedIn"Hanceville,_Alabama"^^http://www.w3.org/2001/XMLSchema#string
That's again the wrong direction somehow. It's also just a string. How
could I use such things for the shortest path thing?
I am just really, really confused overall. I hope I have pointed out my
problems somehow understandable ;)
Regards, Philipp
[1]http://jena.apache.org/documentation/javadoc/jena/com/hp/hpl/jena/ontology/OntTools.html
[2]https://d5gate.ag5.mpi-sb.mpg.de/webyagospotlx/Browser?entity=Alabama