1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-14 14:41:11 +02:00

Move library tree where it belongs

This commit is contained in:
ra
2010-01-24 09:19:39 +00:00
parent e74978ba77
commit 58caf78a86
6020 changed files with 2790154 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
MYSQL_UTILS=rdf-tree
bin_PROGRAMS=redland-db-upgrade rdfproc
noinst_SCRIPTS=touch-mtime.pl
AM_INSTALLCHECK_STD_OPTIONS_EXEMPT=redland-db-upgrade
EXTRA_PROGRAMS=$(MYSQL_UTILS)
man_MANS = redland-db-upgrade.1 rdfproc.1
EXTRA_DIST= rdfproc.html \
$(man_MANS) \
touch-mtime.pl
CLEANFILES=*.db $(EXTRA_PROGRAMS)
AM_CPPFLAGS=@LIBRDF_INTERNAL_CPPFLAGS@ @LIBRDF_CPPFLAGS@ -I$(top_srcdir)/librdf @LIBRDF_EXTERNAL_CPPFLAGS@
AM_CFLAGS=@CFLAGS@ $(MEM)
redland_db_upgrade_SOURCES = db_upgrade.c
redland_db_upgrade_LDADD=@LIBRDF_LDFLAGS@ $(top_builddir)/librdf/librdf.la
rdfproc_SOURCES = rdfproc.c
if GETOPT
rdfproc_SOURCES += getopt.c rdfproc_getopt.h
endif
rdfproc_LDADD=@LIBRDF_LDFLAGS@ $(top_builddir)/librdf/librdf.la
mysql-utils: $(MYSQL_UTILS)
@MAINT@rdfproc.html: $(srcdir)/rdfproc.1 $(top_srcdir)/raptor/fix-groff-xhtml
@MAINT@ -groff -man -Thtml -P-l $< | tidy -asxml -wrap 1000 2>/dev/null | $(PERL) $(top_srcdir)/raptor/fix-groff-xhtml $@

View File

@@ -0,0 +1,605 @@
# Makefile.in generated by automake 1.10.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = redland-db-upgrade$(EXEEXT) rdfproc$(EXEEXT)
EXTRA_PROGRAMS = $(am__EXEEXT_1)
@GETOPT_TRUE@am__append_1 = getopt.c rdfproc_getopt.h
subdir = utils
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/librdf/rdf_config.h
CONFIG_CLEAN_FILES =
am__EXEEXT_1 = rdf-tree$(EXEEXT)
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
rdf_tree_SOURCES = rdf-tree.c
rdf_tree_OBJECTS = rdf-tree.$(OBJEXT)
rdf_tree_LDADD = $(LDADD)
am__rdfproc_SOURCES_DIST = rdfproc.c getopt.c rdfproc_getopt.h
@GETOPT_TRUE@am__objects_1 = getopt.$(OBJEXT)
am_rdfproc_OBJECTS = rdfproc.$(OBJEXT) $(am__objects_1)
rdfproc_OBJECTS = $(am_rdfproc_OBJECTS)
rdfproc_DEPENDENCIES = $(top_builddir)/librdf/librdf.la
am_redland_db_upgrade_OBJECTS = db_upgrade.$(OBJEXT)
redland_db_upgrade_OBJECTS = $(am_redland_db_upgrade_OBJECTS)
redland_db_upgrade_DEPENDENCIES = $(top_builddir)/librdf/librdf.la
SCRIPTS = $(noinst_SCRIPTS)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/librdf
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = rdf-tree.c $(rdfproc_SOURCES) $(redland_db_upgrade_SOURCES)
DIST_SOURCES = rdf-tree.c $(am__rdfproc_SOURCES_DIST) \
$(redland_db_upgrade_SOURCES)
man1dir = $(mandir)/man1
NROFF = nroff
MANS = $(man_MANS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXXCPP = @CXXCPP@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DIGEST_OBJS = @DIGEST_OBJS@
DIGEST_SRCS = @DIGEST_SRCS@
DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
GTKDOC_CHECK = @GTKDOC_CHECK@
HASH_OBJS = @HASH_OBJS@
HASH_SRCS = @HASH_SRCS@
HTML_DIR = @HTML_DIR@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBRDF_CPPFLAGS = @LIBRDF_CPPFLAGS@
LIBRDF_EXTERNAL_CPPFLAGS = @LIBRDF_EXTERNAL_CPPFLAGS@
LIBRDF_EXTERNAL_LIBS = @LIBRDF_EXTERNAL_LIBS@
LIBRDF_INTERNAL_CPPFLAGS = @LIBRDF_INTERNAL_CPPFLAGS@
LIBRDF_INTERNAL_LIBS = @LIBRDF_INTERNAL_LIBS@
LIBRDF_LDFLAGS = @LIBRDF_LDFLAGS@
LIBRDF_LIBTOOLLIBS = @LIBRDF_LIBTOOLLIBS@
LIBRDF_LIBTOOL_VERSION = @LIBRDF_LIBTOOL_VERSION@
LIBRDF_PKGCONFIG_PRIVATE_LIBS = @LIBRDF_PKGCONFIG_PRIVATE_LIBS@
LIBRDF_VERSION_DECIMAL = @LIBRDF_VERSION_DECIMAL@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LOCAL_SUBDIRS = @LOCAL_SUBDIRS@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MEM = @MEM@
MEM_LIBS = @MEM_LIBS@
MKDIR_P = @MKDIR_P@
MYSQL_CONFIG = @MYSQL_CONFIG@
MYSQL_CPPFLAGS = @MYSQL_CPPFLAGS@
MYSQL_LIBS = @MYSQL_LIBS@
NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PG_CONFIG = @PG_CONFIG@
PKG_CONFIG = @PKG_CONFIG@
POSTGRESQL_CPPFLAGS = @POSTGRESQL_CPPFLAGS@
POSTGRESQL_LIBS = @POSTGRESQL_LIBS@
RANLIB = @RANLIB@
RAPTOR_CONFIG = @RAPTOR_CONFIG@
RAPTOR_MIN_VERSION = @RAPTOR_MIN_VERSION@
RASQAL_CONFIG = @RASQAL_CONFIG@
RASQAL_MAX_VERSION = @RASQAL_MAX_VERSION@
RASQAL_MIN_VERSION = @RASQAL_MIN_VERSION@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SQLITE_CPPFLAGS = @SQLITE_CPPFLAGS@
SQLITE_LIBS = @SQLITE_LIBS@
STANDARD_CFLAGS = @STANDARD_CFLAGS@
STRIP = @STRIP@
TAR = @TAR@
TSTORE_CONFIG = @TSTORE_CONFIG@
TSTORE_CPPFLAGS = @TSTORE_CPPFLAGS@
TSTORE_LIBS = @TSTORE_LIBS@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
subdirs = @subdirs@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
with_raptor = @with_raptor@
with_rasqal = @with_rasqal@
MYSQL_UTILS = rdf-tree
noinst_SCRIPTS = touch-mtime.pl
AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = redland-db-upgrade
man_MANS = redland-db-upgrade.1 rdfproc.1
EXTRA_DIST = rdfproc.html \
$(man_MANS) \
touch-mtime.pl
CLEANFILES = *.db $(EXTRA_PROGRAMS)
AM_CPPFLAGS = @LIBRDF_INTERNAL_CPPFLAGS@ @LIBRDF_CPPFLAGS@ -I$(top_srcdir)/librdf @LIBRDF_EXTERNAL_CPPFLAGS@
AM_CFLAGS = @CFLAGS@ $(MEM)
redland_db_upgrade_SOURCES = db_upgrade.c
redland_db_upgrade_LDADD = @LIBRDF_LDFLAGS@ $(top_builddir)/librdf/librdf.la
rdfproc_SOURCES = rdfproc.c $(am__append_1)
rdfproc_LDADD = @LIBRDF_LDFLAGS@ $(top_builddir)/librdf/librdf.la
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu utils/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu utils/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
|| test -f $$p1 \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
clean-binPROGRAMS:
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
installcheck-binPROGRAMS: $(bin_PROGRAMS)
bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \
case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
*" $$p "* | *" $(srcdir)/$$p "*) continue;; \
esac; \
f=`echo "$$p" | \
sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
for opt in --help --version; do \
if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \
2>c$${pid}_.err </dev/null \
&& test -n "`cat c$${pid}_.out`" \
&& test -z "`cat c$${pid}_.err`"; then :; \
else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
done; \
done; rm -f c$${pid}_.???; exit $$bad
rdf-tree$(EXEEXT): $(rdf_tree_OBJECTS) $(rdf_tree_DEPENDENCIES)
@rm -f rdf-tree$(EXEEXT)
$(LINK) $(rdf_tree_OBJECTS) $(rdf_tree_LDADD) $(LIBS)
rdfproc$(EXEEXT): $(rdfproc_OBJECTS) $(rdfproc_DEPENDENCIES)
@rm -f rdfproc$(EXEEXT)
$(LINK) $(rdfproc_OBJECTS) $(rdfproc_LDADD) $(LIBS)
redland-db-upgrade$(EXEEXT): $(redland_db_upgrade_OBJECTS) $(redland_db_upgrade_DEPENDENCIES)
@rm -f redland-db-upgrade$(EXEEXT)
$(LINK) $(redland_db_upgrade_OBJECTS) $(redland_db_upgrade_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/db_upgrade.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf-tree.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdfproc.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-man1: $(man1_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $$i; then file=$$i; \
else file=$(srcdir)/$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
1*) ;; \
*) ext='1' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
done
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
1*) ;; \
*) ext='1' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS)
installdirs:
for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-man
install-dvi: install-dvi-am
install-exec-am: install-binPROGRAMS
install-html: install-html-am
install-info: install-info-am
install-man: install-man1
install-pdf: install-pdf-am
install-ps: install-ps-am
installcheck-am: installcheck-binPROGRAMS
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-man
uninstall-man: uninstall-man1
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
clean-generic clean-libtool ctags distclean distclean-compile \
distclean-generic distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-binPROGRAMS install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-man1 install-pdf install-pdf-am install-ps \
install-ps-am install-strip installcheck installcheck-am \
installcheck-binPROGRAMS installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-binPROGRAMS \
uninstall-man uninstall-man1
mysql-utils: $(MYSQL_UTILS)
@MAINT@rdfproc.html: $(srcdir)/rdfproc.1 $(top_srcdir)/raptor/fix-groff-xhtml
@MAINT@ -groff -man -Thtml -P-l $< | tidy -asxml -wrap 1000 2>/dev/null | $(PERL) $(top_srcdir)/raptor/fix-groff-xhtml $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@@ -0,0 +1,141 @@
/* -*- Mode: c; c-basic-offset: 2 -*-
*
* db_upgrade.c - Upgrade a redland on-disk BDB store
*
* Copyright (C) 2003-2006, David Beckett http://purl.org/net/dajobe/
* Copyright (C) 2003-2004, University of Bristol, UK http://www.bristol.ac.uk/
*
* This package is Free Software and part of Redland http://librdf.org/
*
* It is licensed under the following three licenses as alternatives:
* 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version
* 2. GNU General Public License (GPL) V2 or any newer version
* 3. Apache License, V2.0 or any newer version
*
* You may not use this file except in compliance with at least one of
* the above three licenses.
*
* See LICENSE.html or LICENSE.txt at the top of this package for the
* complete terms and further detail along with the license texts for
* the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively.
*
*
*/
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <redland.h>
/* one prototype needed */
int main(int argc, char *argv[]);
int
main(int argc, char *argv[])
{
librdf_world* world;
librdf_storage *storage, *new_storage;
librdf_model *model, *new_model;
librdf_stream *stream;
char *program=argv[0];
char *name;
char *new_name;
int count;
if(argc < 2 || argc >3) {
fprintf(stderr, "USAGE: %s: <Redland BDB name> [new DB name]\n", program);
return(1);
}
name=argv[1];
if(argc < 3) {
new_name=librdf_heuristic_gen_name(name);
if(!new_name) {
fprintf(stderr, "%s: Failed to create new name from '%s'\n", program,
name);
return(1);
}
} else {
new_name=argv[2];
}
fprintf(stderr, "%s: Upgrading DB '%s' to '%s'\n", program, name, new_name);
world=librdf_new_world();
librdf_world_open(world);
storage=librdf_new_storage(world, "hashes", name,
"hash-type='bdb',dir='.',write='no',new='no'");
if(!storage) {
fprintf(stderr, "%s: Failed to open old storage '%s'\n", program, name);
return(1);
}
new_storage=librdf_new_storage(world, "hashes", new_name,
"hash-type='bdb',dir='.',write='yes',new='yes'");
if(!storage) {
fprintf(stderr, "%s: Failed to create new storage '%s'\n", program, new_name);
return(1);
}
model=librdf_new_model(world, storage, NULL);
if(!model) {
fprintf(stderr, "%s: Failed to create model for '%s'\n", program, name);
return(1);
}
new_model=librdf_new_model(world, new_storage, NULL);
if(!new_model) {
fprintf(stderr, "%s: Failed to create new model for '%s'\n", program, new_name);
return(1);
}
stream=librdf_model_as_stream(model);
if(!stream) {
fprintf(stderr, "%s: librdf_model_as_stream returned NULL stream\n",
program);
return(1);
} else {
count=0;
while(!librdf_stream_end(stream)) {
librdf_statement *statement=librdf_stream_get_object(stream);
if(!statement) {
fprintf(stderr, "%s: librdf_stream_next returned NULL\n", program);
break;
}
librdf_model_add_statement(new_model, statement);
librdf_stream_next(stream);
count++;
}
librdf_free_stream(stream);
}
librdf_free_model(model);
librdf_free_model(new_model);
librdf_free_storage(storage);
librdf_free_storage(new_storage);
librdf_free_world(world);
if(argc < 3)
free(new_name);
#ifdef LIBRDF_MEMORY_DEBUG
librdf_memory_report(stderr);
#endif
/* keep gcc -Wall happy */
return(0);
}

View File

@@ -0,0 +1,157 @@
/*
* Public Domain getopt - history below
*
*/
/*
* From: gwyn@brl-tgr.ARPA (Doug Gwyn <gwyn>) Newsgroups: net.sources
* Subject: getopt library routine Date: 30 Mar 85 04:45:33 GMT
*/
/*
* getopt -- public domain version of standard System V routine
*
* Strictly enforces the System V Command Syntax Standard; provided by D A
* Gwyn of BRL for generic ANSI C implementations
*
* #define STRICT to prevent acceptance of clustered options with arguments
* and ommision of whitespace between option and arg.
*/
/*
* Modified by Manuel Novoa III on 1/5/01 to use weak symbols.
* Programs needing long options will link gnu_getopt instead.
*/
/*
* Last public domain version 1.5 downloaded from uclibc CVS:
* http://www.uclibc.org/cgi-bin/cvsweb/uClibc/libc/unistd/getopt.c
* on 2003-02-18 by Dave Beckett and tidied:
* Ran through "indent getopt.c -gnu" then fixed up the mess
* Removed register - compilers are smart these days
* ANSI-fied the declarations
* Prefixed with rdfproc_ so that it doesn't clash with any getopt
* linked in later.
*/
#include <stdio.h>
#include <string.h>
#include <rdfproc_getopt.h>
int opterr; /* error => print message */
int optind; /* next argv[] index */
int optopt; /* Set for unknown arguments */
char *optarg; /* option parameter if any */
/*
* Err:
* program name argv[0]
* specific message
* defective option letter
*/
static int
Err (char *name, char *mess, int c) /* returns '?' */
{
optopt = c;
if (opterr)
{
(void) fprintf (stderr, "%s: %s -- %c\n", name, mess, c);
}
return '?'; /* erroneous-option marker */
}
int
getopt (int argc, char * const argv[], const char *optstring)
{
static int sp = 1; /* position within argument */
int osp; /* saved `sp' for param test */
#ifndef STRICT
int oind; /* saved `optind' for param test */
#endif
int c; /* option letter */
char *cp; /* -> option in `optstring' */
optarg = NULL;
/* initialise getopt vars */
if (optind == 0)
{
optind = 1;
opterr = 1;
optopt = 1;
optarg = NULL;
}
if (sp == 1)
{ /* fresh argument */
if (optind >= argc /* no more arguments */
|| argv[optind][0] != '-' /* no more options */
|| argv[optind][1] == '\0' /* not option; stdin */
)
return EOF;
else if (strcmp (argv[optind], "--") == 0)
{
++optind; /* skip over "--" */
return EOF; /* "--" marks end of options */
}
}
c = argv[optind][sp]; /* option letter */
osp = sp++; /* get ready for next letter */
#ifndef STRICT
oind = optind; /* save optind for param test */
#endif
if (argv[optind][sp] == '\0')
{ /* end of argument */
++optind; /* get ready for next try */
sp = 1; /* beginning of next argument */
}
if (c == ':'
|| c == '?' /* optstring syntax conflict */
|| (cp = strchr (optstring, c)) == NULL) /* not found */
{
return Err (argv[0], "illegal option", c);
}
if (cp[1] == ':')
{ /* option takes parameter */
#ifdef STRICT
if (osp != 1)
{
return Err (argv[0], "option must not be clustered", c);
}
/* reset by end of argument */
if (sp != 1)
{
return Err (argv[0], "option must be followed by white space", c);
}
#else
if (oind == optind)
{ /* argument w/o whitespace */
optarg = &argv[optind][sp];
sp = 1; /* beginning of next argument */
}
else
#endif
if (optind >= argc)
{
return Err (argv[0], "option requires an argument", c);
}
else /* argument w/ whitespace */
optarg = argv[optind];
++optind; /* skip over parameter */
}
return c;
}

View File

@@ -0,0 +1,521 @@
/*
* rdf-tree.c - Retrieve statements from persistent Redland storage.
*
* Copyright (C) 2003-2004 Morten Frederiksen - http://purl.org/net/morten/
*
* and
*
* Copyright (C) 2000-2006, David Beckett http://purl.org/net/dajobe/
* Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/
*
* This package is Free Software and part of Redland http://librdf.org/
*
* It is licensed under the following three licenses as alternatives:
* 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version
* 2. GNU General Public License (GPL) V2 or any newer version
* 3. Apache License, V2.0 or any newer version
*
* You may not use this file except in compliance with at least one of
* the above three licenses.
*
* See LICENSE.html or LICENSE.txt at the top of this package for the
* complete terms and further detail along with the license texts for
* the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively.
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
#include <redland.h>
#include <openssl/lhash.h>
const char *VERSION = "0.4";
struct options {
librdf_node *context;
char *database;
char *directory;
char *host;
char *model;
int level;
int port;
char *output;
char *password;
int quiet;
char *user;
} opts;
int main(int argc, char *argv[]);
int tree(librdf_world * world, librdf_node * node, librdf_model * model,
librdf_model * outputmodel, LHASH * table, int level);
void hash_free(void *data);
int getoptions(int argc, char *argv[], librdf_world * world);
int usage(char *argv0, int version);
int
main(int argc, char *argv[])
{
/* Redland objects. */
librdf_world *world;
librdf_storage *storage;
librdf_model *model;
librdf_uri *uri = 0;
librdf_storage *outputstorage;
librdf_model *outputmodel;
librdf_storage *contextstorage;
librdf_model *contextmodel;
librdf_stream *stream;
librdf_serializer *serializer;
int argnum;
char *storage_type;
char *storage_options;
/* Create rdflib world. */
world = librdf_new_world();
if(!world) {
fprintf(stderr, "%s: Failed to create Redland world\n", argv[0]);
return (1);
};
librdf_world_open(world);
/* Parse command line options (if possible). */
argnum = getoptions(argc, argv, world);
/* Check for URI argument. */
if(argnum < argc) {
uri = librdf_new_uri(world, argv[argnum]);
if(!uri) {
fprintf(stderr, "%s: Failed to create input uri\n", argv[0]);
exit(1);
};
};
/* Set storage options. */
if(opts.database) {
storage_type = strdup("mysql");
storage_options =
malloc(strlen(opts.host) + strlen(opts.database) + strlen(opts.user) +
strlen(opts.password) + 120);
if(!storage_type || !storage_options) {
fprintf(stderr, "%s: Failed to create 'mysql' storage options\n",
argv[0]);
return (1);
};
sprintf(storage_options,
"host='%s',database='%s',port='%i',user='%s',password='%s',contexts='yes',write='no'",
opts.host, opts.database, opts.port, opts.user, opts.password);
}
else {
storage_type = strdup("hashes");
storage_options = malloc(strlen(opts.directory) + 120);
if(!storage_type || !storage_options) {
fprintf(stderr, "%s: Failed to create 'hashes' storage options\n",
argv[0]);
return (1);
};
sprintf(storage_options,
"hash-type='bdb',dir='%s',contexts='yes',write='no'",
opts.directory);
};
/* Create storage. */
storage =
librdf_new_storage(world, storage_type, opts.model, storage_options);
if(!storage) {
fprintf(stderr, "%s: Failed to create storage (%s/%s/%s)\n", argv[0],
storage_type, opts.model, storage_options);
return (1);
}
/* Create model. */
model = librdf_new_model(world, storage, NULL);
if(!model) {
fprintf(stderr, "%s: Failed to create model\n", argv[0]);
return (1);
}
/* Create output storage. */
outputstorage = librdf_new_storage(world, "memory", "output", "");
if(!outputstorage) {
fprintf(stderr, "%s: Failed to create output storage\n", argv[0]);
return (1);
}
/* Create output model. */
outputmodel = librdf_new_model(world, outputstorage, NULL);
if(!outputmodel) {
fprintf(stderr, "%s: Failed to create output model\n", argv[0]);
return (1);
}
/* Create serializer. */
serializer = librdf_new_serializer(world, opts.output, NULL, NULL);
if(!serializer) {
fprintf(stderr, "%s: Failed to create serializer\n", argv[0]);
return (1);
}
if(librdf_model_size(model) != -1 && !opts.quiet)
fprintf(stderr, "%s: Model '%s' contains %d statements.\n", argv[0],
opts.model, librdf_storage_size(storage));
/*
stream=librdf_model_as_stream(model);
while (!librdf_stream_end(stream))
{
librdf_statement *s;
librdf_node *n;
s=librdf_stream_get_object(stream);
fprintf(stderr,"%s\n",librdf_statement_to_string(s));
n=librdf_stream_get_context(stream);
fprintf(stderr,"- context: %s\n",n?librdf_node_to_string(n):"-");
librdf_stream_next(stream);
};
librdf_free_stream(stream);
*/
/* Only statements with given context? */
if(opts.context) {
if(!opts.quiet)
fprintf(stderr, "%s: Creating context storage...\n", argv[0]);
/* Create context storage. */
contextstorage = librdf_new_storage(world, "memory", "context", "");
if(!contextstorage) {
fprintf(stderr, "%s: Failed to create context storage\n", argv[0]);
return (1);
};
/* Create context model. */
contextmodel = librdf_new_model(world, contextstorage, NULL);
if(!contextmodel) {
fprintf(stderr, "%s: Failed to create context model\n", argv[0]);
return (1);
};
/* Extract statements with given context. */
if(!(stream = librdf_model_context_as_stream(model, opts.context))) {
fprintf(stderr, "%s: Failed to serialize context model\n", argv[0]);
return (1);
};
if(librdf_model_add_statements(contextmodel, stream)) {
fprintf(stderr, "%s: Failed to add statements to context model\n",
argv[0]);
return (1);
};
librdf_free_model(model);
librdf_free_storage(storage);
storage = contextstorage;
model = contextmodel;
};
/* Populate output model... */
if(uri) {
int rc = 0;
LHASH *table =
lh_new((LHASH_HASH_FN_TYPE) lh_strhash, (LHASH_COMP_FN_TYPE) strcmp);
if(!table) {
fprintf(stderr, "%s: Failed to create hash table\n", argv[0]);
return (1);
};
if(!opts.quiet)
fprintf(stderr, "%s: Populating output model from uri...\n", argv[0]);
/* Recursively extract statements about subject... */
rc =
tree(world, librdf_new_node_from_uri(world, uri), model, outputmodel,
table, opts.level);
lh_doall(table, (LHASH_DOALL_FN_TYPE) hash_free);
lh_free(table);
if(rc) {
fprintf(stderr, "%s: Failed to extract statements from model (%d)\n",
argv[0], rc);
return (1);
};
librdf_free_model(model);
librdf_free_storage(storage);
}
else {
if(!opts.quiet)
fprintf(stderr, "%s: Outputting entire model...\n", argv[0]);
/* No restraints, use entire model as output. */
librdf_free_model(outputmodel);
librdf_free_storage(outputstorage);
outputstorage = storage;
outputmodel = model;
};
/* Serialize output... */
if(!opts.quiet)
fprintf(stderr, "%s: Serializing...\n", argv[0]);
if(librdf_serializer_serialize_model(serializer, stdout, NULL, outputmodel)) {
fprintf(stderr, "%s: Failed to serialize output model\n", argv[0]);
return (1);
};
/* Clean up. */
librdf_free_serializer(serializer);
librdf_free_model(outputmodel);
librdf_free_storage(outputstorage);
librdf_free_world(world);
/* keep gcc -Wall happy */
return (0);
}
int
tree(librdf_world * world, librdf_node * node, librdf_model * model,
librdf_model * outputmodel, LHASH * table, int level)
{
librdf_stream *instream;
librdf_node *object;
librdf_statement *statement;
int rc;
librdf_node_type ont;
librdf_node *rdftype =
librdf_new_node_from_uri_string(world,
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type");
/* Add node to hash, to prevent cycles. */
lh_insert(table, strdup(librdf_node_to_string(node)));
if(lh_error(table)) {
return 1;
}
/* Find all statements about node. */
if(!
(statement =
librdf_new_statement_from_nodes(world, librdf_new_node_from_node(node),
NULL, NULL))) {
return 2;
}
if(!(instream = librdf_model_find_statements(model, statement))) {
return 0;
}
while(!librdf_stream_end(instream)) {
/* Add statement to output model. */
statement = librdf_stream_get_object(instream);
if(librdf_model_add_statement(outputmodel,
librdf_new_statement_from_statement
(statement)))
return 4;
/* Recurse? */
if(level && !librdf_node_equals(rdftype,
librdf_statement_get_predicate
(statement))) {
object = librdf_statement_get_object(statement);
ont = librdf_node_get_type(object);
if(ont == LIBRDF_NODE_TYPE_RESOURCE || ont == LIBRDF_NODE_TYPE_BLANK) {
/*
librdf_statement_print(statement,stderr);
fprintf(stderr,"%s","\n");
*/
/* Don't recurse if object is known... */
if(!lh_retrieve(table, librdf_node_to_string(object))) {
rc = tree(world, object, model, outputmodel, table, level - 1);
if(rc)
return rc;
}
};
};
librdf_stream_next(instream);
};
librdf_free_stream(instream);
return 0;
};
void
hash_free(void *data)
{
free(data);
};
int
getoptions(int argc, char *argv[], librdf_world * world)
{
/* Define command line options. */
struct option opts_long[] = {
{"help", no_argument, NULL, '?'},
{"context", required_argument, NULL, 'c'},
{"database", required_argument, NULL, 's'},
{"directory", required_argument, NULL, 'd'},
{"host", required_argument, NULL, 'h'},
{"level", required_argument, NULL, 'l'},
{"model", required_argument, NULL, 'm'},
{"output", required_argument, NULL, 'o'},
{"port", required_argument, NULL, 'P'},
{"password", optional_argument, NULL, 'p'},
{"quiet", no_argument, NULL, 'q'},
{"user", required_argument, NULL, 'u'},
{"version", no_argument, NULL, 'v'},
{0, 0, 0, 0}
};
const char *opts_short = "?c:D:d:h:l:m:o:P:p:qu:v";
int i = 1;
char c;
char *buffer;
int ttypasswd = 1;
/* Set defaults. */
opts.context = 0;
opts.level = 1;
opts.password = 0;
opts.port = 3306;
opts.quiet = 0;
opts.user = 0;
if(!(opts.directory = strdup("./"))
|| !(opts.host = strdup("mysql"))
|| !(opts.model = strdup("redland"))
|| !(opts.output = strdup("rdfxml"))
|| !(opts.database = strdup("redland"))) {
fprintf(stderr, "%s: Failed to allocate default options\n", argv[0]);
exit(1);
};
while((c = getopt_long(argc, argv, opts_short, opts_long, &i)) != -1) {
if(optarg) {
buffer = malloc(strlen(optarg) + 1);
if(!buffer) {
fprintf(stderr,
"%s: Failed to allocate buffer for command line argument (%s)\n",
argv[0], optarg);
exit(1);
};
strncpy(buffer, optarg, strlen(optarg) + 1);
};
switch (c) {
case '?':
usage(argv[0], 0);
case 'c':
free(buffer);
opts.context = librdf_new_node_from_uri_string(world, optarg);
if(!opts.context) {
fprintf(stderr, "%s: Failed to create context node (%s)\n", argv[0],
optarg);
exit(1);
};
break;
case 'D':
free(opts.directory);
opts.directory = 0;
opts.database = buffer;
break;
case 'd':
free(opts.database);
opts.database = 0;
opts.directory = buffer;
break;
case 'h':
opts.host = buffer;
break;
case 'l':
free(buffer);
opts.level = atoi(optarg);
break;
case 'm':
opts.model = buffer;
break;
case 'o':
free(opts.output);
opts.output = buffer;
break;
case 'P':
free(buffer);
opts.port = atoi(optarg);
break;
case 'p':
opts.password = buffer;
ttypasswd = 0;
break;
case 'q':
opts.quiet = 1;
break;
case 'u':
opts.user = buffer;
break;
case 'v':
usage(argv[0], 1);
default:
fprintf(stderr, "%s: Invalid option (%c)\n", argv[0], c);
usage(argv[0], 0);
}
}
/* Flag missing user name. */
if(opts.database && !opts.user) {
fprintf(stderr, "%s: Missing user name for mysql storage\n", argv[0]);
usage(argv[0], 0);
exit(1);
};
/* Read password from tty if not specified. */
if(opts.database && ttypasswd) {
char c2;
int i2 = 0;
opts.password = malloc(128);
if(!opts.password) {
fprintf(stderr, "%s: Failed to allocate buffer for password\n",
argv[0]);
exit(1);
};
fprintf(stderr, "%s: Enter password for %s@%s/%s: ", argv[0], opts.user,
opts.host, opts.database);
while((c2 = getchar()) != '\n') {
opts.password[i2++] = c2;
if(i2 == 127)
break;
};
opts.password[i2++] = 0;
};
return optind;
}
int
usage(char *argv0, int version)
{
printf("\n\
%s Version %s\n\
Retrieve statements from persistent Redland storage.\n\
* Copyright (C) 2003 Morten Frederiksen - http://purl.org/net/morten/\n\
* Copyright (C) 2000-2003 David Beckett - http://purl.org/net/dajobe/\n\
", argv0, VERSION);
if(version)
exit(0);
printf("\n\
usage: %s [options] [ <URI> ]\n\
\n\
-?, --help Display this help message and exit.\n\
-c<uri>, --context=<uri>\n\
Extract only statements with given context URI.\n\
-D<database>, --database=<database>\n\
Name of MySQL database to use, default is 'redland'.\n\
-d<directory>, --directory=<directory>\n\
Directory to use for BDB files. When provided implies use\n\
of 'hashes' storage type instead of 'mysql'.\n\
-h<host name>, --host=<host name>\n\
Host to contact for MySQL connections, default is 'mysql'.\n\
-l<number>, --level=<number>\n\
The number of levels of statements to extract. Default is\n\
1, also returning statements about objects.\n\
-m<model id>, --model=<model id>\n\
Identifier for (name of) storage (model name for storage\n\
type 'mysql', base file name for storage type 'hashes'),\n\
default is 'redland'.\n\
-o<syntax id>, --output=<syntax id>\n\
Syntax identifier for serialization, 'ntriples' or\n\
'rdfxml' (default).\n\
-p<password>, --password=<password>\n\
Password to use when connecting to MySQL server.\n\
If password is not given it's asked from the tty.\n\
-P<port number>, --port=<port number>\n\
The port number to use when connecting to MySQL server.\n\
Default port number is 3306.\n\
-q, --quiet\n\
No informational messages, only errors.\n\
-u<user name>, --user=<user name>\n\
User name for MySQL server.\n\
-v, --version Output version information and exit.\n\
\n\
", argv0);
exit(1);
}

View File

@@ -0,0 +1,203 @@
.\" Hey, EMACS: -*- nroff -*-
.\"
.\" rdfproc.1 - Redland RDF processor utility manual page
.\"
.\" Copyright (C) 2003-2007 David Beckett - http://purl.org/net/dajobe/
.\" Copyright (C) 2003-2005 University of Bristol - http://www.bristol.ac.uk/
.\"
.TH rdfproc 1 "2007-02-17"
.\" Please adjust this date whenever revising the manpage.
.SH NAME
rdfproc \- Redland RDF processor utility
.SH SYNOPSIS
.B rdfproc
.RB [ options ]
.IR "store-name"
.IR "command"
.IR "arg..."
.SH EXAMPLE
.nf
.B rdfproc test parse http://planetrdf.com/guide/rss.rdf
.br
.B rdfproc test print
.br
.B rdfproc test serialize ntriples
.br
.SH DESCRIPTION
The
.B rdfproc
utility allows parsing, querying, manipulating and serializing of
RDF content using the
.B Redland
RDF library. The \fIstore-name\fR is a Redland store name, typically
a short identifier. The arguments to \fIcommand\fR vary
and are explained in section COMMANDS below.
.SH OPTIONS
rdfproc uses the usual GNU command line syntax, with long
options starting with two dashes (`-') if supported by the
getopt_long function. Otherwise the short options are only available.
.TP
.B \-h, \-\-help
Show a summary of the options.
.TP
.B \-c, \-\-contexts
Use a store with Redland contexts.
.TP
.B \-n, \-\-new
Make a new store, overwriting any existing one.
.TP
.B \-o, \-\-output \fIFORMAT\fR
Set the output FORMAT for sequences of triples, such as from a search
(find command) to a Redland serializer. At present the alternatives
are 'simple' (the default one if this option is omitted), 'ntriples'
or 'rdfxml'.
.TP
.B \-p, \-\-password
Read the storage option 'password' from standard input. Terminated
by end of line ('\\n') or end of file. This is equivalent
to setting it using \-t or \-\-storage-options but does not
require exposing the password in the argument list.
.TP
.B \-r, \-\-results \fIFORMAT\fR
Set the query results syntax format.
.IP
The exact list of formats depends on what libraptor(3) was built with
but is given correct in the usage message with \-h.
.TP
.B \-s, \-\-storage \fITYPE\fR
Set the Redland storage type (default 'hashes'). Alternatives
are 'memory' which is always present
and '3store', 'file', 'mysql', 'sqlite', 'uri' when support for those
is compiled in If environment variable RDFPROC_STORAGE_TYPE is set,
the storage type given here will override it.
.TP
.B \-t, \-\-storage-options \fIOPTIONS\fR
Set options for the the Redland storage, default is "hash-type='bdb',dir='.'"
to match the default storage "hashes". For storages types such as 'mysql'
that need extra options this would typically be something
like "host='hostname',database='dbname',user='abc',password='pass'".
If environment variable RDFPROC_STORAGE_OPTIONS is set, the storage
options given here will be applied afterwards.
.TP
.B \-v, \-\-version
Print the Redland version and exit.
.SH COMMANDS
Where a node is allowed, such as \fINODE\fP, \fISUBJECT\fP,
\fIPREDICATE\fP or \fIOBJECT\fP below, simple heuristics are used to
guess which are blank node identifiers, URIs or literals
(to add a statement with a literal, use add-typed). If the
item starts with _: then it is assumed to be a blank node identifier,
otherwise if it matches something:// it is assumed to be a URI,
otherwise it is a literal. Literals are only allowed as objects
of statements and blank nodes are not allowed as predicates.
.IP "\fBadd \fISUBJECT\fP \fIPREDICATE\fP \fIOBJECT\fP \fI[CONTEXT]\fP\fR"
Add the given triple to graph, in the optional Redland context
if the \fICONTEXT\fR node is given.
.IP "\fBadd-typed \fISUBJECT\fP \fIPREDICATE\fP \fIOBJECT\fP \fIOBJECT-LANG\fP \fIOBJECT-URI\fP \fI[CONTEXT]\fP\fR"
Add the triple with the datatyped literal object to the graph, in the
optional Redland context if \fICONTEXT\fR is given.
.IP "\fBarc \fISUBJECT\fP \fIOBJECT\fP\fR"
.IP "\fBarcs \fISUBJECT\fP \fIOBJECT\fP\fR"
Show one node/all nodes that match triples (\fISUBJECT\fP, ?, \fIOBJECT\fP)
.IP "\fBarcs-in \fINODE\fP\fR"
Show all properties of triples with \fINODE\fP as a subject.
.IP "\fBarcs-out \fINODE\fP\fR"
Show all properties of triples with \fINODE\fP as an object.
.IP "\fBcontains \fISUBJECT\fP \fIPREDICATE\fP \fIOBJECT\fP\fR"
Check if the given triple is in the graph.
.IP "\fBcontexts\fR"
List all the contexts in the graph (if contexts are enabled).
.IP "\fBfind \fISUBJECT\fP|- \fIPREDICATE\fP|- \fIOBJECT\fP|- [\fICONTEXT\fP]\fR"
Find matching triples to the given statement
where - stands for a blank that matches any node. If \fICONTEXT\fP
is given, only search for triples in that context node.
.IP "\fBhas-arc-in \fINODE\fP \fIARC\fP\fR"
Check that there is a triple with \fINODE\fP as a subject
and \fIARC\fP as a predicate.
.IP "\fBhas-arc-out \fPNODE\fP \fIARC\fP\fR"
Check that there is a triple with \fINODE\fP as a object
and \fIARC\fP as a predicate.
.IP "\fBparse \fIURI|FILENAME\fP [\fISYNTAX|\fP [\fIBASE URI\fP]]\fR"
Parse syntax at \fIURI\fP into the graph using \fISYNTAX\fP which
can be one of \fIrdfxml\fP (RDF/XML, default), \fIntriples\fP, \fIturtle\fP,
\fIrss-tag-soup\fP (for all RSS and Atoms), \fIgrddl\fP and \fIguess\fP to
use content hints and protocol information to work it out. (This list changes
faster than this manual page)
If \fIFILENAME\fP is a existing file, the appropriate URI will be
generated for it.
.IP "\fBparse-stream \fIURI|FILENAME\fP [\fISYNTAX\fP [\fIBASE URI\fP [\fICONTEXT\fP]]\fR"
Streaming parse syntax at URI into the graph using \fISYNTAX\fP which
can be one of \fIrdfxml\fP (RDF/XML, default) or \fIntriples\fP.
If \fIFILENAME\fP is an existing file, the appropriate URI will be
generated for it. If the optional \fICONTEXT\fI URI is given,
the triples are added to that context.
.IP "\fBprint\fR"
Print the graph triples in a simple format showing context nodes
if present.
.IP "\fBquery \fINAME\fP|- \fIURI\fP|- \fIQUERY-STRING\fP\fR"
Run \fIQUERY-STRING\fI query in language \fINAME\fR returning
variable bindings, a boolean or RDF graph depending on the query.
Query language can be 'sparql' or 'rdql'.
.IP "\fBremove \fISUBJECT\fP \fIPREDICATE\fP \fIOBJECT\fP \fI[CONTEXT]\fP\fR"
Remove the given triple graph, in the optional Redland context
if \fICONTEXT\fR is given.
.IP "\fBremove-context \fICONTEXT\fP\fR"
Remove all triples in the graph with the Redland context \fICONTEXT\fR.
.IP "\fBserialize [\fISYNTAX\fP [\fIURI\fP [\fIMIME-TYPE\fP]]]\fR"
Serializes the graph to a syntax with a particular \ISYNTAX\fI
\fIURI\fR or Internet Media Type/MIME Type. The default is
RDF/XML (\fINAME\fR "rdfxml", MIME Type "application/rdf/xml")
if none of the above are given. Other alternatives
are "ntriples" (no MIME Type).
.IP "\fBsource \fIPREDICATE\fP \fIOBJECT\fP\fR"
.IP "\fBsources \fIPREDICATE\fP \fIOBJECT\fP\fR"
Show one node/all nodes that match triples (?, \fIPREDICATE\fP, \fIOBJECT\fP)
.IP "\fBtarget \fISUBJECT\fP \fIPREDICATE\fP\fR"
.IP "\fBtargets \fISUBJECT\fP \fIPREDICATE\fP\fR"
Show one node/all nodes that match triples (\fISUBJECT\fP, \fIPREDICATE\fP, ?)
.SH "ENVIRONMENT"
RDFPROC_STORAGE_OPTIONS can be set to provide storage options
instead of using the option \-t, \-\-storage-options \fIOPTIONS\fR.
When both are given, command options are applied last.
.LP
RDFPROC_STORAGE_TYPE can be set to provide a storage type
instead of using the option \-s, \-\-storage \fITYPE\fR.
When both are given, the storage type from the command is used.
.SH "CONFORMING TO"
\fIRDF/XML Syntax (Revised)\fR,
W3C Recommendation,
.UR http://www.w3.org/TR/rdf-syntax-grammar/
http://www.w3.org/TR/rdf-syntax-grammar/
.UE
\fIN-Triples\fR, in \fIRDF Test Cases\fR, Jan Grant and Dave Beckett (eds.)
W3C Recommendation,
.UR http://www.w3.org/TR/rdf-testcases/#ntriples
http://www.w3.org/TR/rdf-testcases/#ntriples
.UE
.SH SEE ALSO
redland(3), libraptor(3), rapper(1)
.SH AUTHOR
Dave Beckett -
.UR http://purl.org/net/dajobe/
http://purl.org/net/dajobe/
.UE

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,669 @@
<!-- Creator : groff version 1.18.1 -->
<!-- CreationDate: Mon Jun 30 20:11:00 2008 -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Redland RDF Application Framework - Redland RDF processor utility</title>
</head>
<body bgcolor="#ffffff" text="#000085">
<h1>Redland RDF Application Framework - Redland RDF processor utility</h1>
<hr />
<a name="NAME"></a>
<h2>NAME</h2>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p>rdfproc &#8722; Redland RDF processor utility</p>
</td>
</tr>
</table>
<a name="SYNOPSIS"></a>
<h2>SYNOPSIS</h2>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>rdfproc</b> [<b>options</b>] <i>store-name command arg...</i></p>
</td>
</tr>
</table>
<a name="EXAMPLE"></a>
<h2>EXAMPLE</h2>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<pre>
<b>rdfproc test parse http://planetrdf.com/guide/rss.rdf
rdfproc test print
rdfproc test serialize ntriples
</b>
</pre></td>
</tr>
</table>
<a name="DESCRIPTION"></a>
<h2>DESCRIPTION</h2>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p>The <b>rdfproc</b> utility allows parsing, querying, manipulating and serializing of RDF content using the <b>Redland</b> RDF library. The <i>store-name</i> is a Redland store name, typically a short identifier. The arguments to <i>command</i> vary and are explained in section COMMANDS below.</p>
</td>
</tr>
</table>
<a name="OPTIONS"></a>
<h2>OPTIONS</h2>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p>rdfproc uses the usual GNU command line syntax, with long options starting with two dashes (&#8216;-&#8217;) if supported by the getopt_long function. Otherwise the short options are only available.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>&#8722;h, &#8722;&#8722;help</b></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Show a summary of the options.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>&#8722;c, &#8722;&#8722;contexts</b></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Use a store with Redland contexts.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>&#8722;n, &#8722;&#8722;new</b></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Make a new store, overwriting any existing one.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>&#8722;o, &#8722;&#8722;output</b> <i>FORMAT</i></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Set the output FORMAT for sequences of triples, such as from a search (find command) to a Redland serializer. At present the alternatives are &#8217;simple&#8217; (the default one if this option is omitted), &#8217;ntriples&#8217; or &#8217;rdfxml&#8217;.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>&#8722;p, &#8722;&#8722;password</b></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Read the storage option &#8217;password&#8217; from standard input. Terminated by end of line (&#8217;\n&#8217;) or end of file. This is equivalent to setting it using &#8722;t or &#8722;&#8722;storage-options but does not require exposing the password in the argument list.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>&#8722;r, &#8722;&#8722;results</b> <i>FORMAT</i></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Set the query results syntax format.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="20%"></td>
<td width="79%">
<p>The exact list of formats depends on what libraptor(3) was built with but is given correct in the usage message with &#8722;h.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>&#8722;s, &#8722;&#8722;storage</b> <i>TYPE</i></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Set the Redland storage type (default &#8217;hashes&#8217;). Alternatives are &#8217;memory&#8217; which is always present and &#8217;3store&#8217;, &#8217;file&#8217;, &#8217;mysql&#8217;, &#8217;sqlite&#8217;, &#8217;uri&#8217; when support for those is compiled in If environment variable RDFPROC_STORAGE_TYPE is set, the storage type given here will override it.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>&#8722;t, &#8722;&#8722;storage-options</b> <i>OPTIONS</i></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Set options for the the Redland storage, default is "hash-type=&#8217;bdb&#8217;,dir=&#8217;.&#8217;" to match the default storage "hashes". For storages types such as &#8217;mysql&#8217; that need extra options this would typically be something like "host=&#8217;hostname&#8217;,database=&#8217;dbname&#8217;,user=&#8217;abc&#8217;,password=&#8217;pass&#8217;". If environment variable RDFPROC_STORAGE_OPTIONS is set, the storage options given here will be applied afterwards.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>&#8722;v, &#8722;&#8722;version</b></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Print the Redland version and exit.</p>
</td>
</tr>
</table>
<a name="COMMANDS"></a>
<h2>COMMANDS</h2>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p>Where a node is allowed, such as <i>NODE</i>, <i>SUBJECT</i>, <i>PREDICATE</i> or <i>OBJECT</i> below, simple heuristics are used to guess which are blank node identifiers, URIs or literals (to add a statement with a literal, use add-typed). If the item starts with _: then it is assumed to be a blank node identifier, otherwise if it matches something:// it is assumed to be a URI, otherwise it is a literal. Literals are only allowed as objects of statements and blank nodes are not allowed as predicates.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>add</b> <i>SUBJECT PREDICATE OBJECT [CONTEXT]</i></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Add the given triple to graph, in the optional Redland context if the <i>CONTEXT</i> node is given.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>add-typed</b> <i>SUBJECT PREDICATE OBJECT OBJECT-LANG OBJECT-URI [CONTEXT]</i></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Add the triple with the datatyped literal object to the graph, in the optional Redland context if <i>CONTEXT</i> is given.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>arc</b> <i>SUBJECT OBJECT</i></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>arcs</b> <i>SUBJECT OBJECT</i></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Show one node/all nodes that match triples (<i>SUBJECT</i>, ?, <i>OBJECT</i>)</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>arcs-in</b> <i>NODE</i></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Show all properties of triples with <i>NODE</i> as a subject.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>arcs-out</b> <i>NODE</i></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Show all properties of triples with <i>NODE</i> as an object.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>contains</b> <i>SUBJECT PREDICATE OBJECT</i></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Check if the given triple is in the graph.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>contexts</b></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>List all the contexts in the graph (if contexts are enabled).</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>find</b> <i>SUBJECT</i><b>|-</b> <i>PREDICATE</i><b>|-</b> <i>OBJECT</i><b>|- [</b><i>CONTEXT</i><b>]</b></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Find matching triples to the given statement where - stands for a blank that matches any node. If <i>CONTEXT</i> is given, only search for triples in that context node.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>has-arc-in</b> <i>NODE ARC</i></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Check that there is a triple with <i>NODE</i> as a subject and <i>ARC</i> as a predicate.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>has-arc-out</b> NODE <i>ARC</i></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Check that there is a triple with <i>NODE</i> as a object and <i>ARC</i> as a predicate.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>parse</b> <i>URI|FILENAME</i> <b>[</b><i>SYNTAX|</i> <b>[</b><i>BASE URI</i><b>]]</b></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Parse syntax at <i>URI</i> into the graph using <i>SYNTAX</i> which can be one of <i>rdfxml</i> (RDF/XML, default), <i>ntriples</i>, <i>turtle</i>, <i>rss-tag-soup</i> (for all RSS and Atoms), <i>grddl</i> and <i>guess</i> to use content hints and protocol information to work it out. (This list changes faster than this manual page) If <i>FILENAME</i> is a existing file, the appropriate URI will be generated for it.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>parse-stream</b> <i>URI|FILENAME</i> <b>[</b><i>SYNTAX</i> <b>[</b><i>BASE URI</i> <b>[</b><i>CONTEXT</i><b>]]</b></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Streaming parse syntax at URI into the graph using <i>SYNTAX</i> which can be one of <i>rdfxml</i> (RDF/XML, default) or <i>ntriples</i>. If <i>FILENAME</i> is an existing file, the appropriate URI will be generated for it. If the optional <i>CONTEXT URI is given, the triples are added to that context.</i></p>
</td>
</tr>
</table>
<!-- TABS -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="13%"></td>
<td width="7%">
<p><b>print</b></p>
</td>
<td width="1%"></td>
<td width="77%">
<p>Print the graph triples in a simple format showing context nodes if present.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>query</b> <i>NAME</i><b>|-</b> <i>URI</i><b>|-</b> <i>QUERY-STRING</i></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Run <i>QUERY-STRING query in language NAME</i> returning variable bindings, a boolean or RDF graph depending on the query. Query language can be &#8217;sparql&#8217; or &#8217;rdql&#8217;.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>remove</b> <i>SUBJECT PREDICATE OBJECT [CONTEXT]</i></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Remove the given triple graph, in the optional Redland context if <i>CONTEXT</i> is given.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>remove-context</b> <i>CONTEXT</i></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Remove all triples in the graph with the Redland context <i>CONTEXT</i>.</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>serialize [</b><i>SYNTAX</i> <b>[</b><i>URI</i> <b>[</b><i>MIME-TYPE</i><b>]]]</b></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Serializes the graph to a syntax with a particular ISYNTAX <i>URI</i> or Internet Media Type/MIME Type. The default is RDF/XML (<i>NAME</i> "rdfxml", MIME Type "application/rdf/xml") if none of the above are given. Other alternatives are "ntriples" (no MIME Type).</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>source</b> <i>PREDICATE OBJECT</i></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>sources</b> <i>PREDICATE OBJECT</i></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Show one node/all nodes that match triples (?, <i>PREDICATE</i>, <i>OBJECT</i>)</p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>target</b> <i>SUBJECT PREDICATE</i></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><b>targets</b> <i>SUBJECT PREDICATE</i></p>
</td>
</tr>
</table>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="21%"></td>
<td width="77%">
<p>Show one node/all nodes that match triples (<i>SUBJECT</i>, <i>PREDICATE</i>, ?)</p>
</td>
</tr>
</table>
<a name="ENVIRONMENT"></a>
<h2>ENVIRONMENT</h2>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p>RDFPROC_STORAGE_OPTIONS can be set to provide storage options instead of using the option &#8722;t, &#8722;&#8722;storage-options <i>OPTIONS</i>. When both are given, command options are applied last.</p>
<!-- INDENTATION -->
<p>RDFPROC_STORAGE_TYPE can be set to provide a storage type instead of using the option &#8722;s, &#8722;&#8722;storage <i>TYPE</i>. When both are given, the storage type from the command is used.</p>
</td>
</tr>
</table>
<a name="CONFORMING_TO"></a>
<h2>CONFORMING TO</h2>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p><i>RDF/XML Syntax (Revised)</i>, W3C Recommendation, <a href="http://www.w3.org/TR/rdf-syntax-grammar/">http://www.w3.org/TR/rdf-syntax-grammar/</a></p>
<!-- INDENTATION -->
<p><i>N-Triples</i>, in <i>RDF Test Cases</i>, Jan Grant and Dave Beckett (eds.) W3C Recommendation, <a href="http://www.w3.org/TR/rdf-testcases/#ntriples">http://www.w3.org/TR/rdf-testcases/#ntriples</a></p>
</td>
</tr>
</table>
<a name="SEE_ALSO"></a>
<h2>SEE ALSO</h2>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p>redland(3), libraptor(3), rapper(1)</p>
</td>
</tr>
</table>
<a name="AUTHOR"></a>
<h2>AUTHOR</h2>
<!-- INDENTATION -->
<table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="10%"></td>
<td width="89%">
<p>Dave Beckett - <a href="http://purl.org/net/dajobe/">http://purl.org/net/dajobe/</a></p>
</td>
</tr>
</table>
<hr />
<p>Copyright 2002-2008 <a href="http://purl.org/net/dajobe/">Dave Beckett</a><br />2002-2008 <a href="http://www.bristol.ac.uk/">University of Bristol</a></p>
</body>
</html>

View File

@@ -0,0 +1,13 @@
/*
* Public Domain getopt header
*
*/
#ifndef RDFPROC_GETOPT_H
#define RDFPROC_GETOPT_H
int getopt(int argc, char * const argv[], const char *optstring);
extern char *optarg;
extern int optind, opterr, optopt;
#endif

View File

@@ -0,0 +1,29 @@
.\" Hey, EMACS: -*- nroff -*-
.\"
.\" redland-db-upgrade.1 - Redland database upgrade utility manual page
.\"
.\" Copyright (C) 2003-2006 David Beckett - http://purl.org/net/dajobe/
.\" Copyright (C) 2003 University of Bristol - http://www.bristol.ac.uk/
.\"
.TH redland-db-upgrade 1 "2003-08-19"
.\" Please adjust this date whenever revising the manpage.
.SH NAME
redland-db-upgrade \- upgrade older Redland databases to 0.9.12 format
.SH SYNOPSIS
.B redland-db-upgrade
\fIold BDB Name\fP \fInew BDB name\fP
.SH DESCRIPTION
\fIredland-db-upgrade\fP converts Redland databases from the format
in 0.9.11 and earlier into the new format. It must be run on
each Redland database. For example if database \fIa\fP
created files \fIa-sp2o.db\fP, \fIa-so2p.db\fP and \fIa-po2s.db\fP
it could be converted to a new database \fIb\fP with:
.IP
redland-db-upgrade a b
.SH SEE ALSO
.BR redland (3),
.SH AUTHOR
Dave Beckett -
.UR http://purl.org/net/dajobe/
http://purl.org/net/dajobe/
.UE

View File

@@ -0,0 +1,43 @@
#!/usr/bin/perl
#
#* touch-mtime.pl - Copy file modification times
#
# Copyright (C) 2007, David Beckett http://purl.org/net/dajobe/
#
# This package is Free Software and part of Redland http://librdf.org/
#
# It is licensed under the following three licenses as alternatives:
# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version
# 2. GNU General Public License (GPL) V2 or any newer version
# 3. Apache License, V2.0 or any newer version
#
# You may not use this file except in compliance with at least one of
# the above three licenses.
#
# See LICENSE.html or LICENSE.txt at the top of this package for the
# complete terms and further detail along with the license texts for
# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively.
#
use File::Basename;
use File::stat;
my $usage="REFERENCE-FILE FILE\n";
my $program=basename $0;
die "USAGE: $usage" if @ARGV != 2;
my($ref,$file)=@ARGV;
my $st;
$st=stat($ref) or die "$program: No such reference file $ref - $!\n";
my $mtime=$st->mtime;
$st=stat($file) or die "$program: No such file $file - $!\n";
utime $mtime, $mtime, $file;