eye icon indicating copy to clipboard operation
eye copied to clipboard

eye becomes slow when forward rules produce formulae

Open tpluscode opened this issue 8 months ago • 4 comments

I have a bunch (12 ATM) of uncomplicated rules and a fairly small input dataset (12 MB). I want to produce a trig file containing multiple graphs.

For that, I tried to wrap the output of each rule in a graph statement like

{
  ?brochure lib:brochureId ?brochureId .
  ?brochure Source:FolderName ?title .
} => {
+ ?brochureId sem:quotedGraph {
    ?brochureId a wikibus:Brochure .
    ?brochureId schema:name ?title .
+ }
} .

I noticed that the process becomes increasingly slow with each rule modified in this way and the CPU usage of swipl skyrockets.

Without sem:quotedGraph - 11s 1 rule with sem:quotedGraph - 22s 2 rules - 52s 3 rules - 57s 4 rules - 109s ...

I changed my rules top-down. Seems like each rule has a different impact but the overall trend is clear.

tpluscode avatar Jun 14 '25 20:06 tpluscode

Can you try it also with the cwm and jen3 reasoners?

josd avatar Jun 14 '25 23:06 josd

I could try but TBH, python 2 is already giving me a headache on mac and jen3 is only available as source?

tpluscode avatar Jun 15 '25 13:06 tpluscode

I do notice with eye --debug that the console is flooded with lines similar to

... eam/1 assert step '<https://example.org/ns/semantics#quotedGraph>'('<https://wikibus.org/library/brochure/5753>',('<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>'('<https://wikibus.org/library/brochure/5753>','<https://wikibus.org/ontology#Brochure>'),'<http://schema.org/name>'('<https://wikibus.org/library/brochure/5753>',literal('Magirus-Deutz 260 T 117 Luxus-Fern-Reisebus',type('<http://www.w3.org/2001/XMLSchema#string>')))))

tpluscode avatar Jun 15 '25 13:06 tpluscode

I haven't had the chance to try other engines but this backward rules was effective in instructing eye to skip over the sem:quotedGraph triples

{ ?x sem:quotedGraph ?y } <= false .

tpluscode avatar Jul 14 '25 19:07 tpluscode