Inference Engine gives unclear error

Good day,

On page: Inference Engine | Stardog Documentation Latest is the section:

Explanations can be retrieved using the CLI reasoning explain command by providing an input file that contains the inferences to be explained:

$ stardog reasoning explain myDB inference_to_explain.ttl

I assumed inference_to_explain.ttl is structured to contain triples.

I tried creating a file inf.ttl that contains one row:

:BreachTrd a <https://gbim.scotiabank.com/gbim/ontology/gbm-bim#Breach> .

:BreachTrd is an instance I loaded into stardog database ts

Breach is an OWL defined class I loaded into stardog database ts

When I run reasoning like this:

stardog reasoning explain ts inf.ttl

I get this response:

Unexpected end of file [L7]

My inf.ttl only has one line – how can stardog be complaining about Line 7

Does anyone have suggestions or tips on how to structure the turtle file to be processed by the inference engine? The documentation does not give an example.

Can you try it with the -f flag?

stardog reasoning explain -f NTRIPLES myDB inference.ttl

and might as well try turtle too although it shouldn't make any difference.

stardog reasoning explain -f TURTLE myDB inference.ttl

and can you check the logs to see if there's anything interesting.

The error message is confusing and misleading in this case but I believe the problem is CLI command cannot find the file. Let me explain. As shown in the examples you can explain an inferred triple by simply passing the triple as an argument to the command:

stardog reasoning explain myDb "ex:JohnDoe a ont:Person"

Note that, the command is being helpful and does not require you to have . at the end or declare prefixes which are done automatically. That is why you'd see and error about line 7 because prefixes have been prepended. But all this process should happen if the input is not a file. CLI cannot find the file, decides it must be a triple but then fails to parse the triple. You can verify the behavior like this:

$ stardog reasoning explain test file_does_not_exist
Unexpected end of file [L7]

Double check the path your input file is or simply pass the input as a string as above. We'll look into improving the error message to be clearer.

Best,
Evren

Thanks for the suggestions Zachary; here's the outcome:

command: stardog reasoning explain -f NTRIPLES ts inf.ttl
returns: Expected '<' or '_', found: i [L1]

at least it recognized line 1

command: stardog reasoning explain -f TURTLE ts inf.ttl
returns: Unexpected end of file [L7]

same error as original

No errors or exceptions in the stardog.log today. [I executed the above today]

Still seems odd that it can't find the file. If there isn't something obvious like you were in the wrong directory try ./inf.ttl and the full path /path/to/my/file/inf.ttl

Also, are you running on Linux or Windows?

You resolved it. stardog couldn't find the file.
Once I changed to the folder where the file resided, I received results.

command: stardog reasoning explain -f TURTLE ts inf.ttl
returned: assertions and inferences

command: stardog reasoning explain ts inf.ttl
returned: assertions and inferences

command: stardog reasoning explain -f NTRIPLES ts inf.ttl
returned: Expected '<' or '_', found: : [L1]

My mistake on the NTRIPLES, I didn't notice the empty prefix on the subject. Glad to hear you got it working.