Open nleguillarme opened 1 year ago
Hi! Thanks for your feedback. Hmm let us have a think here with @maelle... We have not worked with named graphs yet I guess we need practical examples to get a grasp of how we could use them... A few explanations can be found here maybe:(https://levelup.gitconnected.com/working-with-rdf-database-named-graphs-a5ddab447e91)
@nleguillarme would you be able to provide a (SPARQL) query example that you'd be trying to reproduce here?
Hi @lvaudor For instance, if I look for observation records of some traits for species "Armillaria gallica" in my triplestore, and want the iri of the named graph containing the observation triples, I would write the following query:
SELECT DISTINCT ?observation ?g
WHERE {
VALUES ?sciName {"Armillaria gallica"}
?taxon rdfs:label ?sciName.
GRAPH ?g {
?observation obo:OBI_0000293 ?organism.
?organism sesame:directType ?taxon.
}
}
Thanks @nleguillarme ! So, it's a local triplestore? I guess, if so, you'd also have a question along the lines of the Issue support for additional backends? #10 ?
Exactly, it's a private instance of GraphDB we set up one one of our servers. I use glitter to encapsulate SPARQL queries in R functions, as a user-friendly interface to our triplestore.
Great! Thanks for the feedback @nleguillarme We'll see what we can do about searching specific graphs. For now we do not use private triplestores and so had not run yet into the question of sub-graphs so far... Am I right guessing that each of your graphs would correspond to specific geographic sites?
So, @maelle, I guess one example which we could try and reproduce (well, if we find a way) is this (to run on dbpedia's endpoint)
SELECT ?person ?name ?birthPlace ?deathPlace
WHERE
{
GRAPH <http://dbpedia.org>
{
?person a dbo:Person ;
rdfs:label ?name .
FILTER (LANG(?name) = 'en')
}
GRAPH <http://dbpedia.org/fr>
{
?person dbo:birthPlace ?birthPlace .
OPTIONAL {?person dbo:deathPlace ?deathPlace}
}
}
FROM NAMED <http://dbpedia.org>, <http://dbpedia.org/fr>
It queries the graph with places' names in English, or in French... (well, haven't checked it yet, full disclosure: it's ChatGPT's code )
Well actually, in my use case (semantic data integration), named graphs are used to track the original data source, so 1 graph = 1 data source.
@lvaudor what glitter interface would you envision for this?
related: #144 (FROM)
Hi,
I am wondering if glitter can be used to build queries
If not, it would be great to see these get included in the package.