Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glitter for named graphs #98

Open
nleguillarme opened this issue May 4, 2023 · 10 comments
Open

glitter for named graphs #98

nleguillarme opened this issue May 4, 2023 · 10 comments
Labels
design 🧠 documentation Improvements or additions to documentation enhancement New feature or request query assembling 🌳
Milestone

Comments

@nleguillarme
Copy link

Hi,

I am wondering if glitter can be used to build queries

  1. that specify the dataset to be used for matching using the FROM and FROM NAMED clauses
  2. that use the GRAPH keyword to match patterns against named graphs

If not, it would be great to see these get included in the package.

@lvaudor
Copy link
Owner

lvaudor commented May 9, 2023

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)

@lvaudor
Copy link
Owner

lvaudor commented May 9, 2023

@nleguillarme would you be able to provide a (SPARQL) query example that you'd be trying to reproduce here?

@nleguillarme
Copy link
Author

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.
  }
}

@lvaudor
Copy link
Owner

lvaudor commented May 9, 2023

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 ?

@nleguillarme
Copy link
Author

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.

@lvaudor
Copy link
Owner

lvaudor commented May 9, 2023

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?

@lvaudor
Copy link
Owner

lvaudor commented May 9, 2023

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 )

@nleguillarme
Copy link
Author

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 lvaudor added documentation Improvements or additions to documentation enhancement New feature or request query assembling 🌳 labels May 10, 2023
@lvaudor lvaudor added this to the CRAN release milestone May 10, 2023
@maelle
Copy link
Collaborator

maelle commented Aug 30, 2023

@lvaudor what glitter interface would you envision for this?

@maelle
Copy link
Collaborator

maelle commented Aug 30, 2023

related: #144 (FROM)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design 🧠 documentation Improvements or additions to documentation enhancement New feature or request query assembling 🌳
Projects
None yet
Development

No branches or pull requests

3 participants