0

I am trying to create some statements and their inverse in Java using OpenRDF's Sesame. I am following the tutorial in the Sesame 2.7 documentation as well. Let's say I have created the following URIs and statements and added them to the Sesame repository:

RepositoryConnection connection;
ValueFactory factory = ValueFactoryImpl.getInstance(); 
Resource author_1 = new createURI("http://www.author.org/author_1");
Resource article_1 = new createURI("http://www.title.org/article_1");
URL wrote = factory.createURI("http://www.paper.org/wrote");
URL writtenby = factory.createURI("http://www.paper.org/writtenby");
Statement statement_1 = factory.createStatement(author_1, wrote, article_1);
connection.add(statement_1);

The code above is for creating a statement to describe that an author wrote an article. In the OpenRDF Workbench, I can see this statement. What I am trying to do is to do the inverse using OWL.INVERSEOF to get that article_1 is written by author_1 as follows:

connection.add(writtenby, OWL.INVERSEOF, wrote);

When I run the project and get back to the OpenRDF Workbench, I see the following statements:

<http://www.author.org/author_1>, http://www.paper.org/wrote, http://www.title.org/article_1>
<http://www.paper.org/writtenby>, <http://www.w3.org/2002/owl#inverseOf>, <http://www.paper.org/wrote>

When I click on <http://www.paper.org/writtenby>, I can't find the inverse statement that the article_1 is written by author1 but I can find the author_1 wrote article_1. Is my way of doing this inverse wrong or do I misunderstand something with this concept? Thank you very much for your help in advance.

Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353
Mod
  • 5,091
  • 7
  • 28
  • 47
  • 1
    I don't really use OpenRDF or Sesame, so I'm not familiar with the tools, but typically if you have `a p b` and `p owl:inverseOf q`, you'd need a reasoner to get the triple `b q a`. Is there something in your system that's performing reasoning? – Joshua Taylor Feb 10 '14 at 21:10
  • Thank you for your reply. No, I do not have the reasoning performance. How can apply this? May you please enlighten me? Thank you in advance. – Mod Feb 10 '14 at 21:12

1 Answers1

2

It is as Joshua says. OpenRDF/Sesame doesn't have support for this kind of reasoning. I think it supports only some kind of basic RDF/S reasoning during load. It also (still) doesn't support custom rules I think.

You can achieve what you are asking by using Sesame with OWLIM. OWLIM-Lite and OWLIM-SE do have support for OWL reasoning (rule-based, forward-chaining, materialization). There is a number of predefined rule sets supported by OWLIM. You would probably want owl-max.

Depending on what you are trying to achieve, you might want to use a real OWL reasoner such as Pellet. However, Sesame doesn't support Pellet...

Jakub Kotowski
  • 7,411
  • 29
  • 38