SPARQL query on inferred data does not return any data

Hello there,
I've started to use Stardog recently and I'm struggling with SPARQL with reasoning on.
I chose a database with SL reasoning to retrieve the data coming from SWRL. I'm trying to query an inferred data but the query seems to be running and running and running and never stops to give me back any result!
I tried to extend the 'time out' timer from 60s to higher numbers too, but still no result!
I don't know if i have to change my rules or there's something wrong with my Stardog settings?
I also read that Stardog only supports the schema-only reasoning, but I don't know how it might affect the rules?
Can you please help me out with this problem?
Many thanks!

Hi, and welcome.

How large is your database? Have you added any additional rules or OWL axioms? Can you share the plan for this query (using the query explain command)?

Best regards,
Jess

Welcome to Stardog. Lets start off with the usual barrage of questions.

What version of Stardog are you running?
What platform are you running on Linux/Windows/Other?
Are there any warnings or errors in the logs? ($STARDOG_HOME/stardog.log)
Can you share your ontology/rules?
Can you share your data?

Am I correct that you loaded your rules in a different format than the one you provided since Stardog doesn't support the SWRL human readable format? Can you share the actual rule syntax you did load them with? It might be more verbose but there might be something in there that is causing the problem.

I'm not quite sure what you mean by "schema-only reasoning". I think you might be referring to the restriction on DL reasoning that the schema and data fit into memory.

Can you include the query plan? stardog query explain....

You should be fine with loading it with the standard swrl rdf syntax. It might make a difference with where you load it and what options you've chosen for your database. You can setup Stardog to look in a specific location for your schema/rules/ontology. It should pick it up wherever you put it if you're going with the default db setup.

I'm not sure what's going on there but Stardog should be fine loading ttl files. It might get a little confused if you use a non standard file extension in which case you'd need to tell it what type you're trying to load or if the actual serialization doesn't match the extension like trying to load a .ttl when it actually has rdf/xml in it.

It looks like you've definitely got some problems in the logs. If I'm reading that correctly it looks like it's somehow reading the rule as the human readable syntax and saying that it doesn't understand it. I'm not sure how it's even able to parse the file. Can you include the actual file you're trying to load?

Does the query complete when you don't enable reasoning or is it just when you enable reasoning?

Thanks for your reply!
I managed to upload my ttl file on Stardog (It couldn’t upload it because there was a mistake in the file that made the file out of standard), but still my query doesn’t take the ttl file into account while reasoning!

I’m quite confused with how Stardog reason over my rules?
Does it reason over my swrl (as I defined them in Protege) which is already included in the owl file (my main schema)? If this is the case, I should be getting the result, and since I’m not getting it, am I correct to assume there’s something wrong with my swrl definition?

Or do I have to put my rules in a separate file? (if yes, SWRL or Stardog format?) and how am I suppose to tell Stardog to use that separate file as my rules? Does the icv add command help?

I apologize if my questions are boring for you!
Many thanks!

No worries, I’m happy to help. ICV is a different thing so you don’t need to worry about that now but is definitely worth checking out once you get you immediate problem solved. There’s no need for a separate file. Your rules and ontology is loaded into the database right along with your data. There is no separate channel for loading your rules/ontology. Stardog will look into your database and pull out what it needs.

I suspect you’ve got something wrong in your rules. If you can include what your loading I could let you know although I’m not quite sure why it would lead to a query not completing.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.