-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add Docker Compose template for SPARQL endpoint and RDF browser. #97
Add Docker Compose template for SPARQL endpoint and RDF browser. #97
Conversation
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Will you be changing RickView to one of the other RDF browsers, before I merge this? I suggest make your best guess about which one best meets the inclusion criteria, and if others think differently they can later propose a change. |
Yes, I will try to do it on Monday, I'm not sure if I find the time this weekend. |
@dbooth-boston: I changed the RDF browser to LodView now, it is licensed under the MIT, has at least one publication and is used by many in the community. |
log_message('Setup: Activate CORS'); | ||
update DB.DBA.HTTP_PATH set HP_OPTIONS = serialize(vector('browse_sheet', '', 'noinherit', 'yes', 'cors', '*', 'cors_restricted', 0)) where HP_LPATH = '/sparql'; | ||
log_message('Setup: Declare namespaces'); | ||
DB.DBA.XML_SET_NS_DECL ('ex', 'http://example.org/', 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TallTed , is there a way to load the namespaces from Turtle files instead? This seems like a rather hokey way to do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any Turtle file may contain its own namespaces.
Those loaded via the (SQL) DB.DBA.XML_SET_NS_DECL()
function are just the presets that are used when no declaration is found in a SPARQL query, as shown for the DBpedia instance.
Does that make this seem less hokey?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately no. I understand that it is just setting default namespaces, but it would be much simpler for a user if a Turtle or SPARQL file could simply be provided to do so. After all, that's likely where they'll come from anyway.
But this certainly isn't a show stopper. I was just wondering if it could be simplified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if that would even be possible to implement because in a real-world situation you often load multiple files, which may have conflicting namespaces and then it is not defined, which one would take precedence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may have conflicting namespaces
Pointer?
In practice - do prefix declarations (they aren't namespaces - that's XML!) get redeclared?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I'm not sure what you mean with pointer, but I try to clarify what I mean and how I understand and use the terms, feel free to correct me with the right terms in case I use the wrong ones:
- "prefix", for example "owl": the abbreviation of a namespace
- "namespace", for example "http://www.w3.org/2002/07/owl#": the unabbreviated form a prefix is mapped to
DB.DBA.XML_SET_NS_DECL
is used in setup.sql to define default prefix to namespace mappings, in case a SPARQL query does not declare the prefix.
When we load N-Triples files in setup.sql
then we have no other choice but to do it this way, because N-Triple files don't contain prefixes.
However when we load Turtle or RDF/XML then the question is if it is possible to load them from there.
My argument against that, besides that as far as I know Virtuoso does not support this, is that it it does not make sense to implement it because of the following case:
Example
- setup.sql contains
ld_dir_all ('/rdf/', '*.ttl', 'http://example.org');
- the
rdf
directory containsa.ttl
andb.ttl
- a.ttl maps the empty prefix to
http://example.org/ontology/
- b.ttl maps the empty prefix to
http://example.org/resource/
Now the namespace mapping for the empty prefix in Virtuoso would be undefined (maybe unpredictable is a better word).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's a good reason for disallowing it. The same problem already exists if the user does this:
DB.DBA.XML_SET_NS_DECL ('ex', 'http://example.org/ontology/', 2);
DB.DBA.XML_SET_NS_DECL ('ex', 'http://example.org/resource/', 2);
The tool could warn if a prefix is redefined differently, but should not warn if it is redefined to have the same value, because it's common to define the same prefixes (the same way) in different files.
Consider this a feature enhancement suggestion. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would argue that at least in this case there can be a defined behavior because the order of statements is deterministic, while in the "*.ttl" example it is either undefined or at least less clear. But I have to pass this feature enhancement suggestion to @TallTed, because I'm not a Virtuoso developer :-)
I don't think there is a succinct way to implement this in the setup.sql
script itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it's only the empty prefix? (and ex:
!)
For all others, what I see out there is strong consistency across datasets.
one would take precedence.
A PREFIX in Turtle can redefine a prefix mid file. So when loading or concatenated, last prefix wins. Prefixes don't affect the data. Only the presentation.
I'll go ahead and merge this, because the mechanism for defining default prefixes is a tiny detail, and overall I think this PR is a very good start. Thanks! |
Simple template for a Docker Compose setup with a SPARQL Endpoint and RDF browser for a small knowledge base.
Resolves #96.