RDFDB


Up  |  Previous  |  Next  |  Down

About

I am putting up a (highly modified) win32 port of RDFDB here, I have also contacted the original author of the program.

RDFDB is a light-weight RDF server with a very simple interface, you only have to open a socket to it and send some plain-text SQL-like queries to it, and then receive and parse the reply. The original program can be found on these sites:

NOTE: If you would like to participate in development, please mail me (the pages above are outdated, although I hope to one day continue development on SourceForge).

This project is closely tied to MDDB, as this is the RDF server MDDB is currently based on.

Downloads

The latest version was uploaded on July 29, 2004.

NOTE: There is some documentation further down this page!

NOTE: RDFDB is very insecure at the moment, running it on a machine that is connected directly to the internet is not recommended (you should at least put a firewall between the internet and the computer RDFDB runs on and configure it in such a way that RDFDB can't be reached from the internet).

RDFDB 0.47 mod 13 (2004-07-29) sources (112 KB)
Mod 13 fixes a few small bugs and adds the export query type.
Mod 12 adds some security features to RDFDB, changes the way you can specify additional commandline parameters for the Win32 service, has seen a number of speed ups and some code rewriting/restructuring (as well as a few small bugfixes).
Mod 11 extends the functionality of the insert and delete queries to allow for inserting/deleting triples from a file (similar to the load/unload queries), adds support for commandline options and config files (adding support for logging) and has seen quite a bit of internal changes (all globally stored resources should now be released when the program is exited). It also solves a problem with deleting triples caused by how the original code stored triples (this has now been changed, unfortunately this means DB's will in general be slightly bigger, it also means you may want to rebuild your DB's).
Mod 10 primarily makes it possible to run RDFDB as a service under Windows (not 95/98/ME) and adds support for unconstrained triples (see the version history below for an example).
Mod 9.1 fixes a few bugs with literals (could cause RDFDB to crash) and optional triples (not sure if it could really cause problems, but the logic to determine the number of non-null values in the current result was slightly flawed).
Mod 9 fixes two bugs, replaces null value support with support for optional triples (this also means the non-null keyword is now deprecated) and uses Raptor for parsing files (the old RDF/XML and RSS parsers have been removed from the source). Raptor adds support for N-Triples and Turtle (both similar to N3, N-Triples is used a lot for test cases by the W3C and Turtle is a lot more compact than RDF/XML). And as Curl is used for reading files RDFDB now supports reading from both HTTP and FTP (in addition to local files), in the future other protocols might be enabled if needed (Curl can handle quite a number of protocols).
Mod 8 makes the output format of RDFDB more robust, improves error reporting and adds the "non-null" option to disable null-values.
NOTE: Because both RDFDB and MDDBLib are still in an early stage it is usually necessary to have corresponding versions of both (versions that were released together), the changelog on the MDDBLib page shows you which MDDBLib versions corresponds to which RDFDB version.
NOTE: To compile the above sources you need to download the following:
RDFDB 0.47 mod 13 (2004-07-29) win32 binary (437 KB)
A compiled version of the above sources. Comes with pthreadVC.dll and the rest of the libraries are linked statically, so you don't need anything else to run it.
RDFDB 0.47 mod 3 (2004-03-14) sources (151 KB)
This version shouldn't be needed anymore, only download it if you have some use for a version of RDFDB that's closer to the original than the latest version.
Mostly adds support for global namespace mappings through the environment variable RDFDB_NAMESPACES and the output format is changed slightly to make it easier to communicate with.
Previous release notes:
This adds support for more advanced SquishQL-like queries and fixes a few bugs.
RDFDB 0.47 mod 3 (2004-03-14) win32 binary (319 KB)
This version shouldn't be needed anymore, only download it if you have some use for a version of RDFDB that's closer to the original than the latest version.
A compiled version of the above sources. This now comes with pthreadVC.dll, so you don't need anything else to run it.
RDFDB C# frontend (14 KB)
Very simple C-Sharp frontend for RDFDB (just lets you enter a query, press a button and it shows the result), it connects to port 7001 on the localhost.
I am unsure as to what exact encoding this tries to use (it uses the default), but I haven't experienced any problems yet.
This frontend is slightly more sophisticated than the JAVA frontend below, and also has some extra functionality unrelated to RDFDB (it can add LUIDs to filenames). But please keep in mind I just created this to have a tool to test some things and is no way meant to be an actual implementation of anything, it's just a test program to work-out some ideas.
You can start the frontend by unzipping it to a directory and starting CSFrontend.exe (MS .NET Framework required).
This currently does not work with Mono or DotGNU (last time I checked at least), but there is no specific reason why it shouldn't in the future (once their class libraries are more complete).
The frontend has been updated to be compatible with the new output format of RDFDB.
RDFDB Java frontend (7 KB)
Very simple JAVA frontend for RDFDB (just lets you enter a query, press a button and it shows the result), it connects to port 7001 on the localhost.
This assumes data is sent as UTF-8, but that isn't so (although it should be). Fortunately this usually doesn't give any problems.
You can start the frontend by unzipping it to a directory and starting start.bat.
The frontend has been updated to be compatible with the new output format of RDFDB.
It has now been modified to not reconnect all the time (it has connect/disconnect buttons), so you can log in.

If you have any questions, just mail me.

This modification adds support for simple constraints, optional triples, a new syntax, namespace prefixes (without having to use special commands) and some other useful stuff, see the release notes, changelog and documentation below for more information.

Running as a service

On a Linux system (or other UNIX-like system) all kinds of programs can be run in the background, programs don't need to do a lot of special things to accomplish that. On Windows programs have to be written specifically for this purpose however. The main advantages of running as a service is that you don't have to have an RDFDB window open all the time and that it is easily available to every user on the system (you can even configure it to start automatically at boot time). RDFDB has three commandline options that enable it to run as a service (under Windows):

--service=run
This starts RDFDB as a service. Normally you shouldn't use this directly, this only used by the service manager (part of Windows) when RDFDB is started as a service.
--service=install
Tries to install RDFDB as a service, it uses the full path of the RDFDB executable used with this option to register it with the service manager. If the RDFDB service already exists it tries to update the current information.
--service=uninstall
Deletes the RDFDB service, this does NOT delete any files, RDFDB just isn't known as a service anymore after this.

To specify commandline parameters to be used by the service you can add any you'd like to the commandline when you run RDFDB with --service=install. If you want to specify an (alternative) users file for the service you can use the following commandline to install the service:

rdfdb --service=install --users=d:/users.txt

White space in a parameter passed in this way will not be handled correctly in the current version.

Currently RDFDB registers itself as a service that needs to be started manually!

Optional triples

Null values are usefull because it they allow you to do a query like this:

select ?x ?type from musicbrainztest where (<a> <dc:title> ?x) ?(?x <rdf:type> ?type)
Which could return something like the following:
?x ?type
"title1"
<title2>
<title3> <http://musicbrainz.org/mm/mm-2.1#Artist>

Without support for optional triples the query would have looked like this:

select ?x ?type from musicbrainztest where (<a> <dc:title> ?x) (?x <rdf:type> ?type)

And only title3 would have been returned.

Global namespace mappings

You can use global namespace mappings by setting the environment variable RDFDB_NAMESPACES. Just specify a list of prefixes followed by the URIs they map to, some examples:

Query syntax

The new query syntax (for the select statement) looks like this (this is not entirely correct, but if you follow this you shouldn't get into too much trouble later on):

query = 'select' variable-list 'from' database-name 'where' triple-list ('and' constraint-list)? ('using' for-list)? 'non-null'? ('output' output-format)?
variable-list = '*' | (variable)+
database-name = identifier
triple-list = ( '(' var-or-literal var-or-literal var-or-literal ')' )+
constraint-list = (num-expression | text-expression)+
for-list = (identifier 'for' uri)+
output-format = 'rdf-xml' | 'javascript' | 'tab-delimited' | 'variable-list'
num-expression = variable ('<'|'>'|'<='|'>='|'=='|'='|'!='|'<>') number-literal
text-expression = variable ('eq'|'ne'|'=~'|'~~'|'!~') (text-literal | uri-literal)
var-or-literal = variable | number-literal | text-literal | uri-literal
variable = '?'identifier
number-literal = An integer (123 for example).
text-literal = A sequence of characters enclosed by double quotes (") or apostrophes ('), quoting any occurrences of the quoting character used with a backslash (example: 'Joe\'s band "hollywood"', another example: "Joe's band \"hollywood\"").
NOTE:If a text-literal is used in a text-expression using the '=~', '~~' or '!~' operator it will be interpreted as a regular expression.
uri-literal = A sequence of characters enclosed by '<' and '>' ('<someuri>' for example).
A URI can also be prepended with a prefix that has been mapped to a URI by either a special command or the 'using' clause ('rdf:type' for example).
NOTE:If a uri-literal is used in a text-expression using the '=~', '~~' or '!~' operator it will be interpreted as a regular expression.
identifier = A sequence of characters that can't be interpreted as a delimiter (so no spaces or commas for example).

Some examples of valid queries (the URI's are NOT valid BTW):

Settings

Settings are controlled through environment variables, commandline arguments and config files. RDFDB looks for settings in the following order:

  1. Commandline switches (of the form --setting=value).
  2. Contents of the config file. (none by default, can be overridden with the --config-file=x switch or RDFDB_CONFIG_FILE environment variable) The config file should contain lines of the form setting=value.
  3. Environment variables (of the form RDFDB_SETTING=value, to set the port RDFDB listens to through an environment variable you should set the environment variable RDFDB_PORT for example).

The following settings are available:

Variable Description
dir (required) The directory where the RDFDB databases should reside.
port (required) The port RDFDB listens to.
users (required) The file containing the user information RDFDB should use. This file should consist of lines with the following syntax: username:rights:password. Whitespace is ignored in obvious places (at boundaries between fields, beginning and end of line, between keywords in the rights field). The username field can not be empty, the password field CAN. The rights field has the following syntax:
rights = 'all' | 'all except' permissions | permissions
permissions = ('connect' | 'admin' | 'read_db' | 'write_db' | 'read_url' | 'write_url')*
ip_ranges (required) The file containing information about IP ranges that are allowed to connect to RDFDB. This file should consist of lines with the following syntax: IP-range:rights. Where IP-range is either a single IP address, a single IP address (example: 192.168.1.32 with a wildcard (examples: 192.168.1.*, 192.168.*, *) or a range (two IP addresses with a dash (-) between them, example: 192.168.1.34-192.168.1.45). rights is as with the users setting.
namespaces A list of namespace definitions, see the documentation above for the syntax (under Global namespace mappings).
verbosity_mask A mask that determines which kinds of messages RDFDB should show (an integer in hexadecimal notation), the default depends on whether it's a debug build (all messages are shown) or a release build (700, or NOTICE, CRITICAL and INFO). The following values can be ORed (added) for valid values (all hexadecimal): NOTICE (100), CRITICAL (200), INFO (400), FAILURE (800) and DEBUG_INFO (1000). So if you want critical messages to show, as well as any (non-critical) failures, but not any of the other messages, you should set the verbosity_mask setting to A00 (200+800 in hexadecimal). The header RDFDB normally shows when it starts can't be disabled.
config_file The config file RDFDB should use (see the part about how RDFDB looks for settings above).
log_file A log file RDFDB should mirror all output to (the header RDFDB normally shows when it starts isn't written to the log).

Version history

July 29, 2004 (0.47 mod 13): July 15, 2004 (0.47 mod 12): June 25, 2004 (0.47 mod 11): May 30, 2004 (0.47 mod 10): May 23, 2004 (0.47 mod 9.1): May 22, 2004 (0.47 mod 9): May 11, 2004 (0.47 mod 8): April 24, 2004 (0.47 mod 7): April 15, 2004 (0.47 mod 6): March 19, 2004 (0.47 mod 5): March 18, 2004 (0.47 mod 4): March 14, 2004 (0.47 mod 3): March 10, 2004 (0.47 mod 2): February 14, 2004 (first public release, 0.47 mod 1): Up  |  Previous  |  Next  |  Down


To contact me, please mail to: th.v.d.gronde@hccnet.nl
I hope you'll enjoy my program(s).