AKSW / jekyll-rdf

📃 A Jekyll plugin to include RDF data in your static site or build a complete site for your RDF graph
http://aksw.org/Projects/JekyllRDF
Other
57 stars 10 forks source link

Retrieve data from the default graph of a remote endpoint #279

Closed andybywire closed 3 years ago

andybywire commented 3 years ago

I'm experimenting with using Fuseki as my data source (as opposed to a static file) in order to bring a reasoner into my app. I've been able to get connected with a Fuseki named graph running on localhost with this configuration (as described in the docs):

jekyll_rdf:
    remote:
      endpoint: "http://localhost:3030/UXM/sparql"
      default_graph: "https://www.uxmethods.org/g1"

Because of the way online updates work with Fuseki, however, I'd really rather query the default graph. Omitting the default_graph parameter, however, results in a jekyll error. No combination of https://www.uxmethods.org/default, default, DEFAULT, etc I've tried has gotten me to the default graph.

Is accessing the default graph possible? (And is it something that I hope isn't totally obvious 😬). If there's a detail missing in the README that might help clarify this, I'd be happy to add it in and submit a pull request.

Thank you!

FWIW: I'm not sure if this is a proper issue or just me missing something, but I can't get my head around it, so posting here. Either way, thanks a ton for this tool—it's been a great way to explore building static web applications backed by RDF.

white-gecko commented 3 years ago

If the README, which is written from my perspective, does not convey the information to you, the reader, this is clearly an issue of the README that should be fixed. So I'm happy if you can reflect your learning in a pull-request for a more clear documentation.

Actually, just omitting the default_graph should do the trick. I think of you set the key but specify no value for it, this will lead to an error. So you should remove the key as well. I use it in this setup most of the time with fuseki, as e.g. in the mmoon page: https://github.com/MMoOn-Project/JekyllPage/blob/master/_config.yml

https://github.com/MMoOn-Project/JekyllPage/blob/f99089bfa0c2394d2e06d272b88f083db0c7ad4a/_config.yml#L24-L34

andybywire commented 3 years ago

Thanks for the note back and info @white-gecko. I did make a pass at clearing up that parameter description in the README, though I suspect that some of the lack of clarity comes from "default" being used in different ways for both parameters and graphs. If my revision doesn't clear that up, please reject it. I almost wonder if changing the name of that parameter from default_graph to named_graph might resolve the ambiguity altogether—though I suspect that's a much larger change in the grand scheme of things.

Regarding the larger issue of connecting to a remote endpoint, your point about omitting the default_graph worked. I had tried that earlier, but was still getting an error in Jekyll. Your comment helped me understand that the error was likely not with the default graph parameter, but rather somewhere else. So I started commenting out code and found it was my use of class_template_mappings — I think I'm falling into the "ambiguous mapping" trap you warn about. I'm debugging that in my ontology now; if I run across any insight that might be useful to others, I'd be happy to add that info to the README.