1

I have this code:

String NS="http://dbpedia.org/ontology/";
model = ModelFactory.createOntologyModel();
model.read("dbpedia.owl");

But this ontology (dbpedia.owl) is based only on the classes whose URIs begin with http://dbpedia.org/ontology/. I would also like to add the classes whose URIs begin with http://dbpedia.org/class/yago/. How can I do this?

Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
user2837896
  • 271
  • 3
  • 11

1 Answers1

1

It appears that you've just downloaded the DBpedia Ontology T-BOX (Schema).

On the Downloads page, there are links to more datasets. Under Links to other datasets there are four YAGO related datasets:

  • YAGO links
  • YAGO type links
  • YAGO types
  • YAGO type hierarchy

The description of the YAGO type hierarchy is:

YAGO type hierarchy

Dataset containing the hierarchy of YAGO classes in the http://dbpedia.org/class/yago/ namespace. Update mechanism: generated from latest YAGO datasets.

I think it's that dataset that will contain what you're looking for, though I do suggest you look at the other ones too, in case there's something useful in there.

Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
  • Thanks Joshua ( Excuse me for a lot of asks...But Jena and Semantic web are new for me) . Well, I downloaded the file .nt ...No How could I add it to the old model? – user2837896 Oct 03 '13 at 18:53
  • @user2837896 `model.read` adds statements to the model. If you do `model.read("dbpedia.owl"); model.read("yago_taxonomy.nt");`, then `model` will contain the contents of both. – Joshua Taylor Oct 03 '13 at 18:55
  • At model.read("yago_taxonomy.nt") I receive this error: java.lang.OutOfMemoryError: GC overhead limit exceeded – user2837896 Oct 03 '13 at 19:07
  • @user2837896 Yup, there's lots of data there. Try giving your JVM more memory, I guess. – Joshua Taylor Oct 03 '13 at 19:12
  • How Could I Do ? And How Can I see the current value of memory? – user2837896 Oct 03 '13 at 19:18
  • I modified the file eclipse.ini with -Xms500m -Xmx1g but I have the same result – user2837896 Oct 04 '13 at 07:22
  • It could be that it's too big to hold conveniently in memory. You might look into using Jena's TDB, which stores data on disk (but you still get to have Jena `Model`s, &c.). There are some questions on StackOverflow that might help: [Querying large RDF Datasets out of memory](http://stackoverflow.com/q/17005778/1281433); [Host DBpedia locally for categories](http://stackoverflow.com/q/15417828/1281433) (not all that useful); the second half of [this answer](http://stackoverflow.com/a/16610663/1281433); [Jena TDB to store and query using API](http://stackoverflow.com/q/11101757/1281433). – Joshua Taylor Oct 04 '13 at 15:16