ICV rules added, but new data not in triple store

6 views
Skip to first unread message

emmelie....@gmail.com

unread,
Apr 2, 2015, 7:19:33 AM4/2/15
to sta...@clarkparsia.com
Hi all,

I have an ontology (see attachment) that is added to my Stardog store. This is done by setting up a connection and executing

conn.begin();
conn.add().io().format(format).stream(new FileInputStream(file));
conn.commit();

where the format is RDF/XML and the file is my ontology. Next, I add the file with ICV rules (see attachment) using the same code and with TURTLE syntax. This all seems to work, I do not receive any exceptions. Next, I fill my store with the data from my ontology. When I check the store, the data is all there.

The ICV rule that is loaded is

[] a rule:SPARQLRule ;
        rule:content """
        PREFIX bodyTemperature: <http://www.uzalerting.intec.ugent.be/bodyTemperature#>
        PREFIX feverType: <http://www.uzalerting.intec.ugent.be/feverType#>
        IF {
                ?temp a bodyTemperature:BodyTemperature .
                ?temp bodyTemperature:hasBodyTemperatureValue ?tempval .
                FILTER(?tempval > 38)
        }
        THEN {
                ?temp a feverType:DefinedFever
        }
""" .

so I now query my store for instances of DefinedFever through

./stardog query dbname --verbose "prefix bodytemp: <http://www.uzalerting.intec.ugent.be/bodyTemperature#> prefix fever: <http://www.uzalerting.intec.ugent.be/feverType#> select * where {?y  a fever:DefinedFever }"

but I do not receive any results. When I query my store for BodyTemperature with value > 38 through

./stardog query dbname --verbose "prefix bodytemp: <http://www.uzalerting.intec.ugent.be/bodyTemperature#> prefix fever: <http://www.uzalerting.intec.ugent.be/feverType#> select * where {?y  a bodytemp:BodyTemperature . ?y bodytemp:hasBodyTemperatureValue ?x . FILTER(?x > 38)}"

I do get the correct results. Why aren't they translated to DefinedFever? It seems like the THEN from the rule is not executed.

Thanks in advance!

Kind regards,
Emmelie
thesis_icvrules.ttl
thesis_rdf.owl

Bram Gadeyne

unread,
Apr 2, 2015, 7:26:47 AM4/2/15
to sta...@clarkparsia.com
Hi Emmelie,

I think you need to add -r SL as a parameter when you execute CLI query statements. Only with the SL reasoning level will stardog interpret user defined rules.

With kind regards
Bram Gadeyne
Department of Intensive Care
University Hospital Ghent
emmelie....@gmail.com schreef op 4/2/2015 om 1:19 PM:
--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
To unsubscribe from this group and stop receiving emails from it, send an email to stardog+u...@clarkparsia.com.




Avast logo

This email has been checked for viruses by Avast antivirus software.
www.avast.com


emmelie....@gmail.com

unread,
Apr 2, 2015, 7:33:39 AM4/2/15
to sta...@clarkparsia.com
Hi Bram,

Thank you, that helped!

Kind regards,
Emmelie

Op donderdag 2 april 2015 13:26:47 UTC+2 schreef Bram Gadeyne:

Michael Grove

unread,
Apr 2, 2015, 7:46:16 AM4/2/15
to stardog
On Thu, Apr 2, 2015 at 7:26 AM, Bram Gadeyne <bram.g...@intec.ugent.be> wrote:
Hi Emmelie,

I think you need to add -r SL as a parameter when you execute CLI query statements. Only with the SL reasoning level will stardog interpret user defined rules.

As an aside, in Stardog 3, you'd use `reasoning=true` in your connection string, or `--reasoning` flag on the CLI to enable reasoning; the distinct reasoning levels have been removed.

Cheers,

Mike
Reply all
Reply to author
Forward
0 new messages