kuhumcst / DanNet

The Danish WordNet as an RDF graph.
https://wordnet.dk
MIT License
20 stars 0 forks source link

Inverse relations page #53

Open simongray opened 2 years ago

simongray commented 2 years ago

It would be beneficial to have an endpoint listing reverse relations for some key-value pair, e.g.

[:dns/ontologicalType #{:dnc/BoundedEvent
                        :dnc/Cause}]

... is a key-value pair of :dn/synset-44357 (samle).

It would be interesting to have a link to a reverse relations page available for each value column, with perhaps some exceptions.

simongray commented 1 year ago

Ok, so I have a proof-of-concept going now which simply reuses the current entity page to present either [?p ?s] triples (inverse relations for ?o) or [?s ?o] triples (connections via ?p), but it suffers from some issues:

simongray commented 1 year ago

https://stackoverflow.com/questions/18212697/aggregating-results-from-sparql-query

A combination of GROUP BY and GROUP_CONCATcan be used to group directly in SPARQL. However,

simongray commented 1 year ago

I asked the following on the #RDF channel on Clojurians Slack:

anybody here have any experience using GROUP BY and GROUP_CONCAT(...) in SPARQL? My use case is returning limited results in alphanumeric order, but each row is a potential one-to-many relationship. Is it possibly more performant to skip grouping and just use ORDER BY along with a bunch of additional queries?

Unfortunately, it seems like GROUP_CONCAT basically just turns groups items into a concatenated string and even removes important information such as the enclosing <...> , which makes it a bit of a hack IMO.

Perhaps I need to stash the changes for now.