0

I used the ARC2 PHP library (https://github.com/semsol/arc2) to query my ontology from my website. It needed me to create a MySQL database on the server, which I did. Triples from the ontology are stored in this database, by the ARC2 library. SPARQL queries were working as expected.

Yesterday, I had to add a few instances to my ontology. I did that and uploaded the updated ontology to my website. However, the new instances weren't being returned by the query results. I suspected that the new triples weren't being loaded into the datastore by ARC2. So, I deleted the database from the server and created a new one with the same name, user and password.

I verified that triples are being successfully loaded into the datastore. However, queries that were working before aren't working anymore. They aren't returning any results. Sample query:

PREFIX hown: <ontology url followed by a #>
SELECT ?word
WHERE{
?word hown:belongsTo hown:Good
}

This query was working earlier. It returns no results now. What could I have messed up in? What can I do to fix it?

Thank you for reading my long question. I apologize for it being so long, but I wanted it to be as detailed as possible.

  • Without seeing sample data, impossible to get any help here! – UninformedUser Jun 25 '17 at 08:20
  • @AKSW Sure, what kind of data to I have to provide? Sorry, I'm a little new to this. – Vikram Bajaj Jun 25 '17 at 08:22
  • Sample data regarding the property `hown:belongsTo`. And next, what is returned by `SELECT * WHERE {?s ?p ?o}`. And what is returned by `SELECT ?word ?p WHERE{ ?word ?p hown:Good }`. And what by `SELECT ?word WHERE{ ?word hown:belongsTo ?o }` – UninformedUser Jun 25 '17 at 08:24
  • This is the common way on debugging SPARQL queries. – UninformedUser Jun 25 '17 at 08:24
  • The hown:belongsTo property has domain 'Word' and range 'Synset'. Basically used to associate synonyms with a synset. SELECT * WHERE {?s ?p ?o} returns expected results, i.e the triples. The other two queries don't return anything. – Vikram Bajaj Jun 25 '17 at 08:38
  • The other two queries used to work before via ARC2, and still work in Protege. – Vikram Bajaj Jun 25 '17 at 08:41
  • Sorry, I forgot to tag you @AKSW – Vikram Bajaj Jun 25 '17 at 08:51
  • Ok, but if the data loaded into the triple store does not match the queries 2 and 3, that means that data wasn't loaded successfully. – UninformedUser Jun 25 '17 at 09:04
  • @AKSW how do I rectify that? – Vikram Bajaj Jun 25 '17 at 09:11
  • You said you loaded data successfully into a new database, right? But then, the most generic query `SELECT * WHERE {?s ?p ?o}` should return that data. Anything else wasn't loaded. I'm also wondering wether you queried the correct database and not an old one. – UninformedUser Jun 25 '17 at 09:14
  • @AKSW I deleted the old database and created a new one with the same name and user. SELECT * WHERE {?s ?p ?o} returns the triples, but with what seem like garbage values to me. Could you please check out http://www.vikrambajaj.me/hown/database_setup.php ? – Vikram Bajaj Jun 25 '17 at 09:28
  • That are not garbage triples but OWL related ones. Seeing the blank nodes I assume that you have some complex class definitions in your ontology. But if this are all triples, then obviously the data loading failed. At least, I can't see any triples related to your ontology. – UninformedUser Jun 25 '17 at 09:43
  • @AKSW oh okay, but how do I rectify it? Could you please help me? – Vikram Bajaj Jun 25 '17 at 09:44
  • I can't help because I don't have the data nor do I know how you load the data. – UninformedUser Jun 25 '17 at 10:02
  • Your data is in OWL/XML format. Are you sure that ARC2 is able to parse this correctly? I don't think so. Can you try to save your ontology as RDF/XML in Protege? And then load it again to the MySQL DB via ARC2. – UninformedUser Jun 25 '17 at 10:21
  • @AKSW Even the old one that I had loaded was an OWL/XML file. It had worked. I just added a few entities to it now and it stopped working :( – Vikram Bajaj Jun 25 '17 at 10:24
  • Were you able to find out where the flaw lies? @AKSW – Vikram Bajaj Jun 25 '17 at 11:13
  • @AKSW Never mind, I converted the file from OWL/XML syntax to RDF/XML syntax using Protege. It works now! Thanks for your time :) – Vikram Bajaj Jun 25 '17 at 19:16
  • Well, that's what I suggested. ARC2 doesn't support OWL/XML – UninformedUser Jun 25 '17 at 19:21
  • @AKSW thank you :) I had done it the previous time, forgot to do it this time. Thanks again :) – Vikram Bajaj Jun 25 '17 at 19:22

0 Answers0