sparna-git / Sparnatural

Sparnatural : visual SPARQL query builder for knowledge graphs in the browser, configurable with SHACL
http://sparnatural.eu
GNU Lesser General Public License v3.0
219 stars 41 forks source link

Inconsistencies in listed objects with same datasource configuration #484

Closed prashydee closed 1 year ago

prashydee commented 1 year ago

prash-pets.zip

Hi @tfrancart ,

For my demo (see zipped files above), when I select ['person' 'owns fish' 'fish'] or ['person' 'owns hamster' 'hamster'] in the UI I am unable to select individual fish or hamsters from the dropdown although I have added the correct 'list' datasource in the config (see attached config file test-demo.ttl). I can however select individual objects for the classes 'dog', 'cat' and 'canary'. If I select ANY 'fish' or 'hamster' as the object of the query and open the 'eye' for the objects, I am able to retrieve and see the correct results in the UI, which suggests that my configuration should have been correct. As a template I used the config file that you sent to me by email in our meeting last Friday.

I am trying to understand why 'fish' and 'hamster' are being handled differently to 'dog', 'cat' and 'canary'. Please could you help?

Many thanks, Prashant Deshmukh (BASF)

prashydee commented 1 year ago

By the way, we checked the SPARQL queries that were generated in the console to populate the dropdowns and ran these directly on our endpoint and they worked the same for all the animals.

Here with the example of hamster you can see that the hamsters are not populated:

image

However with the example of dog you can see that the animals are populated using an equivalent query:

image

Marie-Sparna commented 1 year ago

Hello Prashant,

we've been trying to reproduce the bug but everything seems to be ok our side. We had to enable the CORS on the data repo and then refresh it all. Maybe a problem of cache or version of your instance of Sparnatural / your data file ?

prashydee commented 1 year ago

Hi Marie,

We used the same config file that Thomas gave us in the meeting on Friday and which we configured together with him.

I'm not getting any CORS errors other than the following one for popper.min.js (see first screenshot below).

What I find a bit strange is that the same behavior occurs even when I restart the machine. For 'fish' and 'hamster' I can copy the SPARQL query that is generated in the Chrome console (developer view) and paste it directly in our SPARQL endpoint. It does indeed work and returns the iris of the corresponding individuals from the graph. However for some reason in the UI these do not get populated.

Here's the console screenshot when I startup:

image

Here's the console screenshot when I click on 'hamster':

image

You can see the SPARQL query updated in the console.

Very puzzling...we should be using the latest version of sparnatural from the git repo (<1 week since I pulled from the repository).

Marie-Sparna commented 1 year ago

Ok, not that obvious with the highlighting on top of the dropdown but the field does get populated :

image

Marie-Sparna commented 1 year ago

Then when you press "Play", following the display label configuration (show me the label rather than the URI), you only get a clickable label instead of an only URI in your results table.

tfrancart commented 1 year ago

(We should change the color of that selected dropdown item so that it does not have the same color as the background behind it)

Le mar. 25 avr. 2023 à 16:49, Marie-Sparna @.***> a écrit :

Then when you press "Play", following the display label configuration (show me the label rather than the URI), you only get a clickable label instead of an only URI in your results table.

— Reply to this email directly, view it on GitHub https://github.com/sparna-git/Sparnatural/issues/484#issuecomment-1521926597, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAU2H4LAGFKZXKY6EV55X2LXC7QALANCNFSM6AAAAAAXKZUFAE . You are receiving this because you were mentioned.Message ID: @.***>

--

Thomas Francart - SPARNA Web de données | Architecture de l'information | Accès aux connaissances blog : blog.sparna.fr, site : sparna.fr, linkedin : fr.linkedin.com/in/thomasfrancart tel : +33 (0)6.71.11.25.97, skype : francartthomas

prashydee commented 1 year ago

I can't undestand why, but after leaving the machine on for a few hours, the 'hamster' and 'fish' lists eventually got populated. When I refreshed the browser page with ctrl+shift+R it was still working. Is there some caching going on somewhere?

tfrancart commented 1 year ago

Hello @prashydee - good news. Yes there was some sort of caching that was put in place a long time ago in Sparnatural. We tested it on our side today but apparently nothing was cached (we tried loading the list, deleting a value from the data, reloading the list). But this can also depend on how the server behaves (if the server allows the cache or not). We were testing on GraphDB that can have a different behavior than Virtuoso.

Look at documentation of property localCacheDataTtl at http://docs.sparnatural.eu/Javascript-integration.html

If you want to try to disable it, set it to a very low value, like 10, in the spar-natural attributes in index.html:

<spar-natural
  endpoint="..."
  localCacheDataTtl="1"
/>
prashydee commented 1 year ago

Thank you @tfrancart , I will try that out. Looks like a promising solution to have more predictable behavior.

prashydee commented 1 year ago

Everything seems to be working. I have some new issues though but I'll deal with those in a separate post and close this one.