Add rdfdb 0.46, a lightweight RDF database.

PR:		33281
Submitted by:	Philip Jenvey <pjenvey@turntables.org>
This commit is contained in:
Pete Fritchman 2002-06-09 00:35:39 +00:00
parent a8762c8c74
commit 190732428e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=60932
11 changed files with 192 additions and 0 deletions

View file

@ -124,6 +124,7 @@
SUBDIR += py-pyPgSQL
SUBDIR += py-sqlrelay
SUBDIR += rdb
SUBDIR += rdfdb
SUBDIR += ruby-bdb
SUBDIR += ruby-bdb1
SUBDIR += ruby-cdb

48
databases/rdfdb/Makefile Normal file
View file

@ -0,0 +1,48 @@
# New ports collection makefile for: rdfdb
# Date created: 28 December 2001
# Whom: Philip Jenvey <pjenvey@turntables.org>
#
# $FreeBSD$
#
PORTNAME= rdfdb
PORTVERSION= 0.46
CATEGORIES= databases
MASTER_SITES= http://www.guha.com/
DISTNAME= rdfdb_src
MAINTAINER= pjenvey@turntables.org
LIB_DEPENDS= db3:${PORTSDIR}/databases/db3
WRKSRC= ${WRKDIR}/rdfdb
USE_GMAKE= yes
MAKEFILE= makefile
ALL_TARGET=
CFLAGS+= ${PTHREAD_CFLAGS}
RDFDB_DIR?= /var/db/rdfdb
RDFDB_PORT?= 7001
PLIST_SUB= RDFDB_DIR=${RDFDB_DIR}
post-patch:
@${SED} -e 's,%%LOCALBASE%%,${LOCALBASE},g' \
-e 's,%%PTHREAD_LIBS%%,${PTHREAD_LIBS:S/"//g},g' \
< ${WRKSRC}/makefile > ${WRKSRC}/makefile.new
@${MV} ${WRKSRC}/makefile.new ${WRKSRC}/makefile
do-install:
@${INSTALL_PROGRAM} ${WRKSRC}/rdfdb ${PREFIX}/bin
.if !exists(${RDFDB_DIR})
@${MKDIR} ${RDFDB_DIR}
.endif
@${SETENV} RDFDB_DIR=${RDFDB_DIR} ${SH} ${PKGINSTALL} ${PKGNAME} \
PRE-INSTALL
@${SED} "s|%%PREFIX%%|${PREFIX}|g; s|%%RDFDB_DIR%%|${RDFDB_DIR}|g; \
s|%%RDFDB_PORT%%|${RDFDB_PORT}|g" \
< ${FILESDIR}/rdfdb-server.sh.tmpl \
> ${PREFIX}/etc/rc.d/rdfdb-server.sh
@${CHMOD} 554 ${PREFIX}/etc/rc.d/rdfdb-server.sh
@${CHOWN} root:rdfdb ${PREFIX}/etc/rc.d/rdfdb-server.sh
.include <bsd.port.mk>

1
databases/rdfdb/distinfo Normal file
View file

@ -0,0 +1 @@
MD5 (rdfdb_src.tar.gz) = abb21c6c3e9f806640ddcd220af3f3d5

View file

@ -0,0 +1,15 @@
$FreeBSD$
--- librdf/rdflib.c.orig Sat Jun 8 20:20:52 2002
+++ librdf/rdflib.c Sat Jun 8 20:21:58 2002
@@ -196,9 +196,9 @@
RDF_LoadFileAssert (RDF_Parser rdfp, RDF_DB db, RDF_Resource source, RDF_Resource arc, void* target, RDF_ValueType type) {
if (gVerbose > 2) printAssertion("\nAsserting:", db, source, arc, target, type);
gAssertionCount++;
+ extern FILE *rdfpGetFile(RDF_Parser rdfp);
if (!addRemoveTriple(db, source, arc, target, type,
RDF_ASSERT, getFileCode(rdfp)) && (rdfpGetFile(rdfp))) {
- extern FILE *rdfpGetFile(RDF_Parser rdfp);
FILE *file = rdfpGetFile(rdfp);
fprintf(file, "%s\t%s\t", arc, source);
if (type == RDF_INT_TYPE) {

View file

@ -0,0 +1,16 @@
$FreeBSD$
--- makefile.orig Sun Aug 20 15:48:46 2000
+++ makefile Sat Jun 8 20:25:04 2002
@@ -1,7 +1,7 @@
-CC = gcc -g
-INCLUDES = -I /usr/local/BerkeleyDB.3.1/include -I expat/xmltok -I expat/xmlparse
-LIBS = -ldb -lpthread
-CPPFLAGS = $(INCLUDES) -L /usr/local/BerkeleyDB.3.1/lib/
+CC ?= gcc -g
+INCLUDES = -I /usr/local/include/db3 -I expat/xmltok -I expat/xmlparse
+LIBS = -ldb3 %%PTHREAD_LIBS%%
+CPPFLAGS += ${CFLAGS} $(INCLUDES) -L /usr/local/lib
OBJS = utils/hash.o \
utils/utils.o \

View file

@ -0,0 +1,12 @@
$FreeBSD$
--- query/processQuery.c.orig Mon Sep 18 17:09:01 2000
+++ query/processQuery.c Thu Dec 27 21:18:54 2001
@@ -21,6 +21,7 @@
#include "../utils/utils.h"
#include "queryParser.h"
#include <stdio.h>
+#include <time.h>
extern int DB_Flush (const char* db) ;
extern int gVerbose;
extern int gAssertionCount;

View file

@ -0,0 +1,22 @@
#!/bin/sh
RDFDB_DIR=%%RDFDB_DIR%%
RDFDB_PORT=%%RDFDB_PORT%%
export RDFDB_DIR RDFDB_PORT
case "$1" in
start)
if [ -x %%PREFIX%%/bin/rdfdb ]; then
su rdfdb -c 'exec %%PREFIX%%/bin/rdfdb > /dev/null &' && echo -n ' rdfdb'
fi
;;
stop)
/usr/bin/killall rdfdb > /dev/null 2>&1 && echo -n ' rdfdb'
;;
*)
echo ""
echo "Usage: `basename $0` { start | stop }"
echo ""
exit 64
;;
esac

View file

@ -0,0 +1 @@
A lightweight RDF database

24
databases/rdfdb/pkg-descr Normal file
View file

@ -0,0 +1,24 @@
R.V. Guha's rdfDB. Intended to be a simple, scalable, open-source
database for RDF. Written in C and based on top of the Sleepycat
Berkeley Database, it supports interrogation via TCP/IP sockets,
meaning integration is possible with any programming language.
rdfDB uses a high level SQLish query language. The data is modelled as
a directed labelled graph (RDF).
The goals of this project are to build a database that is capable of:
1. Supporting a graph oriented API via a textual query language ala
SQL.
2. Load/Reload an RDF file from a url into the database
3. Scalable to millions of nodes and triples.
4. Provide support for RDF Schemas.
5. Provide support for some basic forms of inferencing.
6. Provide both C and Perl access to the database.
7. The Perl philosophy applies : Simple things should be simple and
complex things should be possible.
WWW: http://www.guha.com/rdfdb/
- Philip Jenvey
pjenvey@turntables.org

View file

@ -0,0 +1,48 @@
#!/bin/sh
PATH=/bin:/usr/sbin
if [ -z "${RDFDB_DIR}" ]; then
RDFDB_DIR=/var/db/rdfdb
fi
case $2 in
PRE-INSTALL)
USER=rdfdb
GROUP=${USER}
UID=71
GID=${UID}
if pw group show "${GROUP}" 2>/dev/null; then
echo "You already have a group \"${GROUP}\", so I will use it."
else
if pw groupadd ${GROUP} -g ${GID}; then
echo "Added group \"${GROUP}\"."
else
echo "Adding group \"${GROUP}\" failed..."
exit 1
fi
fi
if pw user show "${USER}" 2>/dev/null; then
echo "You already have a user \"${USER}\", so I will use it."
if pw usermod ${USER} -d ${RDFDB_DIR}
then
echo "Changed home directory of \"${USER}\" to \"${RDFDB_DIR}\""
else
echo "Changing home directory of \"${USER}\" to \"${RDFDB_DIR}\" failed..."
exit 1
fi
else
if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
-d ${RDFDB_DIR} -s /bin/sh -c "rdfDB Daemon"
then
echo "Added user \"${USER}\"."
else
echo "Adding user \"${USER}\" failed..."
exit 1
fi
fi
chown -R ${USER}:${GROUP} ${RDFDB_DIR}
;;
esac

View file

@ -0,0 +1,4 @@
bin/rdfdb
etc/rc.d/rdfdb-server.sh
@unexec rmdir %%RDFDB_DIR%% 2>/dev/null || true
@exec mkdir -p %%RDFDB_DIR%%