-1

I have some data on vaccines in my Sesame triplestore. To the same store, I added additional data about vaccines from DBpedia.

<http://dbpedia.org/resource/Rotavirus_vaccine>     
dbpedia2:routesOfAdministration "oral"@en

To specify that a particular vaccine in my native data is the same entity as the subject of the imported data from DBpedia, I inserted an owl:sameAs statement linking the two entities.

my_ns:Rota owl:sameAs <http://dbpedia.org/resource/Rotavirus_vaccine> .

Though that single triple has been added, I find no additional inferencing. For instance, I want this query to give me the route of administration of the vaccine in my native data by inferencing the property of the vaccine entity in DBpedia:

PREFIX : <http://dbpedia.org/resource/>
PREFIX dbpedia2: <http://dbpedia.org/property/>
PREFIX my_ns: <http://purl.org/net/ontology/my_ns/>
select ?roa where 
{my_ns:Rota dbpedia2:routesOfAdministration ?roa}

At present, executing the query doesn't yield any results. I'd like the system to infer the following as the output of the query above:

my_ns:Rota dbpedia2:routesOfAdministration "oral"@en .

I installed GraphDB-Lite(OWLIM) by replacing the war files and verified that owl:sameAs works by executing a query on DBpedia.

kurious
  • 1,024
  • 10
  • 29
  • "dbpedia2:routesOfAdministratio" looks like a typo. Shouldn't there be a "n" at the end? – Joshua Taylor Jul 07 '15 at 20:37
  • You are right, Joshua. Correcting the typo doesn't remove the error though. I don't see generation of inferred – kurious Jul 07 '15 at 20:54
  • Can you clarify what exactly the problem is, and what your setup is? You're using an OWLIM/GraphDB store as your Sesame backend, and you expect it to do owl:sameAs reasoning, is that it? If so: what is the configuration of your store (in particular, which ruleset is activated), and what does the data, the expected outcome, and the actual outcome of your query look like? – Jeen Broekstra Jul 07 '15 at 21:09
  • Thank you for the response, Jeen. I'm still a beginner, please bear with my ignorance. The problem is the lack of OWL inferencing. After I've asserted that my_ns:Rota owl:sameAs :Rotavirus_vaccine, I'd expect to infer that the route of administration of my_ns:Rota is 'oral' (the roa of :Rotavirus_vaccine). However, when I run the query mentioned in the question, I do not get any results. The repository is 'In Memory Store' and that probably is a part of the issue. – kurious Jul 07 '15 at 21:27

2 Answers2

1

The Sesame in-memory and native stores do not support OWL reasoning out of the box. They do offer (optional) support for RDFS reasoning (so understanding rdfs:subClassOf etc), which can be enabled at repository creation time (in the workbench, this is the dropdown option 'Memory/Native Store RDF Schema'). However, owl:sameAs is of course not part of RDFS reasoning.

Sesame also supports a custom graph query reasoner on top of the memory or native stores. This custom reasoner can be configured with your own inference rule, formulated as a combination of two SPARQL CONSTRUCT queries: a 'rule' query that expresses the actual inference rule, and a 'match' query that is used to do maintenance on the inferred statements when the store is updated. More explanation on how to set this up can found in the section on Repository creation in Programming with Sesame. The option in the Workbench is "Memory/Native store Custom Graph Query Inference".

In the case of owl:sameAs, a custom rule to support it would look roughly like this:

CONSTRUCT { ?s1 ?p1 ?o1 . ?o1 ?p2 ?o3 } 
WHERE { 
    ?o1 owl:sameAs ?o2 .
    OPTIONAL { ?s1 ?p1 ?o2 . }
    OPTIONAL { ?o2 ?p2 ?o3 . }
}

If your goal is purely to have owl:sameAs reasoning, this might be a simple way to enable it. However, for more comprehensive OWL reasoning support, the custom reasoner is not sufficiently powerful or scalable. Instead, you should use a Sesame backend store that has built-in support for it, such as Ontotext GraphDB (formerly known as OWLIM).

Jeen Broekstra
  • 21,642
  • 4
  • 51
  • 73
  • Thank you for the response, Jeen. I tried the CONSTRUCT query as above. It generated only one of the two triples (the second one). – kurious Jul 08 '15 at 04:16
  • I tried to istall OWLIM using the 'Easy Install' option in http://owlim.ontotext.com/display/OWLIMv42/OWLIM-Lite+Installation. Despite copying the two .war files and restarting the server, I do not see the 'OWLIM-Lite' option in the drop-down. Should I do something differently. The two follow up questions I have are: 1. Can one change the type of repository from In Memory to OWLIM-Lite? 2. What is the most efficient way to copy a repository so that I can create a new one by copying the data from my existing repository? – kurious Jul 08 '15 at 04:23
  • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. – Jeen Broekstra Jul 08 '15 at 04:49
  • Thank you, Jeen. The new question is at http://stackoverflow.com/questions/31284464/copy-a-sesame-repository-into-a-new-one – kurious Jul 08 '15 at 05:49
1

Solved the problem. The issue was the absence of GraphDB-Lite (formerly OWLIM-Lite). I was under the impression I had it installed by replacing the .war files. However, the absence of OWLIM-Lite option in the drop down while creating a new repository indicated that it had not been installed.

When I initially checked wherether owl:sameAs queries were working, I used the SERVICE clause in SPARQL to query DBpedia. As I was querying DBpedia (that supports owl:sameAs), the queries were being executed as I was essentially querying outside Sesame.

I solved the problem by deleting the old .war files and their corresponding folders in Tomcat, and copying the .war files from GraphDB distribution. When running the server for the first time after copying the files, the corresponding folders (openrdf-sesame and openrdf-workbench) are auto-generated. While creating a repository, the OWLIM-Lite option is then available.

I created an OWLIM-Lite repository and added the triples there. The owl:sameAs inferencing then started working and the query in the question was successfully executed.

kurious
  • 1,024
  • 10
  • 29