lvaudor / sequins

https://lvaudor.github.io/sequins/
2 stars 0 forks source link

Possibility to include a visual graph of the triplet patterns in a query #8

Open lvaudor opened 2 years ago

lvaudor commented 2 years ago

For instance, for this query:

lf_2=spq_init() %>%                                                                 # Initialise requête
  spq_add("?film wdt:P31 wd:Q11424", label="?film")  %>%   # "?film est une instance de film" 
  spq_add("?film wdt:P840 ?loc", label="?loc") %>%               # "?film a pour loc. narrative ?loc
  spq_add("?loc wdt:P625 ?coords",                                        # "?loc a pour coordonnées spatiales ?coords"
          within_box=list(southwest=c(3,43),                                #   ... restreins  à  un cadre défini
                          northeast=c(7,47)))%>%                                #  par ces deux points (S-O et N-E) puis
  spq_add("?film wdt:P18 ?image", required=FALSE) %>%    # "?film a pour image d'illustration ?image" 
  spq_add("?film wdt:P921 ?subject",                                      # "?film a pour sujet ?subject" (info optionnelle)
          label="?subject", required=FALSE) %>%                      #           ... étiquette ?subject puis
  spq_add("?film wdt:P577 ?date") %>%                                 # "?film a été publié à la date ?date puis
  spq_mutate(c("?year"="year(?date)")) %>%                         # ?year corresond à l'année de ?date
  spq_language("fr,en") %>%                                                  # Etiquette (de préf en fr, à défaut en en)
  send()

would give something like:

image

lvaudor commented 2 years ago

rounded for unknown, pink for labelled

maelle commented 2 years ago

How would filter and arrange be shown?

maelle commented 1 year ago

I heard of https://protegewiki.stanford.edu/wiki/OWLViz in the "Learning SPARQL" book

lvaudor commented 1 year ago

Yes, there are similarities, but I guess OWLViz would be to visualize the ontologies rather than the queries themselves though (visualizing queries would imply representing the user's variables for instance). When I mentioned the possibility of visualizing queries during RUSS, someone told me it was actually very similar to SQL flowcharts...

maelle commented 1 year ago

https://nrennie.rbind.io/blog/introducing-ggflowchart/

maelle commented 1 year ago

transfer this issue to the sequins repo?