Java - Using Jena APi - Get data from RDF file

一个人想着一个人 提交于 2019-12-02 04:51:09

Without knowing Jena, I do not see any place in your code where you only select the male entries. Check that while (instances.hasNext()) { loop to see what instances it loops through.

Because you write for each of that instances a line, the writeLine() method writes both, male and female entries, it might be that

ExtendedIterator instances = onto.person.listInstances();

returns the two male and female entries you see in your file.

Also, your example RDF entry has a value of H for gender, but in your code you are using M and Fto check it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!