├── .gitignore ├── .travis.yml ├── AUTHORS ├── COPYING ├── COPYING.LIB ├── ChangeLog ├── ChangeLog.1 ├── ChangeLog.10 ├── ChangeLog.11 ├── ChangeLog.12 ├── ChangeLog.2 ├── ChangeLog.3 ├── ChangeLog.4 ├── ChangeLog.5 ├── ChangeLog.6 ├── ChangeLog.7 ├── ChangeLog.8 ├── ChangeLog.9 ├── FAQS.html ├── HACKING.md ├── INSTALL.html ├── LICENSE-2.0.txt ├── LICENSE.html ├── Makefile.am ├── NEWS.html ├── NOTICE ├── README.html ├── RELEASE.html ├── Redland.i ├── TODO.html ├── acinclude.m4 ├── autogen.sh ├── build ├── .gitignore └── pkg.m4 ├── configure.ac ├── data ├── Makefile.am ├── dc.nt ├── dc.rdf └── dc.ttl ├── demos ├── .gitignore ├── Makefile.am ├── demo.pl ├── ntriples.pl ├── parser-tests.pl └── rss-show.pl ├── docs ├── .gitignore ├── Makefile.am ├── README.html ├── overview.xfig ├── redland-changes.tsv ├── redland-chapter-intro.xml ├── redland-chapter-objects.xml ├── redland-chapter-storage-modules.xml ├── redland-docs.xml ├── redland-overrides.txt ├── redland-sections.txt ├── redland.pod ├── redland.types ├── storage.html ├── stylesheet.css ├── tmpl │ ├── .gitignore │ ├── concepts.sgml │ ├── digest.sgml │ ├── files.sgml │ ├── general.sgml │ ├── hash.sgml │ ├── heuristics.sgml │ ├── iterator.sgml │ ├── list.sgml │ ├── log.sgml │ ├── model.sgml │ ├── node.sgml │ ├── parser.sgml │ ├── query.sgml │ ├── query_results.sgml │ ├── redland-unused.sgml │ ├── serializer.sgml │ ├── statement.sgml │ ├── storage.sgml │ ├── stream.sgml │ ├── unicode.sgml │ ├── unused.sgml │ ├── uri.sgml │ └── world.sgml └── version.xml.in ├── examples ├── .gitignore ├── Makefile.am ├── example1.c ├── example2.c ├── example3.c ├── example4.c ├── example5.c ├── example6.c ├── example7.c ├── example8.c ├── redland_dbus.c ├── rss2atom.c └── rss2ical.c ├── redland-config.1 ├── redland-config.in ├── redland-src-config.in ├── redland.pc.in ├── redland.rdf.in ├── redland.sln ├── scripts ├── Makefile.am ├── fix-gtkdoc-header.pl ├── install-raptor.sh ├── install-rasqal.sh ├── markdown-to-html.pl ├── process-changes.pl └── touch-mtime.pl ├── src ├── .gitignore ├── Makefile.am ├── librdf.h.in ├── memcmp.c ├── mysql-v1.ttl ├── mysql-v2.ttl ├── rdf_concepts.c ├── rdf_concepts.h ├── rdf_concepts_internal.h ├── rdf_digest.c ├── rdf_digest.h ├── rdf_digest_internal.h ├── rdf_digest_md5.c ├── rdf_digest_sha1.c ├── rdf_files.c ├── rdf_files.h ├── rdf_hash.c ├── rdf_hash.h ├── rdf_hash_bdb.c ├── rdf_hash_cursor.c ├── rdf_hash_internal.h ├── rdf_hash_memory.c ├── rdf_heuristics.c ├── rdf_heuristics.h ├── rdf_init.c ├── rdf_init.h ├── rdf_init_internal.h ├── rdf_internal.h ├── rdf_iterator.c ├── rdf_iterator.h ├── rdf_iterator_internal.h ├── rdf_list.c ├── rdf_list.h ├── rdf_list_internal.h ├── rdf_log.c ├── rdf_log.h ├── rdf_log_internal.h ├── rdf_model.c ├── rdf_model.h ├── rdf_model_internal.h ├── rdf_model_storage.c ├── rdf_node.c ├── rdf_node.h ├── rdf_node_common.c ├── rdf_node_internal.h ├── rdf_parser.c ├── rdf_parser.h ├── rdf_parser_internal.h ├── rdf_parser_raptor.c ├── rdf_query.c ├── rdf_query.h ├── rdf_query_internal.h ├── rdf_query_rasqal.c ├── rdf_query_results.c ├── rdf_query_virtuoso.c ├── rdf_raptor.c ├── rdf_raptor.h ├── rdf_raptor_internal.h ├── rdf_serializer.c ├── rdf_serializer.h ├── rdf_serializer_internal.h ├── rdf_serializer_raptor.c ├── rdf_statement.c ├── rdf_statement.h ├── rdf_statement_common.c ├── rdf_statement_internal.h ├── rdf_storage.c ├── rdf_storage.h ├── rdf_storage_file.c ├── rdf_storage_hashes.c ├── rdf_storage_internal.h ├── rdf_storage_list.c ├── rdf_storage_module.h ├── rdf_storage_mysql.c ├── rdf_storage_postgresql.c ├── rdf_storage_sql.c ├── rdf_storage_sql_test.c ├── rdf_storage_sqlite.c ├── rdf_storage_trees.c ├── rdf_storage_tstore.c ├── rdf_storage_virtuoso.c ├── rdf_storage_virtuoso_internal.h ├── rdf_stream.c ├── rdf_stream.h ├── rdf_stream_internal.h ├── rdf_types.h ├── rdf_uri.c ├── rdf_uri.h ├── rdf_uri_internal.h ├── rdf_utf8.c ├── rdf_utf8.h ├── redland.h ├── redland.spec.in ├── win32 │ ├── Makefile.am │ ├── README.txt │ ├── librdf.vcproj │ └── msvc.def └── win32_rdf_config.h.in └── utils ├── .gitignore ├── Makefile.am ├── db_upgrade.c ├── fix-groff-xhtml ├── getopt.c ├── rdf-tree.c ├── rdfproc.1 ├── rdfproc.c ├── rdfproc_getopt.h ├── redland-db-upgrade.1 └── redland-virtuoso-test.c /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.db 3 | *.gz 4 | *.log 5 | *.out 6 | *.trs 7 | *test 8 | .deps* 9 | INSTALL 10 | INSTALL.txt 11 | LICENSE.txt 12 | Makefile 13 | Makefile.in 14 | HACKING.html 15 | NEWS 16 | README 17 | TAGS 18 | TODO 19 | aclocal.m4 20 | admin 21 | autom4te.cache 22 | bugs 23 | compile 24 | config.cache 25 | config.log 26 | config.status 27 | configure 28 | gtk-doc.make 29 | libltdl 30 | libtool 31 | mkinstalldirs 32 | not-used 33 | notes 34 | patches 35 | redland.pc 36 | redland.rdf 37 | redland-config 38 | redland-src-config 39 | releases 40 | setup*.sh 41 | saved 42 | stamp-h* 43 | test* 44 | *.stackdump 45 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # see 2 | # http://docs.travis-ci.com/user/getting-started/ 3 | # http://docs.travis-ci.com/user/languages/c/ 4 | # http://docs.travis-ci.com/user/build-configuration/ 5 | # http://docs.travis-ci.com/user/multi-os/ 6 | # 7 | 8 | language: c 9 | 10 | branches: 11 | only: 12 | - master 13 | 14 | # matrix of compilers 15 | compiler: 16 | - gcc 17 | # - clang 18 | # - c++ 19 | 20 | # matrix of OSes (feature flagged; not enabled now) 21 | os: 22 | - linux 23 | - osx 24 | 25 | # matrix of raptor & rasqal versions 26 | env: 27 | - RAPTOR_INSTALL_VERSION=2.0.7 RASQAL_INSTALL_VERSION=0.9.33 28 | - RAPTOR_INSTALL_VERSION=2.0.15 RASQAL_INSTALL_VERSION=0.9.33 29 | - RAPTOR_INSTALL_VERSION=2.0.7 RASQAL_INSTALL_VERSION=0.9.26 30 | - RAPTOR_INSTALL_VERSION=2.0.15 RASQAL_INSTALL_VERSION=0.9.26 31 | 32 | # overall matrix configuration 33 | #matrix: 34 | # allow_failures: 35 | # - os: osx 36 | # 37 | # exclude: 38 | # - compiler: c++ 39 | # env: RAPTOR_INSTALL_VERSION=2.0.7 40 | # - compiler: clang 41 | # env: RAPTOR_INSTALL_VERSION=2.0.7 42 | 43 | 44 | # Install raptor and rasqal extra dependencies too (libyajl-dev) 45 | # since we may build raptor and rasqal from tarballs 46 | install: 47 | - env | sort 48 | - if [ "$TRAVIS_OS_NAME" = "" ]; then TRAVIS_OS_NAME=linux; fi 49 | - if [ "$TRAVIS_OS_NAME" = "linux" ]; then ./scripts/install-bison3.sh; sudo apt-get update -qq -y; sudo apt-get install -qq -y gtk-doc-tools libraptor2-dev libgmp-dev libmhash-dev libpcre3-dev uuid-dev libyajl-dev libgmp-dev; fi 50 | - raptor_min_version=`awk -F= '/RAPTOR_MIN_VERSION=/{print $2}' configure.ac` && ./scripts/install-raptor.sh $raptor_min_version $RAPTOR_INSTALL_VERSION 51 | - rasqal_min_version=`awk -F= '/RASQAL_MIN_VERSION=/{print $2}' configure.ac` && ./scripts/install-rasqal.sh $rasqal_min_version $RASQAL_INSTALL_VERSION 52 | - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; brew install raptor rasqal bison gtk-doc yajl mhash pcre; fi 53 | 54 | script: ./autogen.sh && make && make check 55 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Dave Beckett 2 | Morten Frederiksen - http://purl.org/net/morten/ (MySQL Store) 3 | Dave Robillard 4 | Lauri Aalto 5 | -------------------------------------------------------------------------------- /ChangeLog.5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dajobe/librdf/3ec9bda623107f9b1c86c0a3f261ffd3f8a40965/ChangeLog.5 -------------------------------------------------------------------------------- /ChangeLog.6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dajobe/librdf/3ec9bda623107f9b1c86c0a3f261ffd3f8a40965/ChangeLog.6 -------------------------------------------------------------------------------- /LICENSE.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Redland librdf RDF API Library - License 6 | 7 | 8 | 9 |

Redland librdf RDF API Library - License

10 | 11 |

This package is Free Software available under any one of the 12 | specified licenses below. All the licenses below are alternatives 13 | and if you select one license, that one alone applies.

14 | 15 |

1. The GNU Lesser General Public License (LGPL) Version 2.1 or any newer version

16 | 17 |

See http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html or COPYING.LIB for the full license text.

18 | 19 |
20 | 21 |
22 |

Copyright (C) 2000-2012 David Beckett
23 | Copyright (C) 2000-2005 University of Bristol. 24 | All Rights Reserved.

25 | 26 |

This package is free software; you can redistribute it and/or 27 | modify it under the terms of the GNU Lesser General Public 28 | License Version 2.1 as published by the Free Software Foundation 29 | or any newer version.

30 | 31 |

This package is distributed in the hope that it will be useful, 32 | but WITHOUT ANY WARRANTY; without even the implied warranty of 33 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 34 | Lesser General Public License Version 2.1 for more details.

35 | 36 |

You should have received a copy of the GNU Lesser General 37 | Public License Version 2.1 along with this package; if not, write 38 | to the Free Software Foundation, Inc., 51 Franklin St, Fifth 39 | Floor, Boston, MA 02110-1301 USA

40 | 41 |
42 | 43 |
44 | 45 |

2. GNU General Public License (GPL) V2 or any newer version

46 | 47 |

Under Term 3 of the LGPL Version 2.1, you may choose 48 | to license the entire package under the GPL. If that option is 49 | chosen, then this package is licensed under the terms of the GPL Version 2 50 | or alternatively, any newer version of the GPL. 51 | See COPYING for the full GPL license text.

52 | 53 | 54 |

3. The Apache License V2.0 or any newer version

55 | 56 |

See http://www.apache.org/licenses/LICENSE-2.0 or LICENSE-2.0.txt for the full ASL 2.0 license text. 57 |

58 | 59 |
60 | 61 |

Copyright (C) 2000-2012 David Beckett
62 | Copyright (C) 2000-2005 University of Bristol.

63 | 64 |

Licensed under the Apache License, Version 2.0 (the "License"); 65 | you may not use this file except in compliance with the License. 66 | You may obtain a copy of the License at:

67 | 68 |

http://www.apache.org/licenses/LICENSE-2.0

69 | 70 |

Unless required by applicable law or agreed to in writing, software 71 | distributed under the License is distributed on an "AS IS" BASIS, 72 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 73 | See the License for the specific language governing permissions and 74 | limitations under the License.

75 |
76 | 77 |

The NOTICE file contains the notices that 78 | must be applied according to section 4(d) of the Apache License, 79 | Version 2.0.

80 | 81 |
82 | 83 |

Copyright (C) 2000-2024 Dave Beckett
Copyright (C) 2000-2005 University of Bristol

84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- Mode: Makefile -*- 2 | # 3 | # Makefile.am - top level automake file for Redland 4 | # 5 | # Copyright (C) 2000-2009 David Beckett http://www.dajobe.org/ 6 | # Copyright (C) 2000-2005 University of Bristol, UK http://www.bristol.ac.uk/ 7 | # 8 | # This package is Free Software and part of Redland http://librdf.org/ 9 | # 10 | # It is licensed under the following three licenses as alternatives: 11 | # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | # 2. GNU General Public License (GPL) V2 or any newer version 13 | # 3. Apache License, V2.0 or any newer version 14 | # 15 | # You may not use this file except in compliance with at least one of 16 | # the above three licenses. 17 | # 18 | # See LICENSE.html or LICENSE.txt at the top of this package for the 19 | # complete terms and further detail along with the license texts for 20 | # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | # 22 | # 23 | 24 | bin_SCRIPTS = redland-config 25 | noinst_SCRIPTS = redland-src-config 26 | 27 | man_MANS = redland-config.1 28 | 29 | dist_pkgdata_DATA = Redland.i 30 | 31 | pkgconfigdir = $(libdir)/pkgconfig 32 | pkgconfig_DATA = redland.pc 33 | 34 | DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc 35 | 36 | # Subdirectories to build/install/distribute etc. 37 | SUBDIRS=$(subdirs) src examples utils demos docs data scripts 38 | 39 | EXTRA_DIST=\ 40 | ChangeLog.1 ChangeLog.2 ChangeLog.3 ChangeLog.4 \ 41 | ChangeLog.5 ChangeLog.6 ChangeLog.7 ChangeLog.8 ChangeLog.9 ChangeLog.10 \ 42 | ChangeLog.11 ChangeLog.12 \ 43 | README LICENSE.txt TODO \ 44 | README.html NEWS.html LICENSE.html TODO.html \ 45 | RELEASE.html INSTALL.html FAQS.html \ 46 | LICENSE-2.0.txt NOTICE \ 47 | HACKING.md HACKING.html \ 48 | redland.rdf.in \ 49 | autogen.sh \ 50 | redland-config.in \ 51 | redland-src-config.in \ 52 | $(man_MANS) \ 53 | redland.sln \ 54 | gtk-doc.make \ 55 | redland.pc.in 56 | 57 | if MAINTAINER_MODE 58 | # Create some text files from HTML sources 59 | LYNX=lynx 60 | 61 | HTML_TO_TEXT=TERM=vt100 $(LYNX) -dump $< | sed -e 's,file://localhost.*librdf/,,' > $@ 62 | 63 | SUFFIXES = .html .txt 64 | 65 | .html.txt: 66 | $(HTML_TO_TEXT) 67 | 68 | README: README.html 69 | $(HTML_TO_TEXT) 70 | 71 | NEWS: NEWS.html 72 | $(HTML_TO_TEXT) 73 | 74 | TODO: TODO.html 75 | $(HTML_TO_TEXT) 76 | 77 | HACKING.html: HACKING.md $(top_srcdir)/scripts/markdown-to-html.pl 78 | $(PERL) $(top_srcdir)/scripts/markdown-to-html.pl $< $@ 79 | 80 | endif 81 | 82 | @SET_MAKE@ 83 | 84 | install-data-hook: 85 | $(PERL) $(srcdir)/scripts/touch-mtime.pl $(srcdir)/Redland.i $(DESTDIR)$(pkgdatadir)/Redland.i 86 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | This product includes Redland software (http://librdf.org/) 2 | developed at the Institute for Learning and Research Technology, 3 | University of Bristol, UK (http://www.bristol.ac.uk/). 4 | -------------------------------------------------------------------------------- /README.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Redland librdf RDF API Library 6 | 7 | 8 | 9 | 10 |

Redland librdf RDF API Library

11 |

Dave Beckett

12 | 13 | 14 |

Overview

15 | 16 |

Redland librdf is a 17 | library that provides a high-level interface for 18 | the Resource Description Framework (RDF) allowing the RDF 19 | graph to be parsed from XML, stored, queried and manipulated. 20 | Redland librdf implements each of the RDF concepts in its own class via an 21 | object based API, reflected into the language APIs, currently C#, Java, 22 | Perl, PHP, Python, Ruby and Tcl. Several classes providing functionality 23 | such as for parsers, storage are built as modules that can be loaded 24 | at compile or run-time as required.

25 | 26 |

This is a mature and stable RDF library developed since 2000 27 | used in multiple projects. See the 28 | FAQS for general information 29 | and the Redland issue tracker 30 | for known bugs and issues. A summary 31 | of the changes can be found in the NEWS file, 32 | detailed API changes in the release notes 33 | and file-by-file changes in the Subversion ChangeLog.

34 | 35 |

Redland librdf provides:

36 |
    37 |
  • A modular, object based library written in C
  • 38 |
  • APIs for manipulating the RDF graph and parts - Statements, Resources and Literals
  • 39 |
  • Language Bindings in Perl, PHP, Python and Ruby via the Redland Bindings package.
  • 40 |
  • Reading and writing multiple RDF syntaxes with Parsers and Serializers via the Raptor RDF Parser Toolkit.
  • 41 |
  • Storage for graphs in memory and persistently with Sleepycat/Berkeley DB, MySQL 3-5, PostgreSQL, SQLite, Openlink Virtuoso, in-memory Trees, files or URIs.
  • 42 |
  • Query language support for SPARQL 1.0 (some 1.1) and RDQL using Rasqal.
  • 43 |
  • APIs for accessing the graph by Statement (triples) or by Nodes and Arcs
  • 44 |
  • Contexts for managing aggregating named graphs and recording provenance.
  • 45 |
  • Statement Streams for efficient construction, parsing and serialisation of graphs
  • 46 |
  • rdfproc RDF processor utility program
  • 47 |
  • No memory leaks.
  • 48 |
49 | 50 | 51 |

Sources

52 | 53 |

The packaged sources are available from 54 | http://download.librdf.org/source/. 55 | The development GIT sources can also be 56 | browsed on GitHub 57 | or checked out at git://github.com/dajobe/librdf.git 58 |

59 | 60 |

librdf requires 61 | Raptor 2.0.7 or newer 62 | and 63 | Rasqal 0.9.26 or newer 64 | to build and run, which can be downloaded from the same area 65 | as the librdf source and binaries.

66 | 67 | 68 |

License

69 | 70 |

This library is free software / open source software released 71 | under the LGPL 2.1 (GPL) or Apache 2.0 licenses. See 72 | LICENSE.html for full details.

73 | 74 | 75 |

Installation and Documentation

76 | 77 |

See INSTALL.html for general 78 | installation and configuration information.

79 | 80 |

Further documentation is available in the 81 | documents area including the 82 | API reference document and 83 | detailed storage modules information. 84 |

85 | 86 | 87 |

Mailing Lists

88 | 89 |

The 90 | Redland mailing lists 91 | discuss the development and use of the Redland libraries as well as 92 | future plans and announcement of releases.

93 | 94 | 95 |
96 | 97 |

Copyright (C) 2000-2024 Dave Beckett
Copyright (C) 2000-2005 University of Bristol

98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /TODO.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Redland librdf RDF API Library - To Do List 6 | 7 | 8 | 9 |

Redland librdf RDF API Library - To Do list

10 | 11 |

Bugs and Features

12 | 13 |

Bugs should be reported at the 14 | Redland Issue Tracker. 15 |

16 | 17 |
18 | 19 |

Copyright (C) 2000-2024 Dave Beckett
Copyright (C) 2000-2005 University of Bristol

20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /acinclude.m4: -------------------------------------------------------------------------------- 1 | dnl empty 2 | -------------------------------------------------------------------------------- /build/.gitignore: -------------------------------------------------------------------------------- 1 | argz.m4 2 | ar-lib 3 | compile 4 | config.guess 5 | config.sub 6 | depcomp 7 | gtk-doc.m4 8 | install-sh 9 | libtool.m4 10 | ltargz.m4 11 | ltdl.m4 12 | ltmain.sh 13 | lt~obsolete.m4 14 | ltoptions.m4 15 | ltsugar.m4 16 | ltversion.m4 17 | missing 18 | test-driver 19 | -------------------------------------------------------------------------------- /data/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- Mode: Makefile -*- 2 | # 3 | # Makefile.am - data automake file for Redland 4 | # 5 | # Copyright (C) 2004-2006, David Beckett http://purl.org/net/dajobe/ 6 | # Copyright (C) 2004-2004, University of Bristol, UK http://www.bristol.ac.uk/ 7 | # 8 | # This package is Free Software and part of Redland http://librdf.org/ 9 | # 10 | # It is licensed under the following three licenses as alternatives: 11 | # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | # 2. GNU General Public License (GPL) V2 or any newer version 13 | # 3. Apache License, V2.0 or any newer version 14 | # 15 | # You may not use this file except in compliance with at least one of 16 | # the above three licenses. 17 | # 18 | # See LICENSE.html or LICENSE.txt at the top of this package for the 19 | # complete terms and further detail along with the license texts for 20 | # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | # 22 | # 23 | EXTRA_DIST=dc.nt dc.rdf dc.ttl 24 | -------------------------------------------------------------------------------- /data/dc.nt: -------------------------------------------------------------------------------- 1 | "Dave Beckett" . 2 | "The generic home page of Dave Beckett." . 3 | "Dave Beckett's Home Page" . 4 | -------------------------------------------------------------------------------- /data/dc.rdf: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | Dave Beckett's Home Page 6 | Dave Beckett 7 | The generic home page of Dave Beckett. 8 | 9 | 10 | -------------------------------------------------------------------------------- /data/dc.ttl: -------------------------------------------------------------------------------- 1 | @prefix dc: . 2 | 3 | 4 | dc:creator "Dave Beckett" ; 5 | dc:description "The generic home page of Dave Beckett." ; 6 | dc:title "Dave Beckett's Home Page" . 7 | -------------------------------------------------------------------------------- /demos/.gitignore: -------------------------------------------------------------------------------- 1 | TAGS 2 | db 3 | run* 4 | -------------------------------------------------------------------------------- /demos/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST=demo.pl ntriples.pl parser-tests.pl rss-show.pl 2 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | *.stamp 2 | README 3 | filtered_rdf_log.h 4 | html 5 | overview.pdf 6 | overview.png 7 | overview.ps 8 | redland-changes.xml 9 | redland-decl-list.txt 10 | redland-decl.txt 11 | redland-undeclared.txt 12 | redland-undocumented.txt 13 | redland-unused.txt 14 | redland.3 15 | redland.actions 16 | redland.args 17 | redland.hierarchy 18 | redland.interfaces 19 | redland.prerequisites 20 | redland.signals 21 | version.xml 22 | xml 23 | -------------------------------------------------------------------------------- /docs/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- Mode: Makefile -*- 2 | # 3 | # Makefile.am - docs automake file for Redland librdf 4 | # 5 | # Copyright (C) 2000-2011, David Beckett http://www.dajobe.org/ 6 | # Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ 7 | # 8 | # This package is Free Software and part of Redland http://librdf.org/ 9 | # 10 | # It is licensed under the following three licenses as alternatives: 11 | # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | # 2. GNU General Public License (GPL) V2 or any newer version 13 | # 3. Apache License, V2.0 or any newer version 14 | # 15 | # You may not use this file except in compliance with at least one of 16 | # the above three licenses. 17 | # 18 | # See LICENSE.html or LICENSE.txt at the top of this package for the 19 | # complete terms and further detail along with the license texts for 20 | # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | # 22 | # 23 | 24 | 25 | # The name of the module. 26 | DOC_MODULE=redland 27 | 28 | # The top-level SGML file. 29 | DOC_MAIN_SGML_FILE=redland-docs.xml 30 | 31 | # Extra options to supply to gtkdoc-scan 32 | SCAN_OPTIONS= --deprecated-guards="LIBRDF_DISABLE_DEPRECATED" 33 | 34 | # The directory containing the source code. Relative to $(srcdir) 35 | DOC_SOURCE_DIR=$(top_srcdir)/src 36 | 37 | 38 | # Used for dependencies 39 | HFILE_GLOB=$(top_srcdir)/src/*.h $(builddir)/filtered_rdf_log.h 40 | CFILE_GLOB=$(top_srcdir)/src/*.c 41 | 42 | IGNORE_CFILES= 43 | 44 | # Use fixed version of rdf_log.h 45 | EXTRA_HFILES= $(builddir)/filtered_rdf_log.h 46 | 47 | # Headers to ignore: yes rdf_log.h is intended to be in this list 48 | # since it is added as a fixed file filtered_rdf_log.h by EXTRA_HFILES above 49 | IGNORE_HFILES= \ 50 | rdf_log.h \ 51 | rdf_config.h \ 52 | win32_rdf_config.h \ 53 | rdf_types.h \ 54 | redland.h \ 55 | rdf_internal.h \ 56 | rdf_avltree_internal.h \ 57 | rdf_concepts_internal.h \ 58 | rdf_digest_internal.h \ 59 | rdf_hash_internal.h \ 60 | rdf_init_internal.h \ 61 | rdf_iterator_internal.h \ 62 | rdf_list_internal.h \ 63 | rdf_log_internal.h \ 64 | rdf_model_internal.h \ 65 | rdf_node_internal.h \ 66 | rdf_parser_internal.h \ 67 | rdf_query_internal.h \ 68 | rdf_raptor_internal.h \ 69 | rdf_serializer_internal.h \ 70 | rdf_statement_internal.h \ 71 | rdf_storage_internal.h \ 72 | rdf_storage_virtuoso_internal.h \ 73 | rdf_stream_internal.h \ 74 | rdf_uri_internal.h 75 | 76 | # CFLAGS and LDFLAGS for compiling scan program. Only needed 77 | # if $(DOC_MODULE).types is non-empty. 78 | AM_CPPFLAGS = 79 | GTKDOC_LIBS = 80 | 81 | # Extra options to supply to gtkdoc-mkdb 82 | MKDB_OPTIONS=--sgml-mode --output-format=xml --ignore-files="$(IGNORE_CFILES)" 83 | 84 | # Extra options to supply to gtkdoc-mktmpl 85 | MKTMPL_OPTIONS= 86 | 87 | # Non-autogenerated SGML files to be included in $(DOC_MAIN_SGML_FILE) 88 | content_files = \ 89 | redland-changes.xml \ 90 | redland-chapter-intro.xml \ 91 | redland-chapter-objects.xml \ 92 | redland-chapter-storage-modules.xml \ 93 | version.xml 94 | 95 | # Images to copy into HTML directory 96 | HTML_IMAGES = 97 | 98 | # Extra options to supply to gtkdoc-fixref 99 | FIXXREF_OPTIONS= 100 | 101 | # gtkdoc might not define this 102 | DISTCLEANFILES= 103 | 104 | include $(top_srcdir)/gtk-doc.make 105 | 106 | man_MANS=redland.3 107 | 108 | # Other files to distribute 109 | EXTRA_DIST += README.html README \ 110 | storage.html \ 111 | redland.pod \ 112 | $(man_MANS) \ 113 | version.xml.in \ 114 | redland-changes.tsv 115 | 116 | DISTCLEANFILES += \ 117 | filtered_rdf_log.h 118 | 119 | CLEANFILES += README \ 120 | pod2htm* 121 | 122 | $(builddir)/filtered_rdf_log.h: $(top_srcdir)/src/rdf_log.h $(srcdir)/../scripts/fix-gtkdoc-header.pl 123 | $(PERL) $(srcdir)/../scripts/fix-gtkdoc-header.pl < $< > $@ 124 | 125 | # Create some text files from HTML sources 126 | LYNX=lynx 127 | LYNXARGS=-dump -nolist 128 | 129 | 130 | if MAINTAINER_MODE 131 | redland.3: redland.pod 132 | pod2man --section=3 --center="Redland RDF Application Framework" \ 133 | --release="`date +%d-%b-%Y`" --date="@PACKAGE@ @PACKAGE_VERSION@" $< | \ 134 | sed -e "s;REDLAND_VERSION_STRING;@PACKAGE_VERSION@;" \ 135 | -e 's;^Redland Resource;redland \\- Resource;' > $@ 136 | rm -f pod2htm* 137 | else 138 | redland.3: redland.pod 139 | @echo "Creating fake $@ since maintainer mode is not enabled" 140 | touch $@ 141 | 142 | endif 143 | 144 | README: README.html 145 | $(LYNX) $(LYNXARGS) $< > $@ 146 | 147 | if MAINTAINER_MODE 148 | redland-changes.xml: $(srcdir)/redland-changes.tsv $(srcdir)/../scripts/process-changes.pl 149 | $(PERL) $(srcdir)/../scripts/process-changes.pl --package redland --docbook-xml $@ "Redland librdf" $(srcdir)/redland-changes.tsv 150 | 151 | endif 152 | -------------------------------------------------------------------------------- /docs/README.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Redland RDF Application Framework - Documentation 6 | 7 | 8 | 9 |

Redland RDF Application Framework - Documentation

10 | 11 |

DOCUMENTS

12 | 13 |

The latest documentation is on the 14 | Redland Web Site.

15 | 16 | 25 | 26 | 27 |

API DOCUMENTATION

28 | 29 |

The API DocBook documentation is generated automatically from the 30 | source code using the Linux kernel kernel-doc program which 31 | you can get as the file scripts/kernel-doc in the distribution. Each 32 | of the higher level language APIs contains a mapping to the core C 33 | API and may also include extra documentation describing 34 | the native APIs along with examples of use. 35 |

36 | 37 | 48 | 49 | 50 |

PAPERS

51 | 52 |

The design and implementation of Redland are discussed in detail 53 | in the paper 54 | The Design and Implementation of the Redland RDF Application Framework presented at the 55 | WWW10 conference, May 2001. 56 | (pre-print).

57 | 58 |

The details of the technology of the 59 | WSE and RDN-WSE 60 | projects that are based on Redland are reported in 61 | Web Crawling High-Quality Metadata using RDF and Dublin Core, presented at the 62 | WWW2002 conference, May 2002. 63 |

64 | 65 |
66 | 67 |

Copyright 2000-2007 Dave Beckett, Copyright 2000-2004 University of Bristol

68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /docs/redland-changes.tsv: -------------------------------------------------------------------------------- 1 | # OLD VERSIONOLD RETURNOLD NAMEOLD ARGSNEW VERSIONNEW RETURNNEW NAMENEW ARGSNOTES 2 | # OLD VERSIONtypeOLD NAME-NEW VERSIONtypeNEW NAME-NOTES 3 | # OLD VERSIONenumOLD NAME-NEW VERSIONtypeNEW NAME-NOTES 4 | # 5 | # Functions 6 | # 7 | 1.0.12 - - - 1.0.13 const raptor_syntax_description* librdf_parser_get_description (librdf_world* world, unsigned int counter) Deprecates librdf_parser_enumerate() 8 | 1.0.12 - - - 1.0.13 const raptor_syntax_description* librdf_query_results_formats_get_description (librdf_world* world, unsigned int counter) Deprecates librdf_query_results_formats_enumerate() 9 | 1.0.12 - - - 1.0.13 const raptor_syntax_description* librdf_serializer_get_description (librdf_world* world, unsigned int counter) Deprecates librdf_serializer_enumerate() 10 | 1.0.13 - - - 1.0.14 int librdf_parser_parse_iostream_as_stream (librdf_parser* parser, raptor_iostream *iostream, librdf_uri* base_uri) - 11 | 1.0.13 - - - 1.0.14 int librdf_parser_parse_iostream_into_model (librdf_parser* parser, raptor_iostream *iostream, librdf_uri* base_uri, librdf_model* model) - 12 | 1.0.13 - - - 1.0.14 const raptor_syntax_description* librdf_query_language_get_description (librdf_world* world, unsigned int counter) - 13 | 1.0.13 - - - 1.0.14 int librdf_unicode_char_to_utf8 (librdf_unichar c, unsigned char *output, int length) Documented but deprecated for raptor_unicode_utf8_string_put_char() 14 | 1.0.13 - - - 1.0.14 int librdf_utf8_to_unicode_char (librdf_unichar *output, const unsigned char *input, int length) Documented but deprecated for raptor_unicode_utf8_string_get_char() 15 | 1.0.13 - - - 1.0.14 unsigned char* librdf_utf8_to_latin1 (const unsigned char *input, int length, int *output_length) - 16 | 1.0.13 - - - 1.0.14 unsigned char* librdf_latin1_to_utf8 (const unsigned char *input, int length, int *output_length) - 17 | 1.0.13 - - - 1.0.14 void librdf_utf8_print (const unsigned char *input, int length, FILE *stream) - 18 | 1.0.14 - - - 1.0.15 void librdf_free_memory (void *ptr) - 19 | 1.0.14 - - - 1.0.15 void* librdf_alloc_memory (size_t size) - 20 | 1.0.14 - - - 1.0.15 void* librdf_calloc_memory (size_t nmemb, size_t size) - 21 | 1.0.14 - - - 1.0.15 librdf_statement* librdf_new_statement_from_statement2 (librdf_statement* statement) - 22 | 1.0.14 - - - 1.0.15 librdf_hash* librdf_new_hash (librdf_world *world, const char *name) - 23 | 1.0.15 - - - 1.0.16 void librdf_world_set_raptor_init_handler (librdf_world* world, void* user_data, librdf_raptor_init_handler handler) - 24 | 1.0.15 - - - 1.0.16 void librdf_world_set_rasqal_init_handler (librdf_world* world, void* user_data, librdf_rasqal_init_handler handler) - 25 | 1.0.15 - - - 1.0.16 unsigned char* librdf_utf8_to_latin1_2 (const unsigned char *input, size_t length, unsigned char discard, size_t *output_length) Replaces librdf_utf8_to_latin1() 26 | 1.0.15 - - - 1.0.16 unsigned char* librdf_latin1_to_utf8_2 (const unsigned char *input, size_t length, size_t *output_length) Replaces librdf_latin1_to_utf8() 27 | # 28 | # Types 29 | # 30 | 1.0.12 type - - 1.0.13 type LIBRDF_VERSION - - 31 | 1.0.12 type - - 1.0.13 type LIBRDF_VERSION_STRING - - 32 | 1.0.12 type - - 1.0.13 type LIBRDF_VERSION_MAJOR - - 33 | 1.0.12 type - - 1.0.13 type LIBRDF_VERSION_MINOR - - 34 | 1.0.12 type - - 1.0.13 type LIBRDF_VERSION_RELEASE - - 35 | 1.0.12 type librdf_uri - 1.0.13 type librdf_uri - Now a typedef for raptor_uri 36 | 1.0.12 type librdf_node - 1.0.13 type librdf_node - Now a typedef for raptor_term 37 | 1.0.12 type librdf_statement - 1.0.13 type librdf_statement - Now a typedef for raptor_statement 38 | 1.0.15 type - - 1.0.16 type librdf_raptor_init_handler - - 39 | 1.0.15 type - - 1.0.16 type librdf_rasqal_init_handler - - 40 | 1.0.16 type - - 1.0.16 type librdf_license_string - - 41 | 1.0.16 type - - 1.0.16 type librdf_home_url_string - - 42 | # 43 | # Enums 44 | # 45 | -------------------------------------------------------------------------------- /docs/redland-chapter-intro.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | Introduction 7 | 8 | This document describes the APIs provided by 9 | Redland to use the RDF 10 | model; manipulate statements, resources, predicates and objects in the model; 11 | parse RDF/XML syntax, query and store the models. 12 | 13 | See also the Redland Home Page 14 | and the main document overview. 15 | 16 | 17 | 18 | 19 | 25 | -------------------------------------------------------------------------------- /docs/redland-chapter-objects.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | Objects in C 6 | 7 | 8 | Redland uses objects and is written in C, which has no built in support for 9 | object construction, destruction, copying etc. This library thus uses 10 | conventions for the names of the routines providing the 11 | constructor, destructor and copy constructor functionality for a class as 12 | well as conventions for the general methods. 13 | 14 | 15 | 16 | A class FOO is defined as a C typedef librdf_foo, 17 | and its a public interface defined in rdf_foo.h 18 | along with any public or private types, enumerations or constants. 19 | The private definitions are not exposed to library users, only 20 | internally when the library is built. The implementation of the 21 | class is defined in file rdf_foo.c and may 22 | include private (static) functions either for internal 23 | implementations or to satisfy part of a factory API. 24 | 25 | 26 | Each class may have a class initialiser / termination pair 27 | of functions which must be called before any object in the class is created, 28 | and after the last object has been freed. These are defined with signatures 29 | like: 30 | 31 | void init_librdf_foo (...) 32 | void terminate_librdf_foo (void) 33 | 34 | The arguments to the initialisation vary since there are sometimes 35 | some class wide options that can be set at initialisation time. 36 | 37 | 38 | 39 | The object constructor(s) are defined with signatures like: 40 | 41 | librdf_foo* librdf_new_foo(void) 42 | 43 | which takes no parameters. Additional constructors can be defined 44 | with parameters, and are named in a similar way with an extra part 45 | appropriate for the name for example: 46 | 47 | librdf_foo* librdf_new_foo_with_options(char *options) 48 | 49 | 50 | 51 | A copy constructor may be defined which will have the signature: 52 | 53 | librdf_foo* librdf_new_foo_from_foo(librdf_foo* old_foo) 54 | 55 | 56 | 57 | A destructor must be defined and has the signature: 58 | 59 | void librdf_free_foo(librdf_foo* foo) 60 | 61 | 62 | 63 | Methods of the class have names starting with librdf_foo_ and 64 | examples could be: 65 | 66 | /* accessor functions to object part 'thing' */ 67 | int librdf_foo_set_thing(librdf_foo* foo, char *thing) 68 | char *librdf_foo_get_thing(librdf_foo* foo) 69 | 70 | 71 | 72 | It is often convenient to get a string representation of an 73 | object for further processing, debugging or serialisation. There are 74 | two conventions for methods that provide this functionality - the 75 | first is when a pointer is returned to a shared 76 | copy of the string and in that case the method ends 77 | _as_string. The second is when a pointer is 78 | returned to a newly allocated string in which 79 | case the method ends _to_string. 80 | 81 | 82 | 83 | 89 | -------------------------------------------------------------------------------- /docs/redland.types: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dajobe/librdf/3ec9bda623107f9b1c86c0a3f261ffd3f8a40965/docs/redland.types -------------------------------------------------------------------------------- /docs/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* CSS from many places */ 2 | 3 | body { 4 | margin: 0em; 5 | font-family: Arial, Helvetica, Geneva, SunSans-Regular, sans-serif; 6 | background-color: white; 7 | color: black; 8 | } 9 | 10 | /* NS 4 needs this */ 11 | th, td, p, li, dl, dt, blockquote { 12 | font-family: Arial, Helvetica, Geneva, SunSans-Regular, sans-serif; 13 | } 14 | 15 | ol,ul { font-size: 100% } 16 | 17 | h1, h2, h3, h4 { text-align: left; } 18 | 19 | h1 { font-weight: normal; font-size: 200%; font-family: Arial, Helvetica, Geneva, SunSans-Regular, sans-serif; } 20 | h2 { font-weight: bold; font-size: 130%; font-family: Arial, Helvetica, Geneva, SunSans-Regular, sans-serif; margin-top: 0em; } 21 | h3 { font-weight: bold; font-size: 110%; font-family: Arial, Helvetica, Geneva, SunSans-Regular, sans-serif; } 22 | h4 { font-weight: bold; font-size: 100%; font-family: Arial, Helvetica, Geneva, SunSans-Regular, sans-serif; } 23 | 24 | 25 | pre { 26 | margin: 1em; 27 | color: black; 28 | background-color: #eee; 29 | padding: 0.5em; 30 | border-color: #006; 31 | border-width: 1px; 32 | border-style: dotted; 33 | } 34 | 35 | 36 | /* NS 4 needs this */ 37 | pre, code, tt { 38 | font-family: Courier, monospace; 39 | } 40 | -------------------------------------------------------------------------------- /docs/tmpl/.gitignore: -------------------------------------------------------------------------------- 1 | *.bak 2 | -------------------------------------------------------------------------------- /docs/tmpl/digest.sgml: -------------------------------------------------------------------------------- 1 | 2 | Digests 3 | 4 | 5 | Content digests. 6 | 7 | 8 | 9 | Create a message digest over a block of data. Includes implementations 10 | of MD5, RMD160 and SHA1. 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | @world: 42 | @name: 43 | @Returns: 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | @digest: 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | @digest: 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | @digest: 68 | @buf: 69 | @length: 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | @digest: 78 | @string: 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | @digest: 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | @digest: 95 | @Returns: 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | @digest: 104 | @Returns: 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | @digest: 113 | @Returns: 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | @digest: 122 | @fh: 123 | 124 | 125 | -------------------------------------------------------------------------------- /docs/tmpl/files.sgml: -------------------------------------------------------------------------------- 1 | 2 | Files 3 | 4 | 5 | File utility functions. 6 | 7 | 8 | 9 | Portable utility functions for handling files. 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | @void: 29 | @Returns: 30 | 31 | 32 | -------------------------------------------------------------------------------- /docs/tmpl/general.sgml: -------------------------------------------------------------------------------- 1 | 2 | General 3 | 4 | 5 | Static variables and memory handling. 6 | 7 | 8 | 9 | Static variables for version numbers and strings, copyright strings and 10 | home page. Functions for in-library memory allocation and deallocation. 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | @size: 119 | @Returns: 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | @nmemb: 128 | @size: 129 | @Returns: 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | @ptr: 138 | 139 | 140 | 141 | 142 | When defined before a function, indicates that the function 143 | has been deprecated and may be replaced in a future release. 144 | With some versions of gcc this may give a compilation warning. 145 | 146 | 147 | 148 | 149 | -------------------------------------------------------------------------------- /docs/tmpl/hash.sgml: -------------------------------------------------------------------------------- 1 | 2 | Hashes 3 | 4 | 5 | Key:Value hashes or dictionaries. 6 | 7 | 8 | 9 | Interface to implementations of key:value hashes either in memory, on 10 | disk and with persistence. Keys may have multiple and duplicate values. 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | @world: 42 | @name: 43 | @Returns: 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | @world: 52 | @name: 53 | @string: 54 | @Returns: 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | @world: 63 | @name: 64 | @array: 65 | @Returns: 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | @old_hash: 74 | @Returns: 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | @hash: 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | @hash: 91 | @key: 92 | @Returns: 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | @hash: 101 | @key: 102 | @Returns: 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | @hash: 111 | @key: 112 | @Returns: 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | @hash: 121 | @key: 122 | @Returns: 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | @hash: 131 | @key: 132 | @value: 133 | @Returns: 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | @hash: 142 | @fh: 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | @hash: 151 | @fh: 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | @hash: 160 | @key_string: 161 | @fh: 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | @template_string: 170 | @dictionary: 171 | @prefix: 172 | @suffix: 173 | @Returns: 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | @hash: 182 | @string: 183 | @Returns: 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | @hash: 192 | @filter: 193 | @Returns: 194 | 195 | 196 | -------------------------------------------------------------------------------- /docs/tmpl/heuristics.sgml: -------------------------------------------------------------------------------- 1 | 2 | Heuristics 3 | 4 | 5 | Utility heuristic functions. 6 | 7 | 8 | 9 | Various utility functions for performing heuristics such as 10 | generating a name, guessing if a string is a URI or RDF literal. 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | @name: 30 | @Returns: 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | @node: 39 | @Returns: 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | @node: 48 | @Returns: 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | @object: 57 | @Returns: 58 | 59 | 60 | -------------------------------------------------------------------------------- /docs/tmpl/iterator.sgml: -------------------------------------------------------------------------------- 1 | 2 | Iterator 3 | 4 | 5 | Iterate a sequence of objects across some other object. 6 | 7 | 8 | 9 | Provides a way to operate across a sequence of objects that are 10 | generated one-by-one on demand. The returned objects can be of any 11 | type but the main public methods are on the #librdf_model classs and 12 | return sequence of #librdf_node objects such as librdf_model_get_sources(). 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | @LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: 38 | @LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: 39 | @LIBRDF_ITERATOR_GET_METHOD_GET_KEY: 40 | @LIBRDF_ITERATOR_GET_METHOD_GET_VALUE: 41 | 42 | 43 | 44 | 45 | 46 | 47 | @iterator: 48 | @map_context: 49 | @item: 50 | @Returns: 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | @map_context: 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | @world: 67 | @context: 68 | @is_end_method: 69 | @next_method: 70 | @get_method: 71 | @finished_method: 72 | @Returns: 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | @iterator: 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | @iterator: 89 | @Returns: 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | @iterator: 98 | @Returns: 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | @iterator: 107 | @Returns: 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | @iterator: 116 | @Returns: 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | @iterator: 125 | @Returns: 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | @iterator: 134 | @Returns: 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | @iterator: 143 | @Returns: 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | @iterator: 152 | @map_function: 153 | @free_context: 154 | @map_context: 155 | @Returns: 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | @world: 164 | @Returns: 165 | 166 | 167 | -------------------------------------------------------------------------------- /docs/tmpl/list.sgml: -------------------------------------------------------------------------------- 1 | 2 | List 3 | 4 | 5 | Simple list class. 6 | 7 | 8 | 9 | A simple list class used internally. 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | @world: 35 | @Returns: 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | @list: 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | @list: 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | @list: 60 | @data: 61 | @Returns: 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | @list: 70 | @data: 71 | @Returns: 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | @list: 80 | @Returns: 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | @list: 89 | @Returns: 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | @list: 98 | @data: 99 | @Returns: 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | @list: 108 | @data: 109 | @Returns: 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | @list: 118 | @Returns: 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | @list: 127 | @equals: 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | @list: 136 | @Returns: 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | @list: 145 | @fn: 146 | @user_data: 147 | 148 | 149 | -------------------------------------------------------------------------------- /docs/tmpl/log.sgml: -------------------------------------------------------------------------------- 1 | 2 | Logging 3 | 4 | 5 | Message and error logging. 6 | 7 | 8 | 9 | Provides structured access to debug, information, warning and error 10 | messages from the libraries. Structured information is most often 11 | used from errors such as parsing where file or URI and line numbers 12 | can be returned via a #raptor_locator object pointer found by 13 | librdf_log_message_locator() on the #librdf_log_message. 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | @user_data: 33 | @message: 34 | @arguments: 35 | @Returns: 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | @user_data: 44 | @message: 45 | @Returns: 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | @LIBRDF_LOG_NONE: 54 | @LIBRDF_LOG_DEBUG: 55 | @LIBRDF_LOG_INFO: 56 | @LIBRDF_LOG_WARN: 57 | @LIBRDF_LOG_ERROR: 58 | @LIBRDF_LOG_FATAL: 59 | @LIBRDF_LOG_LAST: 60 | 61 | 62 | 63 | 64 | 65 | 66 | @LIBRDF_FROM_NONE: 67 | @LIBRDF_FROM_CONCEPTS: 68 | @LIBRDF_FROM_DIGEST: 69 | @LIBRDF_FROM_FILES: 70 | @LIBRDF_FROM_HASH: 71 | @LIBRDF_FROM_INIT: 72 | @LIBRDF_FROM_ITERATOR: 73 | @LIBRDF_FROM_LIST: 74 | @LIBRDF_FROM_MODEL: 75 | @LIBRDF_FROM_NODE: 76 | @LIBRDF_FROM_PARSER: 77 | @LIBRDF_FROM_QUERY: 78 | @LIBRDF_FROM_SERIALIZER: 79 | @LIBRDF_FROM_STATEMENT: 80 | @LIBRDF_FROM_STORAGE: 81 | @LIBRDF_FROM_STREAM: 82 | @LIBRDF_FROM_URI: 83 | @LIBRDF_FROM_UTF8: 84 | @LIBRDF_FROM_MEMORY: 85 | @LIBRDF_FROM_RAPTOR: 86 | @LIBRDF_FROM_LAST: 87 | 88 | 89 | 90 | 91 | 92 | 93 | @message: 94 | @Returns: 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | @message: 103 | @Returns: 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | @message: 112 | @Returns: 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | @message: 121 | @Returns: 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | @message: 130 | @Returns: 131 | 132 | 133 | -------------------------------------------------------------------------------- /docs/tmpl/query.sgml: -------------------------------------------------------------------------------- 1 | 2 | Querying 3 | 4 | 5 | RDF query languages and execution. 6 | 7 | 8 | 9 | Provides classes to create query objects and to execute them over 10 | an RDF graph (#librdf_model) returning a #librdf_query_results 11 | Query result limits and offsets can be set. 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | @world: 43 | @name: 44 | @uri_string: 45 | @factory: 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | @world: 54 | @counter: 55 | @Returns: 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | @world: 64 | @counter: 65 | @name: 66 | @uri_string: 67 | @Returns: 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | @world: 76 | @name: 77 | @uri: 78 | @query_string: 79 | @base_uri: 80 | @Returns: 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | @old_query: 89 | @Returns: 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | @world: 98 | @factory: 99 | @name: 100 | @uri: 101 | @query_string: 102 | @base_uri: 103 | @Returns: 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | @query: 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | @query: 120 | @model: 121 | @Returns: 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | @query: 130 | @Returns: 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | @query: 139 | @limit: 140 | @Returns: 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | @query: 149 | @Returns: 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | @query: 158 | @offset: 159 | @Returns: 160 | 161 | 162 | -------------------------------------------------------------------------------- /docs/tmpl/stream.sgml: -------------------------------------------------------------------------------- 1 | 2 | Stream of triples (#librdf_statement). 3 | 4 | 5 | Sequence of RDF Triples. 6 | 7 | 8 | 9 | Iterate a sequence of RDF triples from some object. 10 | 11 | 12 | 13 | 14 | Provides a way to operate across a sequence of RDF Triples that are 15 | generated one-by-one on demand. The generated triples can be from 16 | some API call in the #librdf_model class, from listing a graph content 17 | as individual triples, from parsing a syntax or returning an RDF graph 18 | result from a query. Streams can be passed into methods for the reverse 19 | operations such as adding to a graph, serializing a graph to a syntax. 20 | Streams pass individual triples (#librdf_statement) between objects 21 | and are usually lazily generated and consumed. 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | @LIBRDF_STREAM_GET_METHOD_GET_OBJECT: 42 | @LIBRDF_STREAM_GET_METHOD_GET_CONTEXT: 43 | 44 | 45 | 46 | 47 | 48 | 49 | @stream: 50 | @map_context: 51 | @item: 52 | @Returns: 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | @map_context: 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | @world: 69 | @context: 70 | @is_end_method: 71 | @next_method: 72 | @get_method: 73 | @finished_method: 74 | @Returns: 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | @iterator: 83 | @statement: 84 | @field: 85 | @Returns: 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | @world: 94 | @Returns: 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | @stream: 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | @stream: 111 | @Returns: 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | @stream: 120 | @Returns: 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | @stream: 129 | @Returns: 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | @stream: 138 | @Returns: 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | @stream: 147 | @Returns: 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | @stream: 156 | @map_function: 157 | @free_context: 158 | @map_context: 159 | @Returns: 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | @stream: 168 | @fh: 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | @stream: 177 | @iostr: 178 | @Returns: 179 | 180 | 181 | -------------------------------------------------------------------------------- /docs/tmpl/unicode.sgml: -------------------------------------------------------------------------------- 1 | 2 | Unicode 3 | 4 | 5 | Unicode utility functions. 6 | 7 | 8 | 9 | Utility functions to convert between UTF-8, full Unicode and Latin-1. 10 | Redland uses UTF-8 for all string formats (except where noted) but 11 | these may need to be converted to other Unicode encodings or downgraded 12 | with loss to Latin-1. 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | @c: 38 | @output: 39 | @length: 40 | @Returns: 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | @output: 49 | @input: 50 | @length: 51 | @Returns: 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | @input: 60 | @length: 61 | @output_length: 62 | @Returns: 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | @input: 71 | @length: 72 | @discard: 73 | @output_length: 74 | @Returns: 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | @input: 83 | @length: 84 | @output_length: 85 | @Returns: 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | @input: 94 | @length: 95 | @output_length: 96 | @Returns: 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | @input: 105 | @length: 106 | @stream: 107 | 108 | 109 | -------------------------------------------------------------------------------- /docs/tmpl/unused.sgml: -------------------------------------------------------------------------------- 1 | 2 | Unused 3 | 4 | 5 | Unused items. 6 | 7 | 8 | 9 | Do not read this, it is not in the document. 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Internal. 26 | 27 | 28 | 29 | 30 | 31 | 32 | Internal. 33 | 34 | 35 | 36 | 37 | 38 | 39 | Internal. You should not be reading this. 40 | 41 | 42 | @string_index: string index 43 | @first_to_check_index: first to check index 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | @name: 52 | @Returns: 53 | 54 | 55 | 56 | 57 | Internal. 58 | 59 | 60 | @LIBRDF_CONCEPT_MS_Alt: offset 61 | @LIBRDF_CONCEPT_MS_Bag: offset 62 | @LIBRDF_CONCEPT_MS_Property: offset 63 | @LIBRDF_CONCEPT_MS_Seq: offset 64 | @LIBRDF_CONCEPT_MS_Statement: offset 65 | @LIBRDF_CONCEPT_MS_object: offset 66 | @LIBRDF_CONCEPT_MS_predicate: offset 67 | @LIBRDF_CONCEPT_MS_subject: offset 68 | @LIBRDF_CONCEPT_MS_type: offset 69 | @LIBRDF_CONCEPT_MS_value: offset 70 | @LIBRDF_CONCEPT_MS_li: offset 71 | @LIBRDF_CONCEPT_MS_RDF: offset 72 | @LIBRDF_CONCEPT_MS_Description: offset 73 | @LIBRDF_CONCEPT_MS_aboutEach: offset 74 | @LIBRDF_CONCEPT_MS_aboutEachPrefix: offset 75 | @LIBRDF_CONCEPT_RS_nodeID: offset 76 | @LIBRDF_CONCEPT_RS_List: offset 77 | @LIBRDF_CONCEPT_RS_first: offset 78 | @LIBRDF_CONCEPT_RS_rest: offset 79 | @LIBRDF_CONCEPT_RS_nil: offset 80 | @LIBRDF_CONCEPT_RS_XMLLiteral: offset 81 | @LIBRDF_CONCEPT_S_Class: offset 82 | @LIBRDF_CONCEPT_S_ConstraintProperty: offset 83 | @LIBRDF_CONCEPT_S_ConstraintResource: offset 84 | @LIBRDF_CONCEPT_S_Container: offset 85 | @LIBRDF_CONCEPT_S_ContainerMembershipProperty: offset 86 | @LIBRDF_CONCEPT_S_Literal: offset 87 | @LIBRDF_CONCEPT_S_Resource: offset 88 | @LIBRDF_CONCEPT_S_comment: offset 89 | @LIBRDF_CONCEPT_S_domain: offset 90 | @LIBRDF_CONCEPT_S_isDefinedBy: offset 91 | @LIBRDF_CONCEPT_S_label: offset 92 | @LIBRDF_CONCEPT_S_range: offset 93 | @LIBRDF_CONCEPT_S_seeAlso: offset 94 | @LIBRDF_CONCEPT_S_subClassOf: offset 95 | @LIBRDF_CONCEPT_S_subPropertyOf: offset 96 | @LIBRDF_CONCEPT_FIRST_S_ID: offset 97 | @LIBRDF_CONCEPT_LAST_S_ID: 98 | @LIBRDF_CONCEPT_RDF11_HTML: 99 | @LIBRDF_CONCEPT_RDF11_langString: 100 | @LIBRDF_CONCEPT_LAST: offset 101 | 102 | 103 | 104 | 105 | 106 | 107 | @world: 108 | @code: 109 | @level: 110 | @facility: 111 | @locator: 112 | @message: 113 | @...: 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | @world: 122 | @code: 123 | @level: 124 | @facility: 125 | @locator: 126 | @message: 127 | 128 | 129 | -------------------------------------------------------------------------------- /docs/tmpl/uri.sgml: -------------------------------------------------------------------------------- 1 | 2 | URI 3 | 4 | 5 | URI class 6 | 7 | 8 | 9 | A class for absolute URIs and relative URI computation utility 10 | functions. Only absolute URIs are provided, with no current access 11 | to internals of URIs such as URI scheme, path, authority. Relative 12 | URIs can be generated against some base or turned to and from local 13 | filenames. 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | @world: 39 | @uri_string: 40 | @Returns: 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | @world: 49 | @uri_string: 50 | @length: 51 | @Returns: 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | @old_uri: 60 | @Returns: 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | @old_uri: 69 | @local_name: 70 | @Returns: 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | @uri: 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | @uri: 87 | @Returns: 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | @uri: 96 | @len_p: 97 | @Returns: 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | @uri: 106 | @fh: 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | @uri: 115 | @Returns: 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | @uri: 124 | @len_p: 125 | @Returns: 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | @first_uri: 134 | @second_uri: 135 | @Returns: 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | @uri: 144 | @Returns: 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | @uri: 153 | @Returns: 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | @uri_string: 162 | @source_uri: 163 | @base_uri: 164 | @Returns: 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | @base_uri: 173 | @uri_string: 174 | @Returns: 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | @world: 183 | @filename: 184 | @Returns: 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | @uri1: 193 | @uri2: 194 | @Returns: 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | @user_data: 203 | @uri: 204 | @Returns: 205 | 206 | 207 | -------------------------------------------------------------------------------- /docs/tmpl/world.sgml: -------------------------------------------------------------------------------- 1 | 2 | World 3 | 4 | 5 | Initialisation and termination of library 6 | 7 | 8 | 9 | The Redland #librdf_world class handles startup and termination of 10 | the library and cleanup of all allocated resources. 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | @void: 36 | @Returns: 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | @world: 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | @world: 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | @world: 61 | @rasqal_world_ptr: 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | @world: 70 | @Returns: 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | @world: 79 | @Returns: 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | @world: 88 | @raptor_world_ptr: 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | @world: 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | @world: 105 | @user_data: 106 | @error_handler: 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | @world: 115 | @user_data: 116 | @warning_handler: 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | @world: 125 | @user_data: 126 | @log_handler: 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | @world: 135 | @name: 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | @user_data: 144 | @raptor_world_ptr: 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | @world: 153 | @user_data: 154 | @handler: 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | @user_data: 163 | @rasqal_world_ptr: 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | @world: 172 | @user_data: 173 | @handler: 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | @world: 196 | @feature: 197 | @Returns: 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | @world: 206 | @feature: 207 | @value: 208 | @Returns: 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | @digest_factory_name: 217 | @not_used2: 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | @void: 226 | 227 | 228 | -------------------------------------------------------------------------------- /docs/version.xml.in: -------------------------------------------------------------------------------- 1 | @VERSION@ 2 | -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | *.lo 2 | *.o 3 | .deps 4 | .libs 5 | TAGS 6 | example? 7 | run* 8 | -------------------------------------------------------------------------------- /examples/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- Mode: Makefile -*- 2 | # 3 | # Makefile.am - example automake file for Redland 4 | # 5 | 6 | EXAMPLES=example1$(EXEEXT) example2$(EXEEXT) example3$(EXEEXT) example4$(EXEEXT) example5$(EXEEXT) example6$(EXEEXT) example7$(EXEEXT) example8$(EXEEXT) 7 | 8 | OTHER_EXAMPLES=redland_dbus rss2ical rss2atom 9 | 10 | EXTRA_PROGRAMS = $(EXAMPLES) $(OTHER_EXAMPLES) 11 | 12 | CLEANFILES=$(TESTS) $(EXAMPLES) $(OTHER_EXAMPLES) test*db 13 | 14 | examples: $(EXAMPLES) 15 | 16 | AM_CPPFLAGS=@CPPFLAGS@ @LIBRDF_CPPFLAGS@ @LIBRDF_INTERNAL_CPPFLAGS@ -I$(top_srcdir)/src @LIBRDF_EXTERNAL_CPPFLAGS@ 17 | LDADD=@LIBRDF_DIRECT_LIBS@ $(top_builddir)/src/librdf.la 18 | AM_LDFLAGS=@LIBRDF_LDFLAGS@ 19 | 20 | example1_SOURCES = example1.c 21 | 22 | example2_SOURCES = example2.c 23 | 24 | example3_SOURCES = example3.c 25 | 26 | example4_SOURCES = example4.c 27 | 28 | example5_SOURCES = example5.c 29 | 30 | example6_SOURCES = example6.c 31 | 32 | example7_SOURCES = example7.c 33 | 34 | example8_SOURCES = example8.c 35 | 36 | rss2ical_SOURCES = rss2ical.c 37 | 38 | rss2atom_SOURCES = rss2atom.c 39 | 40 | redland_dbus_SOURCES = redland_dbus.c 41 | redland_dbus_CFLAGS=`pkg-config --cflags dbus-1 glib-2.0 dbus-glib-1 gthread` 42 | redland_dbus_LDFLAGS=`pkg-config --libs dbus-1 glib-2.0 dbus-glib-1 gthread` 43 | 44 | $(top_builddir)/src/librdf.la: 45 | cd $(top_builddir)/src && $(MAKE) librdf.la 46 | -------------------------------------------------------------------------------- /examples/example3.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * example3.c - Redland example code creating model, statement and storing it in 10 lines 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #include 32 | 33 | /* one prototype needed */ 34 | int main(int argc, char *argv[]); 35 | 36 | 37 | int 38 | main(int argc, char *argv[]) 39 | { 40 | librdf_world* world; 41 | librdf_storage *storage; 42 | librdf_model* model; 43 | librdf_statement* statement; 44 | raptor_world *raptor_world_ptr; 45 | raptor_iostream* iostr; 46 | 47 | world=librdf_new_world(); 48 | librdf_world_open(world); 49 | raptor_world_ptr = librdf_world_get_raptor(world); 50 | 51 | model=librdf_new_model(world, storage=librdf_new_storage(world, "hashes", "test", "hash-type='bdb',dir='.'"), NULL); 52 | 53 | librdf_model_add_statement(model, 54 | statement=librdf_new_statement_from_nodes(world, librdf_new_node_from_uri_string(world, (const unsigned char*)"http://www.dajobe.org/"), 55 | librdf_new_node_from_uri_string(world, (const unsigned char*)"http://purl.org/dc/elements/1.1/creator"), 56 | librdf_new_node_from_literal(world, (const unsigned char*)"Dave Beckett", NULL, 0) 57 | ) 58 | ); 59 | 60 | librdf_free_statement(statement); 61 | 62 | iostr = raptor_new_iostream_to_file_handle(raptor_world_ptr, stdout); 63 | librdf_model_write(model, iostr); 64 | raptor_free_iostream(iostr); 65 | 66 | librdf_free_model(model); 67 | librdf_free_storage(storage); 68 | 69 | librdf_free_world(world); 70 | 71 | #ifdef LIBRDF_MEMORY_DEBUG 72 | librdf_memory_report(stderr); 73 | #endif 74 | 75 | /* keep gcc -Wall happy */ 76 | return(0); 77 | } 78 | -------------------------------------------------------------------------------- /examples/example4.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * example4.c - Redland example code using the serializing 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #include 32 | 33 | /* one prototype needed */ 34 | int main(int argc, char *argv[]); 35 | 36 | 37 | int 38 | main(int argc, char *argv[]) 39 | { 40 | librdf_world* world; 41 | librdf_storage *storage; 42 | librdf_model* model; 43 | librdf_uri* uri, *base_uri; 44 | librdf_parser* parser; 45 | librdf_serializer* serializer; 46 | 47 | world=librdf_new_world(); 48 | librdf_world_open(world); 49 | 50 | model=librdf_new_model(world, storage=librdf_new_storage(world, "hashes", "test", "hash-type='bdb',dir='.'"), NULL); 51 | 52 | parser=librdf_new_parser(world,"rdfxml","application/rdf+xml",NULL); 53 | uri=librdf_new_uri(world, (const unsigned char*)"file:../data/dc.rdf"); 54 | librdf_parser_parse_into_model(parser,uri,uri,model); 55 | librdf_free_uri(uri); 56 | librdf_free_parser(parser); 57 | 58 | serializer=librdf_new_serializer(world, "rdfxml", NULL, NULL); 59 | base_uri=librdf_new_uri(world, (const unsigned char*)"http://exampe.org/base.rdf"); 60 | librdf_serializer_serialize_model_to_file_handle(serializer, stdout, base_uri, model); 61 | librdf_free_serializer(serializer); 62 | librdf_free_uri(base_uri); 63 | 64 | librdf_free_model(model); 65 | librdf_free_storage(storage); 66 | 67 | librdf_free_world(world); 68 | 69 | #ifdef LIBRDF_MEMORY_DEBUG 70 | librdf_memory_report(stderr); 71 | #endif 72 | 73 | /* keep gcc -Wall happy */ 74 | return(0); 75 | } 76 | -------------------------------------------------------------------------------- /examples/example5.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * example5.c - Redland example code using querying 4 | * 5 | * Copyright (C) 2004-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2004-2004, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #include 32 | 33 | /* one prototype needed */ 34 | int main(int argc, char *argv[]); 35 | 36 | 37 | int 38 | main(int argc, char *argv[]) 39 | { 40 | char *program=argv[0]; 41 | librdf_world* world; 42 | librdf_storage *storage; 43 | librdf_model* model; 44 | const char *parser_name; 45 | librdf_parser* parser; 46 | librdf_query* query; 47 | librdf_query_results* results; 48 | librdf_uri *uri; 49 | const unsigned char *query_string=NULL; 50 | raptor_world *raptor_world_ptr; 51 | 52 | world=librdf_new_world(); 53 | librdf_world_open(world); 54 | raptor_world_ptr = librdf_world_get_raptor(world); 55 | 56 | if(argc !=3) { 57 | fprintf(stderr, "USAGE: %s CONTENT-URI QUERY-STRING\n", program); 58 | return 1; 59 | } 60 | 61 | uri=librdf_new_uri(world, (const unsigned char*)argv[1]); 62 | query_string=(const unsigned char*)argv[2]; 63 | 64 | model=librdf_new_model(world, storage=librdf_new_storage(world, "hashes", "test", "new='yes',hash-type='bdb',dir='.'"), NULL); 65 | if(!model || !storage) { 66 | fprintf(stderr, "%s: Failed to make model or storage\n", program); 67 | return 1; 68 | } 69 | 70 | #ifdef RAPTOR_V2_AVAILABLE 71 | parser_name = raptor_world_guess_parser_name(raptor_world_ptr, NULL, NULL, NULL, 0, librdf_uri_as_string(uri)); 72 | #else 73 | parser_name = raptor_guess_parser_name(NULL, NULL, NULL, 0, librdf_uri_as_string(uri)); 74 | #endif 75 | 76 | parser=librdf_new_parser(world, parser_name, NULL, NULL); 77 | librdf_parser_parse_into_model(parser, uri, NULL, model); 78 | librdf_free_parser(parser); 79 | librdf_free_uri(uri); 80 | 81 | query=librdf_new_query(world, "rdql", NULL, query_string, NULL); 82 | 83 | results=librdf_model_query_execute(model, query); 84 | if(!results) { 85 | fprintf(stderr, "%s: Query of model with '%s' failed\n", 86 | program, query_string); 87 | return 1; 88 | } 89 | 90 | while(!librdf_query_results_finished(results)) { 91 | const char **names=NULL; 92 | librdf_node* values[10]; 93 | 94 | if(librdf_query_results_get_bindings(results, &names, values)) 95 | break; 96 | 97 | fputs("result: [", stdout); 98 | if(names) { 99 | int i; 100 | 101 | for(i=0; names[i]; i++) { 102 | fprintf(stdout, "%s=", names[i]); 103 | if(values[i]) { 104 | librdf_node_print(values[i], stdout); 105 | librdf_free_node(values[i]); 106 | } else 107 | fputs("NULL", stdout); 108 | if(names[i+1]) 109 | fputs(", ", stdout); 110 | } 111 | } 112 | fputs("]\n", stdout); 113 | 114 | librdf_query_results_next(results); 115 | } 116 | 117 | fprintf(stdout, "%s: Query returned %d results\n", program, 118 | librdf_query_results_get_count(results)); 119 | 120 | librdf_free_query_results(results); 121 | librdf_free_query(query); 122 | 123 | librdf_free_model(model); 124 | librdf_free_storage(storage); 125 | 126 | librdf_free_world(world); 127 | 128 | #ifdef LIBRDF_MEMORY_DEBUG 129 | librdf_memory_report(stderr); 130 | #endif 131 | 132 | /* keep gcc -Wall happy */ 133 | return(0); 134 | } 135 | -------------------------------------------------------------------------------- /examples/example6.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * example6.c - Redland example code using model methods load and to_string 4 | * 5 | * Copyright (C) 2004-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2004-2004, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #include 33 | 34 | /* one prototype needed */ 35 | int main(int argc, char *argv[]); 36 | 37 | 38 | int 39 | main(int argc, char *argv[]) 40 | { 41 | librdf_world* world; 42 | librdf_storage *storage; 43 | librdf_model* model; 44 | librdf_uri* uri; 45 | unsigned char *string; 46 | 47 | librdf_world_open(world=librdf_new_world()); 48 | 49 | model=librdf_new_model(world, storage=librdf_new_storage(world, "memory", NULL, NULL), NULL); 50 | 51 | uri=librdf_new_uri(world, (const unsigned char*)"http://planetrdf.com/index.rdf"); 52 | librdf_model_load(model, uri, NULL, NULL, NULL); 53 | 54 | string=librdf_model_to_string(model, uri, "ntriples", NULL, NULL); 55 | if(!string) 56 | printf("Failed to serialize model\n"); 57 | else { 58 | printf("Made a %d byte string\n", (int)strlen((char*)string)); 59 | free(string); 60 | } 61 | 62 | librdf_free_uri(uri); 63 | 64 | librdf_free_model(model); 65 | librdf_free_storage(storage); 66 | 67 | librdf_free_world(world); 68 | 69 | #ifdef LIBRDF_MEMORY_DEBUG 70 | librdf_memory_report(stderr); 71 | #endif 72 | 73 | /* keep gcc -Wall happy */ 74 | return(0); 75 | } 76 | -------------------------------------------------------------------------------- /examples/example7.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * example7.c - read from a file 'file.rdf', add a triple, write it again 4 | * 5 | * Compile with: 6 | * gcc -o example7 `redland-config --cflags` example7.c `redland-config --libs` 7 | * 8 | * Copyright (C) 2005-2008, David Beckett http://www.dajobe.org/ 9 | * Copyright (C) 2005-2005, University of Bristol, UK http://www.bristol.ac.uk/ 10 | * 11 | * This package is Free Software and part of Redland http://librdf.org/ 12 | * 13 | * It is licensed under the following three licenses as alternatives: 14 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 15 | * 2. GNU General Public License (GPL) V2 or any newer version 16 | * 3. Apache License, V2.0 or any newer version 17 | * 18 | * You may not use this file except in compliance with at least one of 19 | * the above three licenses. 20 | * 21 | * See LICENSE.html or LICENSE.txt at the top of this package for the 22 | * complete terms and further detail along with the license texts for 23 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 24 | * 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | #include 32 | 33 | int 34 | main(int argc, char *argv[]) 35 | { 36 | librdf_world* world; 37 | librdf_storage* storage; 38 | librdf_model* model; 39 | librdf_statement *statement; 40 | 41 | /* See example1.c for the error checking that should be here */ 42 | world=librdf_new_world(); 43 | librdf_world_open(world); 44 | storage=librdf_new_storage(world, "file", "file.rdf", NULL); 45 | model=librdf_new_model(world, storage, NULL); 46 | statement=librdf_new_statement_from_nodes(world, librdf_new_node_from_uri_string(world, (const unsigned char*)"http://example.org/"), 47 | librdf_new_node_from_uri_string(world, (const unsigned char*)"http://purl.org/dc/elements/1.1/title"), 48 | librdf_new_node_from_literal(world, (const unsigned char*)"Blah", NULL, 0) 49 | ); 50 | librdf_model_add_statement(model, statement); 51 | librdf_free_statement(statement); 52 | librdf_free_model(model); 53 | librdf_free_storage(storage); 54 | librdf_free_world(world); 55 | 56 | return(0); 57 | } 58 | -------------------------------------------------------------------------------- /examples/example8.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * example8.c - Redland example code SPARQL querying and formatting 4 | * 5 | * Copyright (C) 2010, David Beckett http://www.dajobe.org/ 6 | * 7 | * This package is Free Software and part of Redland http://librdf.org/ 8 | * 9 | * It is licensed under the following three licenses as alternatives: 10 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 11 | * 2. GNU General Public License (GPL) V2 or any newer version 12 | * 3. Apache License, V2.0 or any newer version 13 | * 14 | * You may not use this file except in compliance with at least one of 15 | * the above three licenses. 16 | * 17 | * See LICENSE.html or LICENSE.txt at the top of this package for the 18 | * complete terms and further detail along with the license texts for 19 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 20 | * 21 | * USAGE: 22 | * To get json variable bindings 23 | * ./example8 http://librdf.org/redland.rdf json 'select * where { ?s ?p ?o}' 24 | * To get json triples (graph formatted): 25 | * ./example8 http://librdf.org/redland.rdf json 'construct {?s ?p ?o} where { ?s ?p ?o}' 26 | * 27 | */ 28 | 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #include 37 | 38 | /* one prototype needed */ 39 | int main(int argc, char *argv[]); 40 | 41 | 42 | int 43 | main(int argc, char *argv[]) 44 | { 45 | char *program = argv[0]; 46 | librdf_world* world; 47 | librdf_storage *storage; 48 | librdf_model* model = NULL; 49 | const char *parser_name; 50 | librdf_parser* parser; 51 | librdf_query* query; 52 | librdf_query_results* results; 53 | librdf_uri *uri; 54 | const unsigned char *query_string = NULL; 55 | const char *format; 56 | unsigned char* string = NULL; 57 | size_t length; 58 | 59 | world = librdf_new_world(); 60 | librdf_world_open(world); 61 | 62 | if(argc != 4) { 63 | fprintf(stderr, "USAGE: %s DATA-URI FORMAT|- QUERY-STRING\n", program); 64 | return 1; 65 | } 66 | 67 | uri = librdf_new_uri(world, (const unsigned char*)argv[1]); 68 | format = argv[2]; 69 | if(!strcmp(format, "-")) 70 | format = NULL; 71 | query_string = (const unsigned char*)argv[3]; 72 | 73 | storage = librdf_new_storage(world, "memory", "test", NULL); 74 | if(storage) 75 | model = librdf_new_model(world, storage, NULL); 76 | 77 | if(!model || !storage) { 78 | fprintf(stderr, "%s: Failed to make model or storage\n", program); 79 | return 1; 80 | } 81 | 82 | parser_name = librdf_parser_guess_name2(world, NULL, NULL, librdf_uri_as_string(uri)); 83 | parser = librdf_new_parser(world, parser_name, NULL, NULL); 84 | librdf_parser_parse_into_model(parser, uri, NULL, model); 85 | librdf_free_parser(parser); 86 | librdf_free_uri(uri); 87 | 88 | query = librdf_new_query(world, "sparql", NULL, query_string, NULL); 89 | 90 | results = librdf_model_query_execute(model, query); 91 | if(!results) { 92 | fprintf(stderr, "%s: Query of model with '%s' failed\n", 93 | program, query_string); 94 | return 1; 95 | } 96 | 97 | if(librdf_query_results_is_bindings(results) || 98 | librdf_query_results_is_boolean(results)) { 99 | string = librdf_query_results_to_counted_string2(results, format, 100 | NULL, NULL, NULL, &length); 101 | if(!string) { 102 | fprintf(stderr, "%s: Failed to turn query results to format '%s'\n", 103 | program, format); 104 | return 1; 105 | } 106 | 107 | } else { 108 | /* triples */ 109 | librdf_serializer* serializer; 110 | librdf_stream* stream; 111 | 112 | serializer = librdf_new_serializer(world, format, NULL, NULL); 113 | if(!serializer) { 114 | fprintf(stderr, 115 | "%s: Failed to create triples serializer for format '%s'\n", 116 | program, format); 117 | return 1; 118 | } 119 | 120 | stream = librdf_query_results_as_stream(results); 121 | string = librdf_serializer_serialize_stream_to_counted_string(serializer, 122 | NULL, stream, &length); 123 | librdf_free_stream(stream); 124 | 125 | if(!string) { 126 | fprintf(stderr, "%s: Failed to turn query results to format '%s'\n", 127 | program, format); 128 | return 1; 129 | } 130 | } 131 | 132 | fprintf(stderr, "%s: query returned %ld bytes string\n", program, length); 133 | fwrite(string, sizeof(char), length, stdout); 134 | 135 | free(string); 136 | 137 | librdf_free_query_results(results); 138 | librdf_free_query(query); 139 | 140 | librdf_free_model(model); 141 | librdf_free_storage(storage); 142 | 143 | librdf_free_world(world); 144 | 145 | /* keep gcc -Wall happy */ 146 | return(0); 147 | } 148 | -------------------------------------------------------------------------------- /redland-config.1: -------------------------------------------------------------------------------- 1 | .\" Hey, EMACS: -*- nroff -*- 2 | .\" 3 | .\" redland-config.1 - Redland compiling utility manual page 4 | .\" 5 | .\" Copyright (C) 2003-2008 David Beckett - http://www.dajobe.org/ 6 | .\" Copyright (C) 2003-2004 University of Bristol - http://www.bristol.ac.uk/ 7 | .\" 8 | .TH redland-config 1 "2008-09-07" 9 | .\" Please adjust this date whenever revising the manpage. 10 | .SH NAME 11 | redland-config \- script to get information about the installed version of Redland 12 | .SH SYNOPSIS 13 | .B redland-config 14 | [\-\-cflags] 15 | [\-\-help] 16 | [\-\-libs] 17 | [\-\-libtool\-libs] 18 | [\-\-prefix\fI[=DIR]\fP] 19 | [\-\-private\-libs] 20 | [\-\-version\-decimal] 21 | [\-\-version] 22 | .SH DESCRIPTION 23 | \fIredland-config\fP is a tool that is used to determine the compile and 24 | linker flags that should be used to compile and link programs that use 25 | the Redland RDF library. 26 | .SH OPTIONS 27 | \fIredland-config\fP accepts the following options: 28 | .TP 8 29 | .B \-\-version 30 | Print the currently installed version of redland on the standard output. 31 | .TP 8 32 | .B \-\-version\-decimal 33 | Print the currently installed version of redland as a decimal integer. 34 | .TP 8 35 | .B \-\-libs 36 | Print the linker flags that are necessary to link a redland program. 37 | This excludes linker arguments used to build the librdf shared library. 38 | .TP 8 39 | .B \-\-libtool\-libs 40 | Print the flags that are necessary to link a redland program with libtool. 41 | .TP 8 42 | .B \-\-private\-libs 43 | Print the linker flags that are necessary to build the librdf shared 44 | library. This option is not usually needed because the librdf 45 | shared library has already been dynamically linked against these libs. 46 | .TP 8 47 | .B \-\-cflags 48 | Print the compiler flags that are necessary to compile a redland program. 49 | .TP 8 50 | .B \-\-prefix=PREFIX 51 | If specified, use PREFIX instead of the installation prefix that 52 | redland was built with when computing the output for the 53 | \-\-cflags and \-\-libs options. This option must be specified before 54 | any \-\-libs or \-\-cflags options. 55 | .SH SEE ALSO 56 | .BR redland (3), 57 | .SH AUTHOR 58 | Dave Beckett - 59 | .UR http://www.dajobe.org/ 60 | http://www.dajobe.org/ 61 | .UE 62 | -------------------------------------------------------------------------------- /redland-config.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2000-2009 David Beckett http://www.dajobe.org/ 4 | # Copyright (C) 2000-2004 University of Bristol, UK http://www.bristol.ac.uk/ 5 | # 6 | # This package is Free Software and part of Redland http://librdf.org/ 7 | # 8 | # It is licensed under the following three licenses as alternatives: 9 | # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 10 | # 2. GNU General Public License (GPL) V2 or any newer version 11 | # 3. Apache License, V2.0 or any newer version 12 | # 13 | # You may not use this file except in compliance with at least one of 14 | # the above three licenses. 15 | # 16 | # See LICENSE.html or LICENSE.txt at the top of this package for the 17 | # complete terms and further detail along with the license texts for 18 | # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 19 | # 20 | # 21 | # 22 | 23 | PACKAGE=@PACKAGE@ 24 | PKGCONFIG=pkg-config 25 | 26 | usage() 27 | { 28 | cat<&2 50 | fi 51 | 52 | 53 | args="" 54 | while test $# -gt 0; do 55 | case "$1" in 56 | -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; 57 | *) optarg= ;; 58 | esac 59 | 60 | case $1 in 61 | # GNU standards require this 62 | --help|--usage) 63 | usage 0 64 | ;; 65 | # Ignored options 66 | --libtool-libs|--prefix=*) 67 | echo "$0: $1 option ignored" 1>&2 68 | ;; 69 | # Altered options 70 | --prefix) 71 | args="$args --variable=prefix"; 72 | ;; 73 | --swig) 74 | args="$args --variable=swig"; 75 | ;; 76 | --version) 77 | echo @VERSION@ 78 | exit 0 79 | ;; 80 | --private-libs) 81 | args="$args --static --libs"; 82 | ;; 83 | --version-decimal) 84 | echo @LIBRDF_VERSION_DECIMAL@ 85 | exit 0 86 | ;; 87 | # Other options are passed through 88 | *) 89 | args="$args $1" 90 | ;; 91 | esac 92 | 93 | shift 94 | done 95 | 96 | if $PKGCONFIG $PACKAGE --exists; then 97 | : # exists 98 | else 99 | echo "$0: $PKGCONFIG does not know about package $PACKAGE" 100 | exit 1 101 | fi 102 | 103 | $PKGCONFIG $PACKAGE $args 104 | -------------------------------------------------------------------------------- /redland-src-config.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (C) 2002-2008 David Beckett http://www.dajobe.org/ 4 | # Copyright (C) 2002-2004 University of Bristol, UK http://www.bristol.ac.uk/ 5 | # 6 | # This package is Free Software and part of Redland http://librdf.org/ 7 | # 8 | # It is licensed under the following three licenses as alternatives: 9 | # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 10 | # 2. GNU General Public License (GPL) V2 or any newer version 11 | # 3. Apache License, V2.0 or any newer version 12 | # 13 | # You may not use this file except in compliance with at least one of 14 | # the above three licenses. 15 | # 16 | # See LICENSE.html or LICENSE.txt at the top of this package for the 17 | # complete terms and further detail along with the license texts for 18 | # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 19 | # 20 | # 21 | # 22 | 23 | usage() 24 | { 25 | cat<&2 47 | fi 48 | 49 | 50 | while test $# -gt 0; do 51 | case "$1" in 52 | -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; 53 | *) optarg= ;; 54 | esac 55 | 56 | case $1 in 57 | --version) 58 | echo @VERSION@ 59 | exit 0 60 | ;; 61 | --cflags) 62 | echo_cflags=yes 63 | ;; 64 | --libs) 65 | echo_libs=yes 66 | ;; 67 | --libtool-libs) 68 | echo_libtool_libs=yes 69 | ;; 70 | --help|--usage) 71 | usage 0 72 | ;; 73 | --run) 74 | lpath=@abs_top_builddir@/src/.libs 75 | if test -d .libs; then 76 | lpath=".libs:$lpath" 77 | fi 78 | 79 | ldir=`pkg-config raptor --variable=libdir` 80 | lpath="$lpath:$ldir" 81 | 82 | ldir=`pkg-config rasqal --variable=libdir` 83 | lpath="$lpath:$ldir" 84 | 85 | if test `uname` = Darwin; then 86 | DYLD_LIBRARY_PATH=$lpath:$DYLD_LIBRARY_PATH 87 | export DYLD_LIBRARY_PATH 88 | else 89 | LD_LIBRARY_PATH=$lpath:$LD_LIBRARY_PATH 90 | export LD_LIBRARY_PATH 91 | fi 92 | shift 93 | exec ${1+"$@"} 94 | ;; 95 | 96 | --swig) 97 | echo_swig=yes 98 | ;; 99 | 100 | --version) 101 | echo @VERSION@ 102 | exit 0 103 | ;; 104 | 105 | --version-decimal) 106 | echo @LIBRDF_VERSION_DECIMAL@ 107 | exit 0 108 | ;; 109 | 110 | *) 111 | usage 1 1>&2 112 | ;; 113 | esac 114 | 115 | shift 116 | done 117 | 118 | raptor_config="pkg-config raptor2" 119 | 120 | rasqal_config="pkg-config rasqal" 121 | 122 | if test "$echo_cflags" = "yes"; then 123 | echo -I@abs_top_srcdir@/src `$rasqal_config --cflags` `$raptor_config --cflags` 124 | fi 125 | if test "$echo_libtool_libs" = "yes"; then 126 | echo @abs_top_builddir@/src/librdf.la 127 | fi 128 | 129 | if test "$echo_libs" = "yes"; then 130 | echo -L@abs_top_builddir@/src/.libs -lrdf @LIBRDF_LDFLAGS@ @LIBRDF_EXTERNAL_LIBS@ `$rasqal_config --libs` `$raptor_config --libs` 131 | fi 132 | 133 | if test "$echo_swig" = "yes"; then 134 | echo @abs_top_builddir@/Redland.i 135 | fi 136 | -------------------------------------------------------------------------------- /redland.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | plugindir=${libdir}/redland 7 | 8 | swig=${prefix}/share/redland/Redland.i 9 | 10 | have_raptor2_api=@HAVE_RAPTOR2_API@ 11 | 12 | Name: Redland RDF API Library 13 | Description: Redland RDF API and triple store library 14 | Requires.private: raptor2 >= @RAPTOR_MIN_VERSION@, rasqal >= @RASQAL_MIN_VERSION@, rasqal <= @RASQAL_MAX_VERSION@ 15 | Version: @VERSION@ 16 | Libs: -L${libdir} -lrdf 17 | Libs.private: @LIBRDF_LDFLAGS@ @LIBRDF_PKGCONFIG_PRIVATE_LIBS@ 18 | Cflags: -I${includedir} 19 | -------------------------------------------------------------------------------- /redland.rdf.in: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | Redland librdf RDF API Library 9 | 10 | 2000-06-21 11 | 12 | 13 | A library for the Resource Description Framework (RDF) allowing 14 | it to be parsed from XML, stored, queried and manipulated. 15 | 16 | 17 | 18 | Redland librdf is a library that provides a high-level 19 | interface for the Resource Description Framework (RDF) allowing 20 | the RDF graph to be parsed from XML, stored, queried and 21 | manipulated. Redland librdf implements each of the RDF 22 | concepts in its own class via an object based API, reflected 23 | into the language APIs, currently C#, Java, Perl, PHP, Python, 24 | Ruby and Tcl. Several classes providing functionality such as 25 | for parsers, storage are built as modules that can be loaded at 26 | compile or run-time as required. 27 | 28 | 29 | 30 | 31 | Dave Beckett 32 | 33 | 970987f991961f2553a1bf2574166fa29befbccb 34 | 35 | 36 | 37 | 38 | 39 | stable 40 | 2011-01-22 41 | @VERSION@ 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | git://github.com/dajobe/librdf.git 75 | librdf 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 87 | 88 | 89 | 90 | Dave Beckett 91 | 92 | 970987f991961f2553a1bf2574166fa29befbccb 93 | 94 | 95 | 96 | 97 | 98 | 103 | -------------------------------------------------------------------------------- /redland.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rasqal", "rasqal\win32\rasqal.vcproj", "{B72BB9A4-C889-4242-8188-34133944DC65}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | {D24FB457-A295-4237-8D5E-92ACBBA10139} = {D24FB457-A295-4237-8D5E-92ACBBA10139} 5 | {F48C108E-B937-4D8C-A308-9C257C5D0D3D} = {F48C108E-B937-4D8C-A308-9C257C5D0D3D} 6 | EndProjectSection 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "librdf", "librdf\win32\librdf.vcproj", "{2EF6F83E-DACB-4958-B0C0-A9F34476127A}" 9 | ProjectSection(ProjectDependencies) = postProject 10 | {B72BB9A4-C889-4242-8188-34133944DC65} = {B72BB9A4-C889-4242-8188-34133944DC65} 11 | EndProjectSection 12 | EndProject 13 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rapper", "raptor\win32\rapper.vcproj", "{1FFF7A31-D1A9-4516-AB07-4D415ABAB733}" 14 | ProjectSection(ProjectDependencies) = postProject 15 | {F48C108E-B937-4D8C-A308-9C257C5D0D3D} = {F48C108E-B937-4D8C-A308-9C257C5D0D3D} 16 | EndProjectSection 17 | EndProject 18 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raptor", "raptor\win32\raptor.vcproj", "{F48C108E-B937-4D8C-A308-9C257C5D0D3D}" 19 | ProjectSection(ProjectDependencies) = postProject 20 | EndProjectSection 21 | EndProject 22 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curllib", "..\curl-7.13.2\lib\curllib.vcproj", "{59ED01CF-49C8-42C5-846F-AAF0A5F3B437}" 23 | ProjectSection(ProjectDependencies) = postProject 24 | EndProjectSection 25 | EndProject 26 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "roqet", "rasqal\win32\roqet.vcproj", "{143A879E-BD81-4EF4-88EE-851D978304FE}" 27 | ProjectSection(ProjectDependencies) = postProject 28 | {B72BB9A4-C889-4242-8188-34133944DC65} = {B72BB9A4-C889-4242-8188-34133944DC65} 29 | EndProjectSection 30 | EndProject 31 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pcre", "..\pcre\6.4\pcre-6.4-src\pcre\pcre.vcproj", "{D24FB457-A295-4237-8D5E-92ACBBA10139}" 32 | ProjectSection(ProjectDependencies) = postProject 33 | EndProjectSection 34 | EndProject 35 | Global 36 | GlobalSection(SolutionConfiguration) = preSolution 37 | Debug = Debug 38 | Release = Release 39 | EndGlobalSection 40 | GlobalSection(ProjectConfiguration) = postSolution 41 | {B72BB9A4-C889-4242-8188-34133944DC65}.Debug.ActiveCfg = Debug|Win32 42 | {B72BB9A4-C889-4242-8188-34133944DC65}.Debug.Build.0 = Debug|Win32 43 | {B72BB9A4-C889-4242-8188-34133944DC65}.Release.ActiveCfg = Release|Win32 44 | {B72BB9A4-C889-4242-8188-34133944DC65}.Release.Build.0 = Release|Win32 45 | {2EF6F83E-DACB-4958-B0C0-A9F34476127A}.Debug.ActiveCfg = Debug|Win32 46 | {2EF6F83E-DACB-4958-B0C0-A9F34476127A}.Debug.Build.0 = Debug|Win32 47 | {2EF6F83E-DACB-4958-B0C0-A9F34476127A}.Release.ActiveCfg = Release|Win32 48 | {2EF6F83E-DACB-4958-B0C0-A9F34476127A}.Release.Build.0 = Release|Win32 49 | {1FFF7A31-D1A9-4516-AB07-4D415ABAB733}.Debug.ActiveCfg = Debug|Win32 50 | {1FFF7A31-D1A9-4516-AB07-4D415ABAB733}.Debug.Build.0 = Debug|Win32 51 | {1FFF7A31-D1A9-4516-AB07-4D415ABAB733}.Release.ActiveCfg = Release|Win32 52 | {1FFF7A31-D1A9-4516-AB07-4D415ABAB733}.Release.Build.0 = Release|Win32 53 | {F48C108E-B937-4D8C-A308-9C257C5D0D3D}.Debug.ActiveCfg = Debug|Win32 54 | {F48C108E-B937-4D8C-A308-9C257C5D0D3D}.Debug.Build.0 = Debug|Win32 55 | {F48C108E-B937-4D8C-A308-9C257C5D0D3D}.Release.ActiveCfg = Release|Win32 56 | {F48C108E-B937-4D8C-A308-9C257C5D0D3D}.Release.Build.0 = Release|Win32 57 | {59ED01CF-49C8-42C5-846F-AAF0A5F3B437}.Debug.ActiveCfg = Debug|Win32 58 | {59ED01CF-49C8-42C5-846F-AAF0A5F3B437}.Debug.Build.0 = Debug|Win32 59 | {59ED01CF-49C8-42C5-846F-AAF0A5F3B437}.Release.ActiveCfg = Release|Win32 60 | {59ED01CF-49C8-42C5-846F-AAF0A5F3B437}.Release.Build.0 = Release|Win32 61 | {143A879E-BD81-4EF4-88EE-851D978304FE}.Debug.ActiveCfg = Debug|Win32 62 | {143A879E-BD81-4EF4-88EE-851D978304FE}.Debug.Build.0 = Debug|Win32 63 | {143A879E-BD81-4EF4-88EE-851D978304FE}.Release.ActiveCfg = Release|Win32 64 | {143A879E-BD81-4EF4-88EE-851D978304FE}.Release.Build.0 = Release|Win32 65 | {D24FB457-A295-4237-8D5E-92ACBBA10139}.Debug.ActiveCfg = Debug|Win32 66 | {D24FB457-A295-4237-8D5E-92ACBBA10139}.Debug.Build.0 = Debug|Win32 67 | {D24FB457-A295-4237-8D5E-92ACBBA10139}.Release.ActiveCfg = Release|Win32 68 | {D24FB457-A295-4237-8D5E-92ACBBA10139}.Release.Build.0 = Release|Win32 69 | EndGlobalSection 70 | GlobalSection(ExtensibilityGlobals) = postSolution 71 | EndGlobalSection 72 | GlobalSection(ExtensibilityAddIns) = postSolution 73 | EndGlobalSection 74 | EndGlobal 75 | -------------------------------------------------------------------------------- /scripts/Makefile.am: -------------------------------------------------------------------------------- 1 | # -*- Mode: Makefile -*- 2 | # 3 | # Makefile.am - automake file for Redland librdf scripts 4 | # 5 | # Copyright (C) 2011, David Beckett http://www.dajobe.org/ 6 | # 7 | # This package is Free Software and part of Redland http://librdf.org/ 8 | # 9 | # It is licensed under the following three licenses as alternatives: 10 | # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 11 | # 2. GNU General Public License (GPL) V2 or any newer version 12 | # 3. Apache License, V2.0 or any newer version 13 | # 14 | # You may not use this file except in compliance with at least one of 15 | # the above three licenses. 16 | # 17 | # See LICENSE.html or LICENSE.txt at the top of this package for the 18 | # complete terms and further detail along with the license texts for 19 | # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 20 | # 21 | 22 | EXTRA_DIST= \ 23 | markdown-to-html.pl \ 24 | process-changes.pl \ 25 | touch-mtime.pl \ 26 | fix-gtkdoc-header.pl 27 | -------------------------------------------------------------------------------- /scripts/fix-gtkdoc-header.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # 3 | # Edit rdf_log.h so that gtk-doc is happy about it 4 | # 5 | # USAGE: 6 | # perl fix-gtkdoc-header.pl < rdf_log.h > filtered_rdf_log.h 7 | # 8 | # Copyright (C) 2011, David Beckett http://www.dajobe.org/ 9 | # 10 | # This package is Free Software and part of Redland http://librdf.org/ 11 | # 12 | # It is licensed under the following three licenses as alternatives: 13 | # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 14 | # 2. GNU General Public License (GPL) V2 or any newer version 15 | # 3. Apache License, V2.0 or any newer version 16 | # 17 | # You may not use this file except in compliance with at least one of 18 | # the above three licenses. 19 | # 20 | # See LICENSE.html or LICENSE.txt at the top of this package for the 21 | # complete terms and further detail along with the license texts for 22 | # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 23 | 24 | while(<>) { 25 | # Remove calling convention macro 26 | s/REDLAND_CALLBACK_STDCALL *//; 27 | 28 | # Remove trailing macros 29 | s{REDLAND_PRINTF_FORMAT\(\d+, \d+\);}{;}; 30 | 31 | # gtk-doc hates const in some places 32 | s/const char\* const\* (\w+)/const char\* $1/; 33 | 34 | # and unsigned char 35 | s/const unsigned char \*(\w+)/const char \* $1/; 36 | 37 | # and unsigned char in a handler typedef 38 | s/typedef unsigned char\s*\*/typedef char \*/; 39 | 40 | print; 41 | } 42 | -------------------------------------------------------------------------------- /scripts/install-raptor.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Helper script to install a particular raptor version 3 | # 4 | # Intended for use with travis CI; see .travis.yml at the root 5 | 6 | set -x 7 | 8 | PACKAGE=raptor2 9 | MIN_VERSION=$1 10 | INSTALL_VERSION=$2 11 | 12 | FILE="$PACKAGE-$INSTALL_VERSION.tar.gz" 13 | URL="http://download.librdf.org/source/$FILE" 14 | 15 | ROOT_DIR=${TMPDIR:-/tmp} 16 | BUILD_DIR="$ROOT_DIR/build-$PACKAGE" 17 | 18 | raptor_version=`pkg-config --modversion $PACKAGE` 19 | if pkg-config --atleast-version $MIN_VERSION $PACKAGE; then 20 | echo "Raptor2 $raptor_version is new enough" 21 | else 22 | mkdir $BUILD_DIR && cd $BUILD_DIR 23 | wget -O $FILE $URL || curl -o $FILE $URL 24 | tar -x -z -f $FILE && rm $FILE 25 | cd $PACKAGE-$INSTALL_VERSION 26 | set -e 27 | ./configure --prefix=/usr 28 | make 29 | sudo make install 30 | cd / && rm -rf $BUILD_DIR 31 | fi 32 | -------------------------------------------------------------------------------- /scripts/install-rasqal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Helper script to install a particular rasqal version 3 | # 4 | # Intended for use with travis CI; see .travis.yml at the root 5 | 6 | set -x 7 | 8 | PACKAGE=rasqal 9 | MIN_VERSION=$1 10 | INSTALL_VERSION=$2 11 | 12 | FILE="$PACKAGE-$INSTALL_VERSION.tar.gz" 13 | URL="http://download.librdf.org/source/$FILE" 14 | 15 | ROOT_DIR=${TMPDIR:-/tmp} 16 | BUILD_DIR="$ROOT_DIR/build-$PACKAGE" 17 | 18 | rasqal_version=`pkg-config --modversion $PACKAGE` 19 | if pkg-config --atleast-version $MIN_VERSION $PACKAGE; then 20 | echo "Rasqal $rasqal_version is new enough" 21 | else 22 | mkdir $BUILD_DIR && cd $BUILD_DIR 23 | wget -O $FILE $URL || curl -o $FILE $URL 24 | tar -x -z -f $FILE && rm $FILE 25 | cd $PACKAGE-$INSTALL_VERSION 26 | set -e 27 | ./configure --prefix=/usr 28 | make 29 | sudo make install 30 | cd / && rm -rf $BUILD_DIR 31 | fi 32 | -------------------------------------------------------------------------------- /scripts/markdown-to-html.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # 3 | # Convert 'markdown' program output to legal XHTML that redland 4 | # website building scripts can deal with 5 | # 6 | # 7 | 8 | use strict; 9 | use File::Basename; 10 | 11 | our $program = basename $0; 12 | 13 | our $MARKDOWN=$ENV{'MARKDOWN'} || 'markdown'; 14 | 15 | die "USAGE: $program: INPUT-MD OUTPUT-HTML\n" 16 | unless @ARGV == 2; 17 | 18 | my($input,$output)=@ARGV; 19 | 20 | die "$program: $input not found - $!\n" unless -r $input; 21 | 22 | open(IN, "$MARKDOWN $input |") or die "$program: pipe from $MARKDOWN $input failed - $\n"; 23 | open(OUT, ">$output") or die "$program: Cannot create $output - $\n"; 24 | my $title; 25 | while() { 26 | # Use first H1 to trigger head and title 27 | if(!defined $title && m%

([^<]+) 32 | 33 | 34 | 35 | Redland RDF Application Framework - $title 36 | 49 | 50 | 51 | HEADER 52 | } 53 | 54 | # Fix markdown's removal of whitespace before first code line 55 | # Assumes all code indents with 2 initial spaces 56 | s%
(.*)$%
\n  $1%;
57 | 
58 |   print OUT "  $_";
59 | }
60 | close(IN);
61 | 
62 | print OUT <<"FOOTER";
63 | 
64 | 65 |

Copyright (C) 2010 Dave Beckett

66 | 67 | 68 | 69 | FOOTER 70 | 71 | close(OUT); 72 | 73 | exit 0; 74 | -------------------------------------------------------------------------------- /scripts/touch-mtime.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | #* touch-mtime.pl - Copy file modification times 4 | # 5 | # Copyright (C) 2007, David Beckett http://purl.org/net/dajobe/ 6 | # 7 | # This package is Free Software and part of Redland http://librdf.org/ 8 | # 9 | # It is licensed under the following three licenses as alternatives: 10 | # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 11 | # 2. GNU General Public License (GPL) V2 or any newer version 12 | # 3. Apache License, V2.0 or any newer version 13 | # 14 | # You may not use this file except in compliance with at least one of 15 | # the above three licenses. 16 | # 17 | # See LICENSE.html or LICENSE.txt at the top of this package for the 18 | # complete terms and further detail along with the license texts for 19 | # the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 20 | # 21 | 22 | use File::Basename; 23 | use File::stat; 24 | 25 | my $usage="REFERENCE-FILE FILE\n"; 26 | 27 | 28 | my $program=basename $0; 29 | 30 | die "USAGE: $usage" if @ARGV != 2; 31 | 32 | 33 | my($ref,$file)=@ARGV; 34 | 35 | my $st; 36 | 37 | $st=stat($ref) or die "$program: No such reference file $ref - $!\n"; 38 | 39 | my $mtime=$st->mtime; 40 | 41 | $st=stat($file) or die "$program: No such file $file - $!\n"; 42 | 43 | utime $mtime, $mtime, $file; 44 | -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | *.db 2 | *.la 3 | *.lo 4 | *.o 5 | *.plist 6 | .deps 7 | .libs 8 | TAGS 9 | dmalloc* 10 | filtered_rdf_log.h 11 | librdf.h 12 | rdf_*_test 13 | rdf_*_test.exe 14 | rdf_config.h* 15 | redland.spec 16 | run* 17 | stamp-h* 18 | test 19 | win32_rdf_config.h 20 | -------------------------------------------------------------------------------- /src/memcmp.c: -------------------------------------------------------------------------------- 1 | /* from public domain code in libiberty (GNU binutils) - ANSIfied */ 2 | 3 | #include 4 | 5 | int 6 | memcmp(const void* str1, const void* str2, size_t count) 7 | { 8 | register unsigned char *s1 = (unsigned char*)str1; 9 | register unsigned char *s2 = (unsigned char*)str2; 10 | 11 | while (count-- > 0) { 12 | if (*s1++ != *s2++) 13 | return s1[-1] < s2[-1] ? -1 : 1; 14 | } 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /src/mysql-v1.ttl: -------------------------------------------------------------------------------- 1 | # 2 | # Redland MySQL storage schema - MyISAM 3 | # 4 | # Turtle with variable substitution 5 | # 6 | 7 | @prefix mysql: . 8 | @prefix dbconfig: . 9 | @prefix rdfs: . 10 | 11 | mysql: 12 | rdfs:label "Redland MySQL Schema V1 MyISAM"; 13 | 14 | dbconfig:createTableStatements """ 15 | CREATE TABLE IF NOT EXISTS $(STATEMENTS_NAME) ( 16 | Subject bigint unsigned NOT NULL, 17 | Predicate bigint unsigned NOT NULL, 18 | Object bigint unsigned NOT NULL, 19 | Context bigint unsigned NOT NULL, 20 | KEY Context (Context), 21 | KEY SubjectPredicate (Subject,Predicate), 22 | KEY PredicateObject (Predicate,Object), 23 | KEY ObjectSubject (Object,Subject) 24 | ) ENGINE=MyISAM DELAY_KEY_WRITE=1 MAX_ROWS=100000000 AVG_ROW_LENGTH=33 25 | """; 26 | 27 | dbconfig:createTableLiterals """ 28 | CREATE TABLE IF NOT EXISTS Literals ( 29 | ID bigint unsigned NOT NULL, 30 | Value longtext NOT NULL, 31 | Language text NOT NULL, 32 | Datatype text NOT NULL, 33 | PRIMARY KEY ID (ID), 34 | FULLTEXT KEY Value (Value) 35 | ) ENGINE=MyISAM DELAY_KEY_WRITE=1 MAX_ROWS=100000000 AVG_ROW_LENGTH=44 36 | """; 37 | 38 | dbconfig:createTableResources """ 39 | CREATE TABLE IF NOT EXISTS Resources ( 40 | ID bigint unsigned NOT NULL, 41 | URI text NOT NULL, 42 | PRIMARY KEY ID (ID) 43 | ) ENGINE=MyISAM DELAY_KEY_WRITE=1 MAX_ROWS=100000000 AVG_ROW_LENGTH=63 44 | """; 45 | 46 | dbconfig:createTableBnodes """ 47 | CREATE TABLE IF NOT EXISTS Bnodes ( 48 | ID bigint unsigned NOT NULL, 49 | Name text NOT NULL, 50 | PRIMARY KEY ID (ID) 51 | ) ENGINE=MyISAM DELAY_KEY_WRITE=1 MAX_ROWS=100000000 AVG_ROW_LENGTH=33 52 | """; 53 | 54 | dbconfig:createTableModels """ 55 | CREATE TABLE IF NOT EXISTS Models ( 56 | ID bigint unsigned NOT NULL, 57 | Name text NOT NULL, 58 | PRIMARY KEY ID (ID) 59 | ) ENGINE=MyISAM DELAY_KEY_WRITE=1 60 | """; 61 | 62 | . 63 | -------------------------------------------------------------------------------- /src/mysql-v2.ttl: -------------------------------------------------------------------------------- 1 | # 2 | # Redland MySQL storage schema - InnoDB 3 | # 4 | # Turtle with variable substitution 5 | # 6 | 7 | @prefix mysql: . 8 | @prefix dbconfig: . 9 | @prefix rdfs: . 10 | 11 | mysql: 12 | rdfs:label "Redland MySQL Schema V2 InnoDB"; 13 | 14 | dbconfig:createTableStatements """ 15 | CREATE TABLE IF NOT EXISTS $(STATEMENTS_NAME) ( 16 | Subject bigint unsigned NOT NULL, 17 | Predicate bigint unsigned NOT NULL, 18 | Object bigint unsigned NOT NULL, 19 | Context bigint unsigned NOT NULL, 20 | KEY Context (Context), 21 | KEY SubjectPredicate (Subject,Predicate), 22 | KEY PredicateObject (Predicate,Object), 23 | KEY ObjectSubject (Object,Subject) 24 | ) ENGINE=InnoDB DELAY_KEY_WRITE=1 MAX_ROWS=100000000 AVG_ROW_LENGTH=33 25 | """; 26 | 27 | dbconfig:createTableLiterals """ 28 | CREATE TABLE IF NOT EXISTS Literals ( 29 | ID bigint unsigned NOT NULL, 30 | Value longtext NOT NULL, 31 | Language text NOT NULL, 32 | Datatype text NOT NULL, 33 | PRIMARY KEY ID (ID) 34 | ) ENGINE=InnoDB DELAY_KEY_WRITE=1 MAX_ROWS=100000000 AVG_ROW_LENGTH=44 35 | """; 36 | 37 | dbconfig:createTableResources """ 38 | CREATE TABLE IF NOT EXISTS Resources ( 39 | ID bigint unsigned NOT NULL, 40 | URI text NOT NULL, 41 | PRIMARY KEY ID (ID) 42 | ) ENGINE=InnoDB DELAY_KEY_WRITE=1 MAX_ROWS=100000000 AVG_ROW_LENGTH=63 43 | """; 44 | 45 | dbconfig:createTableBnodes """ 46 | CREATE TABLE IF NOT EXISTS Bnodes ( 47 | ID bigint unsigned NOT NULL, 48 | Name text NOT NULL, 49 | PRIMARY KEY ID (ID) 50 | ) ENGINE=InnoDB DELAY_KEY_WRITE=1 MAX_ROWS=100000000 AVG_ROW_LENGTH=33 51 | """; 52 | 53 | dbconfig:createTableModels """ 54 | CREATE TABLE IF NOT EXISTS Models ( 55 | ID bigint unsigned NOT NULL, 56 | Name text NOT NULL, 57 | PRIMARY KEY ID (ID) 58 | ) ENGINE=InnoDB DELAY_KEY_WRITE=1 59 | """; 60 | 61 | . 62 | -------------------------------------------------------------------------------- /src/rdf_concepts_internal.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_concepts_internal.h - Internal RDF concept URIs and nodes definitions 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | #ifndef LIBRDF_CONCEPTS_INTERNAL_H 27 | #define LIBRDF_CONCEPTS_INTERNAL_H 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | /* class methods */ 34 | void librdf_init_concepts(librdf_world *world); 35 | void librdf_finish_concepts(librdf_world *world); 36 | 37 | void librdf_get_concept_by_name(librdf_world *world, int is_ms, const char *name, librdf_uri **uri_p, librdf_node **node_p); 38 | 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/rdf_digest.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_digest.h - RDF Digest Factory / Digest interfaces and definition 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | 27 | #ifndef LIBRDF_DIGEST_H 28 | #define LIBRDF_DIGEST_H 29 | 30 | #ifdef LIBRDF_INTERNAL 31 | #include 32 | #endif 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | /* public constructor */ 39 | REDLAND_API 40 | librdf_digest* librdf_new_digest(librdf_world *world, const char *name); 41 | 42 | /* destructor */ 43 | REDLAND_API 44 | void librdf_free_digest(librdf_digest *digest); 45 | 46 | 47 | /* methods */ 48 | REDLAND_API 49 | void librdf_digest_init(librdf_digest* digest); 50 | REDLAND_API 51 | void librdf_digest_update(librdf_digest* digest, const unsigned char *buf, size_t length); 52 | REDLAND_API 53 | void librdf_digest_update_string(librdf_digest* digest, const unsigned char *string); 54 | REDLAND_API 55 | void librdf_digest_final(librdf_digest* digest); 56 | REDLAND_API 57 | void* librdf_digest_get_digest(librdf_digest* digest); 58 | REDLAND_API 59 | size_t librdf_digest_get_digest_length(librdf_digest* digest); 60 | 61 | REDLAND_API 62 | char* librdf_digest_to_string(librdf_digest* digest); 63 | REDLAND_API 64 | void librdf_digest_print(librdf_digest* digest, FILE* fh); 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /src/rdf_digest_internal.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_digest_internal.h - Internal RDF Digest Factory / Digest definitions 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | 27 | #ifndef LIBRDF_DIGEST_INTERNAL_H 28 | #define LIBRDF_DIGEST_INTERNAL_H 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | 35 | /* based on the GNUPG cipher/digest registration stuff */ 36 | struct librdf_digest_factory_s 37 | { 38 | struct librdf_digest_factory_s* next; 39 | char * name; 40 | 41 | /* the rest of this structure is populated by the 42 | digest-specific register function */ 43 | size_t context_length; 44 | size_t digest_length; 45 | 46 | /* functions (over context) */ 47 | void (*init)( void *_context ); 48 | void (*update)( void *_context, const unsigned char *buf, size_t nbytes ); 49 | void (*final)( void *_context ); 50 | unsigned char *(*get_digest)( void *_context ); 51 | }; 52 | 53 | 54 | struct librdf_digest_s { 55 | librdf_world *world; 56 | void* context; 57 | unsigned char *digest; 58 | librdf_digest_factory* factory; 59 | }; 60 | 61 | /* module init */ 62 | void librdf_init_digest(librdf_world *world); 63 | /* module finish */ 64 | void librdf_finish_digest(librdf_world *world); 65 | 66 | /* in librdf_digest_openssl.c */ 67 | #ifdef HAVE_OPENSSL_DIGESTS 68 | void librdf_digest_openssl_constructor(librdf_world *world); 69 | #endif 70 | 71 | /* in librdf_digest_md5.c */ 72 | #ifdef HAVE_LOCAL_MD5_DIGEST 73 | void librdf_digest_md5_constructor(librdf_world *world); 74 | #endif 75 | 76 | /* in librdf_digest_sha1.c */ 77 | #ifdef HAVE_LOCAL_SHA1_DIGEST 78 | void librdf_digest_sha1_constructor(librdf_world *world); 79 | #endif 80 | 81 | /* in librdf_digest_ripemd160.c */ 82 | #ifdef HAVE_LOCAL_RIPEMD160_DIGEST 83 | void librdf_digest_rmd160_constructor(librdf_world *world); 84 | #endif 85 | 86 | /* factory static methods */ 87 | void librdf_digest_register_factory(librdf_world *world, const char *name, void (*factory) (librdf_digest_factory*)); 88 | 89 | librdf_digest_factory* librdf_get_digest_factory(librdf_world *world, const char *name); 90 | 91 | /* constructor */ 92 | librdf_digest* librdf_new_digest_from_factory(librdf_world *world, librdf_digest_factory *factory); 93 | 94 | #ifdef __cplusplus 95 | } 96 | #endif 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /src/rdf_files.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_files.c - RDF File and directory handling utilities 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | #ifdef HAVE_CONFIG_H 27 | #include 28 | #endif 29 | 30 | #ifdef WIN32 31 | #include 32 | #endif 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | #ifdef HAVE_STDLIB_H 39 | #include /* for mktemp(), mkstemp(), getenv() */ 40 | #endif 41 | #ifdef HAVE_MKSTEMP 42 | #ifdef HAVE_UNISTD_H 43 | #include /* for close(), unlink() */ 44 | #endif 45 | #endif 46 | 47 | #ifdef STANDALONE 48 | #define LIBRDF_DEBUG 1 49 | #endif 50 | 51 | #include 52 | 53 | #ifndef STANDALONE 54 | 55 | 56 | #ifndef REDLAND_DISABLE_DEPRECATED 57 | /** 58 | * librdf_files_temporary_file_name: 59 | * 60 | * Create a temporary file name. 61 | * 62 | * @deprecated: Do not use this, it is unsafe. 63 | * 64 | * Return value: a new filename or NULL on failure. 65 | **/ 66 | char * 67 | librdf_files_temporary_file_name(void) 68 | { 69 | #if defined(HAVE_MKSTEMP) || defined(HAVE_MKTEMP) 70 | const char *tmp_dir; 71 | size_t length; 72 | char *name; 73 | static const char * const file_template="librdf_tmp_XXXXXX"; /* FIXME */ 74 | #ifdef HAVE_MKSTEMP 75 | int fd; 76 | #endif 77 | 78 | /* FIXME: unix dependencies */ 79 | tmp_dir=getenv("TMPDIR"); 80 | if(!tmp_dir) 81 | tmp_dir="/tmp"; 82 | 83 | length=strlen(tmp_dir) + strlen(file_template) + 2; /* 2: / sep and \/0 */ 84 | 85 | name = LIBRDF_MALLOC(char*, length); 86 | if(!name) 87 | return NULL; 88 | 89 | /* FIXME: unix dependency - file/dir separator */ 90 | sprintf(name, "%s/%s", tmp_dir, file_template); 91 | 92 | #ifdef HAVE_MKSTEMP 93 | /* Proritise mkstemp() since GNU libc says: Never use mktemp(). */ 94 | fd=mkstemp(name); 95 | if(fd<0) { 96 | LIBRDF_FREE(char*, name); 97 | return NULL; 98 | } 99 | close(fd); 100 | unlink(name); 101 | 102 | return name; 103 | #else 104 | return mktemp(name); 105 | #endif 106 | 107 | #else 108 | #ifdef HAVE_TMPNAM 109 | /* GNU libc says: Never use this function. Use mkstemp(3) instead. */ 110 | char *name; 111 | char *new_name; 112 | 113 | name=tmpnam(NULL); /* NULL ensures statically allocated */ 114 | new_name = LIBRDF_MALLOC(char*, strlen(name) + 1); 115 | if(!new_name) 116 | return NULL; 117 | strcpy(new_name, name); 118 | 119 | return name; 120 | #else /* not tmpnam(), mkstemp() or mktemp() */ 121 | HELP 122 | #endif 123 | #endif 124 | } 125 | #endif 126 | 127 | #endif 128 | 129 | 130 | /* TEST CODE */ 131 | 132 | 133 | #ifdef STANDALONE 134 | 135 | /* one more prototype */ 136 | int main(int argc, char *argv[]); 137 | 138 | 139 | int 140 | main(int argc, char *argv[]) 141 | { 142 | /* keep gcc -Wall happy */ 143 | return(0); 144 | } 145 | 146 | #endif 147 | -------------------------------------------------------------------------------- /src/rdf_files.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_files.h - RDF File and directory handling interfaces 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | #ifndef LIBRDF_FILES_H 27 | #define LIBRDF_FILES_H 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | 34 | REDLAND_DEPRECATED 35 | char* librdf_files_temporary_file_name(void); 36 | 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/rdf_hash.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_hash.h - RDF Hash Factory and Hash interfaces and definitions 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | #ifndef LIBRDF_HASH_H 27 | #define LIBRDF_HASH_H 28 | 29 | #ifdef LIBRDF_INTERNAL 30 | #include 31 | #endif 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | /* public constructors */ 38 | REDLAND_API 39 | librdf_hash* librdf_new_hash(librdf_world *world, const char *name); 40 | REDLAND_API 41 | librdf_hash* librdf_new_hash_from_string(librdf_world *world, const char *name, const char *string); 42 | REDLAND_API 43 | librdf_hash* librdf_new_hash_from_array_of_strings(librdf_world *world, const char *name, const char **array); 44 | 45 | /* public copy constructor */ 46 | REDLAND_API 47 | librdf_hash* librdf_new_hash_from_hash (librdf_hash* old_hash); 48 | 49 | /* public destructor */ 50 | REDLAND_API 51 | void librdf_free_hash(librdf_hash *hash); 52 | 53 | /* public methods */ 54 | 55 | /* retrieve one value for a given hash key */ 56 | REDLAND_API 57 | char* librdf_hash_get(librdf_hash* hash, const char *key); 58 | 59 | /* lookup a hash key and decode value as a boolean */ 60 | REDLAND_API 61 | int librdf_hash_get_as_boolean(librdf_hash* hash, const char *key); 62 | 63 | /* lookup a hash key and decode value as a long */ 64 | REDLAND_API 65 | long librdf_hash_get_as_long(librdf_hash* hash, const char *key); 66 | 67 | /* retrieve one value for key and delete from hash all other values */ 68 | REDLAND_API 69 | char* librdf_hash_get_del(librdf_hash* hash, const char *key); 70 | 71 | /* insert a key/value pair */ 72 | REDLAND_API 73 | int librdf_hash_put_strings(librdf_hash* hash, const char *key, const char *value); 74 | 75 | /* make a hash from a string */ 76 | REDLAND_API 77 | int librdf_hash_from_string(librdf_hash* hash, const char *string); 78 | 79 | /* make a string from a hash */ 80 | REDLAND_API 81 | char* librdf_hash_to_string(librdf_hash* hash, const char *filter[]); 82 | 83 | REDLAND_API 84 | void librdf_hash_print(librdf_hash* hash, FILE *fh); 85 | REDLAND_API 86 | void librdf_hash_print_keys(librdf_hash* hash, FILE *fh); 87 | REDLAND_API 88 | void librdf_hash_print_values(librdf_hash* hash, const char *key_string, FILE *fh); 89 | 90 | REDLAND_API 91 | unsigned char* librdf_hash_interpret_template(const unsigned char* template_string, librdf_hash* dictionary, const unsigned char* prefix, const unsigned char* suffix); 92 | 93 | #ifdef __cplusplus 94 | } 95 | #endif 96 | 97 | #endif 98 | -------------------------------------------------------------------------------- /src/rdf_hash_cursor.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_hash.c - RDF Hash Cursor Implementation 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | #ifdef HAVE_CONFIG_H 27 | #include 28 | #endif 29 | 30 | #ifdef WIN32 31 | #include 32 | #endif 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | #include 40 | 41 | 42 | /* private structure */ 43 | struct librdf_hash_cursor_s { 44 | librdf_hash *hash; 45 | void *context; 46 | }; 47 | 48 | 49 | 50 | /** 51 | * librdf_new_hash_cursor: 52 | * @hash: the hash object 53 | * 54 | * Constructor - Create a new #librdf_hash_cursor over a #librdf_hash. 55 | * 56 | * Return value: a new #librdf_hash_cursor or NULL on failure 57 | **/ 58 | librdf_hash_cursor* 59 | librdf_new_hash_cursor (librdf_hash* hash) 60 | { 61 | librdf_hash_cursor* cursor; 62 | void *cursor_context; 63 | 64 | cursor = LIBRDF_CALLOC(librdf_hash_cursor*, 1, sizeof(*cursor)); 65 | if(!cursor) 66 | return NULL; 67 | 68 | cursor_context = LIBRDF_CALLOC(void*, 1, hash->factory->cursor_context_length); 69 | if(!cursor_context) { 70 | LIBRDF_FREE(librdf_hash_cursor, cursor); 71 | return NULL; 72 | } 73 | 74 | cursor->hash=hash; 75 | cursor->context=cursor_context; 76 | 77 | if(hash->factory->cursor_init(cursor->context, hash->context)) { 78 | librdf_free_hash_cursor(cursor); 79 | cursor=NULL; 80 | } 81 | 82 | return cursor; 83 | } 84 | 85 | 86 | /** 87 | * librdf_free_hash_cursor: 88 | * 89 | * Destructor - destroy a #librdf_hash_cursor object. 90 | * 91 | * @cursor: hash cursor object 92 | **/ 93 | void 94 | librdf_free_hash_cursor (librdf_hash_cursor* cursor) 95 | { 96 | if(!cursor) 97 | return; 98 | 99 | if(cursor->context) { 100 | cursor->hash->factory->cursor_finish(cursor->context); 101 | LIBRDF_FREE(librdf_hash_cursor_context, cursor->context); 102 | } 103 | 104 | LIBRDF_FREE(librdf_hash_cursor, cursor); 105 | } 106 | 107 | 108 | int 109 | librdf_hash_cursor_set(librdf_hash_cursor *cursor, 110 | librdf_hash_datum *key, 111 | librdf_hash_datum *value) 112 | { 113 | return cursor->hash->factory->cursor_get(cursor->context, key, value, 114 | LIBRDF_HASH_CURSOR_SET); 115 | } 116 | 117 | 118 | int 119 | librdf_hash_cursor_get_next_value(librdf_hash_cursor *cursor, 120 | librdf_hash_datum *key, 121 | librdf_hash_datum *value) 122 | { 123 | return cursor->hash->factory->cursor_get(cursor->context, key, value, 124 | LIBRDF_HASH_CURSOR_NEXT_VALUE); 125 | } 126 | 127 | 128 | int 129 | librdf_hash_cursor_get_first(librdf_hash_cursor *cursor, 130 | librdf_hash_datum *key, librdf_hash_datum *value) 131 | { 132 | return cursor->hash->factory->cursor_get(cursor->context, key, value, 133 | LIBRDF_HASH_CURSOR_FIRST); 134 | } 135 | 136 | 137 | int 138 | librdf_hash_cursor_get_next(librdf_hash_cursor *cursor, librdf_hash_datum *key, 139 | librdf_hash_datum *value) 140 | { 141 | return cursor->hash->factory->cursor_get(cursor->context, key, value, 142 | LIBRDF_HASH_CURSOR_NEXT); 143 | } 144 | -------------------------------------------------------------------------------- /src/rdf_heuristics.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_heuristics.h - Heuristic routines to guess things about RDF prototypes 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | #ifndef LIBRDF_HEURISTICS_H 27 | #define LIBRDF_HEURISTICS_H 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | char* librdf_heuristic_gen_name(const char *name); 34 | int librdf_heuristic_is_blank_node(const char *node); 35 | const char* librdf_heuristic_get_blank_node(const char *node); 36 | int librdf_heuristic_object_is_literal(const char *object); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/rdf_init.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_init.h - Overall library initialisation / termination and memory 4 | * management prototypes 5 | * 6 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 7 | * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ 8 | * 9 | * This package is Free Software and part of Redland http://librdf.org/ 10 | * 11 | * It is licensed under the following three licenses as alternatives: 12 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 13 | * 2. GNU General Public License (GPL) V2 or any newer version 14 | * 3. Apache License, V2.0 or any newer version 15 | * 16 | * You may not use this file except in compliance with at least one of 17 | * the above three licenses. 18 | * 19 | * See LICENSE.html or LICENSE.txt at the top of this package for the 20 | * complete terms and further detail along with the license texts for 21 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 22 | * 23 | * 24 | */ 25 | 26 | 27 | #ifndef LIBRDF_INIT_H 28 | #define LIBRDF_INIT_H 29 | 30 | typedef void (*librdf_raptor_init_handler)(void* user_data, raptor_world* raptor_world_ptr); 31 | typedef void (*librdf_rasqal_init_handler)(void* user_data, rasqal_world* rasqal_world_ptr); 32 | 33 | 34 | #ifdef LIBRDF_INTERNAL 35 | #include 36 | #endif 37 | 38 | #ifndef LIBRDF_OBJC_FRAMEWORK 39 | #include 40 | #else 41 | #include 42 | #endif 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | REDLAND_API 49 | librdf_world* librdf_new_world(void); 50 | REDLAND_API 51 | void librdf_free_world(librdf_world *world); 52 | REDLAND_API 53 | void librdf_world_open(librdf_world *world); 54 | 55 | REDLAND_API 56 | void librdf_world_init_mutex(librdf_world *world); 57 | 58 | REDLAND_API 59 | void librdf_world_set_rasqal(librdf_world* world, rasqal_world* rasqal_world_ptr); 60 | 61 | REDLAND_API 62 | void librdf_world_set_raptor_init_handler(librdf_world* world, void* user_data, librdf_raptor_init_handler handler); 63 | REDLAND_API 64 | void librdf_world_set_rasqal_init_handler(librdf_world* world, void* user_data, librdf_rasqal_init_handler handler); 65 | 66 | REDLAND_API 67 | rasqal_world* librdf_world_get_rasqal(librdf_world* world); 68 | 69 | REDLAND_API 70 | void librdf_world_set_error(librdf_world* world, void *user_data, librdf_log_level_func error_handler); 71 | REDLAND_API 72 | void librdf_world_set_warning(librdf_world* world, void *user_data, librdf_log_level_func warning_handler); 73 | REDLAND_API 74 | void librdf_world_set_logger(librdf_world* world, void *user_data, librdf_log_func log_handler); 75 | 76 | REDLAND_API 77 | void librdf_world_set_digest(librdf_world* world, const char *name); 78 | 79 | REDLAND_API 80 | void librdf_free_memory(void *ptr); 81 | REDLAND_API 82 | void* librdf_alloc_memory(size_t size); 83 | REDLAND_API 84 | void* librdf_calloc_memory(size_t nmemb, size_t size); 85 | 86 | /** 87 | * LIBRDF_WORLD_FEATURE_GENID_BASE: 88 | * 89 | * World feature to set the generated ID base. 90 | * 91 | * Must be set before the world is opened with librdf_world_open(). 92 | */ 93 | #define LIBRDF_WORLD_FEATURE_GENID_BASE "http://feature.librdf.org/genid-base" 94 | 95 | /** 96 | * LIBRDF_WORLD_FEATURE_GENID_COUNTER: 97 | * 98 | * World feature to set the generated ID counter. 99 | * 100 | * Must be set before the world is opened with librdf_world_open(). 101 | */ 102 | #define LIBRDF_WORLD_FEATURE_GENID_COUNTER "http://feature.librdf.org/genid-counter" 103 | 104 | REDLAND_API 105 | librdf_node* librdf_world_get_feature(librdf_world* world, librdf_uri *feature); 106 | REDLAND_API 107 | int librdf_world_set_feature(librdf_world* world, librdf_uri *feature, librdf_node* value); 108 | 109 | /* OLD INTERFACES */ 110 | REDLAND_API REDLAND_DEPRECATED 111 | void librdf_init_world(char *digest_factory_name, void* not_used2); 112 | REDLAND_API REDLAND_DEPRECATED 113 | void librdf_destroy_world(void); 114 | 115 | #ifdef LIBRDF_INTERNAL 116 | const char* librdf_basename(const char *name); 117 | #endif 118 | 119 | #ifdef __cplusplus 120 | } 121 | #endif 122 | 123 | #endif 124 | -------------------------------------------------------------------------------- /src/rdf_iterator.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_iterator.h - RDF Iterator definition 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | 27 | #ifndef LIBRDF_ITERATOR_H 28 | #define LIBRDF_ITERATOR_H 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | /** 35 | * librdf_iterator_map_handler: 36 | * @iterator: Iterator that this map is operating over. 37 | * @map_context: Map data context pointer. 38 | * @item: Pointer to the current item in the iteration. 39 | * 40 | * Map function for a #librdf_iterator map operation. 41 | * 42 | * See librdf_iterator_add_map(). 43 | * 44 | * Returns: item in keep the iteration or NULL to remove it 45 | */ 46 | typedef void* (*librdf_iterator_map_handler)(librdf_iterator *iterator, void *map_context, void *item); 47 | 48 | 49 | /** 50 | * librdf_iterator_map_free_context_handler: 51 | * @map_context: Map data context pointer. 52 | * 53 | * Free handler function for a #librdf_iterator map operation. 54 | * 55 | * See librdf_iterator_add_map(). 56 | */ 57 | typedef void (*librdf_iterator_map_free_context_handler)(void *map_context); 58 | 59 | #ifdef LIBRDF_INTERNAL 60 | #include 61 | #endif 62 | 63 | 64 | /** 65 | * librdf_iterator_get_method_flags: 66 | * @LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT: get context from iterator - implementing librdf_iterator_get_object() 67 | * @LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: get object from iterator - implementing librdf_iterator_get_context() 68 | * @LIBRDF_ITERATOR_GET_METHOD_GET_KEY: get iterator key object from iterator - implementing librdf_iterator_get_key() 69 | * @LIBRDF_ITERATOR_GET_METHOD_GET_VALUE: get iterator value from iterator - implementing librdf_iterator_get_value() 70 | * 71 | * Flags for librdf_new_iterator() get_method function pointer. 72 | */ 73 | /* iterator get_method flags */ 74 | typedef enum { 75 | LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT = 0, 76 | LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT = 1, 77 | LIBRDF_ITERATOR_GET_METHOD_GET_KEY = 2, 78 | LIBRDF_ITERATOR_GET_METHOD_GET_VALUE = 3 79 | } librdf_iterator_get_method_flags; 80 | 81 | 82 | REDLAND_API 83 | librdf_iterator* librdf_new_iterator(librdf_world *world, void *context, int (*is_end_method)(void*), int (*next_method)(void*), void* (*get_method)(void*, int), void (*finished_method)(void*)); 84 | 85 | REDLAND_API 86 | void librdf_free_iterator(librdf_iterator* iterator); 87 | 88 | REDLAND_API 89 | int librdf_iterator_end(librdf_iterator* iterator); 90 | REDLAND_API REDLAND_DEPRECATED 91 | int librdf_iterator_have_elements(librdf_iterator* iterator); 92 | 93 | REDLAND_API 94 | int librdf_iterator_next(librdf_iterator* iterator); 95 | REDLAND_API 96 | void* librdf_iterator_get_object(librdf_iterator* iterator); 97 | REDLAND_API 98 | void* librdf_iterator_get_context(librdf_iterator* iterator); 99 | REDLAND_API 100 | void* librdf_iterator_get_key(librdf_iterator* iterator); 101 | REDLAND_API 102 | void* librdf_iterator_get_value(librdf_iterator* iterator); 103 | 104 | REDLAND_API 105 | int librdf_iterator_add_map(librdf_iterator* iterator, librdf_iterator_map_handler map_function, librdf_iterator_map_free_context_handler free_context, void *map_context); 106 | 107 | REDLAND_API 108 | librdf_iterator* librdf_new_empty_iterator(librdf_world *world); 109 | 110 | #ifdef __cplusplus 111 | } 112 | #endif 113 | 114 | #endif 115 | -------------------------------------------------------------------------------- /src/rdf_iterator_internal.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_iterator_internal.h - Internal RDF Iterator definitions 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | 27 | #ifndef LIBRDF_ITERATOR_INTERNAL_H 28 | #define LIBRDF_ITERATOR_INTERNAL_H 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | /* used in map_list below */ 35 | typedef struct { 36 | void *context; /* context to pass on to map */ 37 | librdf_iterator_map_handler fn; 38 | librdf_iterator_map_free_context_handler free_context; 39 | } librdf_iterator_map; 40 | 41 | struct librdf_iterator_s { 42 | librdf_world *world; 43 | void *context; 44 | int is_finished; /* 1 when have no more elements */ 45 | int is_updated; /* 1 when we know there is a current item */ 46 | int is_updating; /* 1 when are in the middle of update process */ 47 | 48 | /* Used when mapping */ 49 | void *current; /* stores current element */ 50 | librdf_list *map_list; /* non-empty means there is a list of maps */ 51 | 52 | int (*is_end_method)(void*); 53 | int (*next_method)(void*); 54 | void* (*get_method)(void*, int); /* flags: type of get */ 55 | void (*finished_method)(void*); 56 | }; 57 | 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /src/rdf_list.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_list.h - RDF List Interface definition 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | 27 | #ifndef LIBRDF_LIST_H 28 | #define LIBRDF_LIST_H 29 | 30 | #ifndef LIBRDF_OBJC_FRAMEWORK 31 | #include 32 | #else 33 | #include 34 | #endif 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | REDLAND_API 41 | librdf_list* librdf_new_list(librdf_world *world); 42 | REDLAND_API 43 | void librdf_free_list(librdf_list* list); 44 | 45 | REDLAND_API 46 | void librdf_list_clear(librdf_list* list); 47 | /* add to end of list (push) */ 48 | REDLAND_API 49 | int librdf_list_add(librdf_list* list, void *data); 50 | /* add to start of list */ 51 | REDLAND_API 52 | int librdf_list_unshift(librdf_list* list, void *data); 53 | /* remove from start of list */ 54 | REDLAND_API 55 | void* librdf_list_shift(librdf_list* list); 56 | /* remove from end of list (pop) */ 57 | REDLAND_API 58 | void* librdf_list_pop(librdf_list* list); 59 | REDLAND_API 60 | void *librdf_list_remove(librdf_list* list, void *data); 61 | REDLAND_API 62 | int librdf_list_contains(librdf_list* list, void *data); 63 | REDLAND_API 64 | int librdf_list_size(librdf_list* list); 65 | 66 | REDLAND_API 67 | void librdf_list_set_equals(librdf_list* list, int (*equals) (void* data1, void *data2)); 68 | 69 | REDLAND_API 70 | librdf_iterator* librdf_list_get_iterator(librdf_list* list); 71 | 72 | REDLAND_API 73 | void librdf_list_foreach(librdf_list* list, void (*fn)(void *, void *), void *user_data); 74 | 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /src/rdf_list_internal.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_list_internal.h - Internal RDF List Interface definitions 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | 27 | #ifndef LIBRDF_LIST_INTERNAL_H 28 | #define LIBRDF_LIST_INTERNAL_H 29 | 30 | #ifndef LIBRDF_OBJC_FRAMEWORK 31 | #include 32 | #else 33 | #include 34 | #endif 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /* private structure */ 41 | struct librdf_list_node_s 42 | { 43 | struct librdf_list_node_s* next; 44 | struct librdf_list_node_s* prev; 45 | void *data; 46 | }; 47 | typedef struct librdf_list_node_s librdf_list_node; 48 | 49 | 50 | struct librdf_list_iterator_context_s { 51 | librdf_iterator* iterator; 52 | librdf_list* list; 53 | librdf_list_node *current; 54 | librdf_list_node *next; 55 | struct librdf_list_iterator_context_s* next_ic; 56 | struct librdf_list_iterator_context_s* prev_ic; 57 | }; 58 | 59 | typedef struct librdf_list_iterator_context_s librdf_list_iterator_context; 60 | 61 | struct librdf_list_s 62 | { 63 | librdf_world *world; 64 | librdf_list_node* first; 65 | librdf_list_node* last; 66 | int length; 67 | int (*equals) (void* data1, void *data2); 68 | int iterator_count; 69 | librdf_list_iterator_context* first_iterator; 70 | librdf_list_iterator_context* last_iterator; 71 | }; 72 | 73 | #ifdef __cplusplus 74 | } 75 | #endif 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /src/rdf_log_internal.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_log_internal.h - Internal RDF logging definitions 4 | * 5 | * Copyright (C) 2004-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2004-2005, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | #ifndef LIBRDF_LOG_INTERNAL_H 27 | #define LIBRDF_LOG_INTERNAL_H 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | REDLAND_NORETURN 34 | void librdf_fatal(librdf_world* world, int facility, const char *file, int line, const char *function, const char *message); 35 | 36 | void librdf_test_error(librdf_world* world, const char *message); 37 | void librdf_test_warning(librdf_world* world, const char *message); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/rdf_node_internal.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_node_internal.h - Internal RDF Node definitions 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | 27 | #ifndef LIBRDF_NODE_INTERNAL_H 28 | #define LIBRDF_NODE_INTERNAL_H 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | struct librdf_node_s 35 | { 36 | librdf_world *world; 37 | librdf_node_type type; 38 | int usage; 39 | union 40 | { 41 | struct 42 | { 43 | /* rdf:Resource and rdf:Property-s have URIs */ 44 | librdf_uri *uri; 45 | } resource; 46 | struct 47 | { 48 | /* literals are UTF-8 string values ... */ 49 | unsigned char *string; 50 | /* up to 2^31-1 bytes long */ 51 | unsigned int string_len; 52 | 53 | /* datatype URI or null */ 54 | librdf_uri* datatype_uri; 55 | 56 | /* XML defines these additional attributes for literals */ 57 | 58 | /* Language of literal (xml:lang) */ 59 | char *xml_language; 60 | /* up to 255 bytes long */ 61 | unsigned char xml_language_len; 62 | 63 | /* Hash key & size */ 64 | unsigned char *key; 65 | size_t size; 66 | } literal; 67 | struct 68 | { 69 | /* blank nodes have an identifier */ 70 | unsigned char *identifier; 71 | int identifier_len; 72 | } blank; 73 | } value; 74 | }; 75 | 76 | 77 | /* initialising functions / constructors */ 78 | 79 | /* class methods */ 80 | void librdf_init_node(librdf_world* world); 81 | void librdf_finish_node(librdf_world* world); 82 | 83 | /* exported public in error but never usable */ 84 | librdf_digest* librdf_node_get_digest(librdf_node* node); 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /src/rdf_parser_internal.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_parser_internal.h - Internal RDF Parser Factory / Parser definitions 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | 27 | #ifndef LIBRDF_PARSER_INTERNAL_H 28 | #define LIBRDF_PARSER_INTERNAL_H 29 | 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | struct librdf_parser_factory_s 36 | { 37 | struct librdf_parser_factory_s* next; 38 | /* syntax name - required */ 39 | char *name; 40 | /* syntax label */ 41 | char *label; 42 | /* handle this MIME type/ Internet Media Type - optional */ 43 | char *mime_type; 44 | /* handles the syntax defined by this URI - optional */ 45 | librdf_uri *type_uri; 46 | 47 | /* the rest of this structure is populated by the 48 | parser-specific register function */ 49 | size_t context_length; 50 | 51 | /* create a new parser */ 52 | int (*init)(librdf_parser* parser, void *_context); 53 | 54 | /* destroy a parser */ 55 | void (*terminate)(void *_context); 56 | 57 | /* get/set features of parser (think of Java properties) */ 58 | librdf_node* (*get_feature)(void *_context, librdf_uri *feature); 59 | int (*set_feature)(void *_context, librdf_uri *feature, librdf_node *value); 60 | 61 | /* parsing methods - all are optional but the only 62 | * current implementation, raptor, implements all of them 63 | */ 64 | librdf_stream* (*parse_uri_as_stream)(void *_context, librdf_uri *uri, librdf_uri* base_uri); 65 | int (*parse_uri_into_model)(void *_context, librdf_uri *uri, librdf_uri* base_uri, librdf_model *model); 66 | librdf_stream* (*parse_file_as_stream)(void *_context, librdf_uri *uri, librdf_uri *base_uri); 67 | int (*parse_file_into_model)(void *_context, librdf_uri *uri, librdf_uri *base_uri, librdf_model *model); 68 | int (*parse_string_into_model)(void *_context, const unsigned char *string, librdf_uri* base_uri, librdf_model *model); 69 | librdf_stream* (*parse_string_as_stream)(void *_context, const unsigned char *string, librdf_uri *base_uri); 70 | int (*parse_counted_string_into_model)(void *_context, const unsigned char *string, size_t length, librdf_uri* base_uri, librdf_model *model); 71 | librdf_stream* (*parse_counted_string_as_stream)(void *_context, const unsigned char *string, size_t length, librdf_uri *base_uri); 72 | int (*parse_iostream_into_model)(void *_context, raptor_iostream *iostream, librdf_uri* base_uri, librdf_model *model); 73 | librdf_stream* (*parse_iostream_as_stream)(void *_context, raptor_iostream *iostream, librdf_uri *base_uri); 74 | char* (*get_accept_header)(void* context); 75 | const char* (*get_namespaces_seen_prefix)(void* context, int offset); 76 | librdf_uri* (*get_namespaces_seen_uri)(void* context, int offset); 77 | int (*get_namespaces_seen_count)(void* context); 78 | int (*parse_file_handle_into_model)(void *_context, FILE *fh, int close_fh, librdf_uri* base_uri, librdf_model *model); 79 | librdf_stream* (*parse_file_handle_as_stream)(void *_context, FILE *fh, int close_fh, librdf_uri *base_uri); 80 | }; 81 | 82 | 83 | struct librdf_parser_s { 84 | librdf_world *world; 85 | 86 | void *context; 87 | 88 | librdf_parser_factory* factory; 89 | 90 | void* uri_filter_user_data; 91 | librdf_uri_filter_func uri_filter; 92 | }; 93 | 94 | /* class methods */ 95 | librdf_parser_factory* librdf_get_parser_factory(librdf_world *world, const char *name, const char *mime_type, librdf_uri *type_uri); 96 | 97 | 98 | /* module init */ 99 | void librdf_init_parser(librdf_world *world); 100 | /* module finish */ 101 | void librdf_finish_parser(librdf_world *world); 102 | 103 | void librdf_parser_raptor_constructor(librdf_world* world); 104 | void librdf_parser_raptor_destructor(void); 105 | 106 | 107 | #ifdef __cplusplus 108 | } 109 | #endif 110 | 111 | #endif 112 | -------------------------------------------------------------------------------- /src/rdf_raptor.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_raptor.h - librdf Raptor integration 4 | * 5 | * Copyright (C) 2008, David Beckett http://www.dajobe.org/ 6 | * 7 | * This package is Free Software and part of Redland http://librdf.org/ 8 | * 9 | * It is licensed under the following three licenses as alternatives: 10 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 11 | * 2. GNU General Public License (GPL) V2 or any newer version 12 | * 3. Apache License, V2.0 or any newer version 13 | * 14 | * You may not use this file except in compliance with at least one of 15 | * the above three licenses. 16 | * 17 | * See LICENSE.html or LICENSE.txt at the top of this package for the 18 | * complete terms and further detail along with the license texts for 19 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 20 | * 21 | * 22 | */ 23 | 24 | 25 | 26 | #ifndef LIBRDF_RAPTOR_H 27 | #define LIBRDF_RAPTOR_H 28 | 29 | #ifdef LIBRDF_INTERNAL 30 | #include 31 | #endif 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | REDLAND_API 38 | void librdf_world_set_raptor(librdf_world* world, raptor_world* raptor_world_ptr); 39 | REDLAND_API 40 | raptor_world* librdf_world_get_raptor(librdf_world* world); 41 | 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/rdf_raptor_internal.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_raptor_internal.h - librdf Raptor integration internals 4 | * 5 | * Copyright (C) 2008, David Beckett http://www.dajobe.org/ 6 | * 7 | * This package is Free Software and part of Redland http://librdf.org/ 8 | * 9 | * It is licensed under the following three licenses as alternatives: 10 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 11 | * 2. GNU General Public License (GPL) V2 or any newer version 12 | * 3. Apache License, V2.0 or any newer version 13 | * 14 | * You may not use this file except in compliance with at least one of 15 | * the above three licenses. 16 | * 17 | * See LICENSE.html or LICENSE.txt at the top of this package for the 18 | * complete terms and further detail along with the license texts for 19 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 20 | * 21 | * 22 | */ 23 | 24 | 25 | 26 | #ifndef LIBRDF_RAPTOR_INTERNAL_H 27 | #define LIBRDF_RAPTOR_INTERNAL_H 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | int librdf_init_raptor(librdf_world* world); 34 | void librdf_finish_raptor(librdf_world* world); 35 | 36 | int librdf_raptor_free_bnode_hash(librdf_world* world); 37 | int librdf_raptor_reset_bnode_hash(librdf_world* world); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/rdf_serializer_internal.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_serializer_internal.h - Internal RDF Serializer definitions 4 | * 5 | * Copyright (C) 2002-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2002-2005, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | 27 | #ifndef LIBRDF_SERIALIZER_INTERNAL_H 28 | #define LIBRDF_SERIALIZER_INTERNAL_H 29 | 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | #include 36 | 37 | struct librdf_serializer_factory_s 38 | { 39 | struct librdf_serializer_factory_s* next; 40 | 41 | /* factory name - required */ 42 | char *name; 43 | 44 | /* factory label */ 45 | char *label; 46 | 47 | /* serialize to this MIME type/ Internet Media Type - optional */ 48 | char *mime_type; 49 | 50 | /* writes the syntax defined by this URI - optional */ 51 | librdf_uri *type_uri; 52 | 53 | /* the rest of this structure is populated by the 54 | serializer-specific register function */ 55 | size_t context_length; 56 | 57 | /* create a new serializer */ 58 | int (*init)(librdf_serializer* serializer, void *_context); 59 | 60 | /* destroy a serializer */ 61 | void (*terminate)(void *_context); 62 | 63 | /* get/set features of serializer */ 64 | librdf_node* (*get_feature)(void *_context, librdf_uri* feature); 65 | int (*set_feature)(void *_context, librdf_uri *feature, librdf_node* value); 66 | 67 | int (*set_namespace)(void *_context, librdf_uri *uri, const char *prefix); 68 | 69 | int (*serialize_stream_to_file_handle)(void *_context, FILE *handle, librdf_uri* base_uri, librdf_stream *stream); 70 | 71 | int (*serialize_model_to_file_handle)(void *_context, FILE *handle, librdf_uri* base_uri, librdf_model *model); 72 | 73 | unsigned char* (*serialize_stream_to_counted_string)(void *_context, librdf_uri* base_uri, librdf_stream *stream, size_t *length_p); 74 | 75 | unsigned char* (*serialize_model_to_counted_string)(void *_context, librdf_uri* base_uri, librdf_model *model, size_t *length_p); 76 | 77 | int (*serialize_stream_to_iostream)(void *context, librdf_uri* base_uri, librdf_stream *stream, raptor_iostream* iostr); 78 | 79 | int (*serialize_model_to_iostream)(void *context, librdf_uri* base_uri, librdf_model *model, raptor_iostream* iostr); 80 | }; 81 | 82 | 83 | struct librdf_serializer_s { 84 | librdf_world *world; 85 | 86 | void *context; 87 | 88 | void *error_user_data; 89 | void *warning_user_data; 90 | void (*error_fn)(void *user_data, const char *msg, ...); 91 | void (*warning_fn)(void *user_data, const char *msg, ...); 92 | 93 | librdf_serializer_factory* factory; 94 | }; 95 | 96 | /* class methods */ 97 | librdf_serializer_factory* librdf_get_serializer_factory(librdf_world *world, const char *name, const char *mime_type, librdf_uri *type_uri); 98 | 99 | 100 | /* module init */ 101 | void librdf_init_serializer(librdf_world *world); 102 | /* module finish */ 103 | void librdf_finish_serializer(librdf_world *world); 104 | 105 | void librdf_serializer_raptor_constructor(librdf_world* world); 106 | void librdf_serializer_rdfxml_constructor(librdf_world* world); 107 | 108 | 109 | #ifdef __cplusplus 110 | } 111 | #endif 112 | 113 | #endif 114 | -------------------------------------------------------------------------------- /src/rdf_statement_internal.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_statement_internal.h - Internal RDF Statement definitions 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | 27 | #ifndef LIBRDF_STATEMENT_INTERNAL_H 28 | #define LIBRDF_STATEMENT_INTERNAL_H 29 | 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | /* class methods */ 36 | void librdf_init_statement(librdf_world *world); 37 | void librdf_finish_statement(librdf_world *world); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/rdf_storage_internal.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_storage_internal.h - Internal RDF Storage definitions 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | #ifndef LIBRDF_STORAGE_INTERNAL_H 27 | #define LIBRDF_STORAGE_INTERNAL_H 28 | 29 | #include "rdf_storage_module.h" 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | /** A storage object */ 36 | struct librdf_storage_s 37 | { 38 | librdf_world *world; 39 | 40 | /* usage count of this instance 41 | * Used by other redland classes such as model, iterator, stream 42 | * via librdf_storage_add_reference librdf_storage_remove_reference 43 | * The usage count of storage after construction is 1. 44 | */ 45 | int usage; 46 | 47 | librdf_model *model; 48 | void *instance; 49 | int index_contexts; 50 | struct librdf_storage_factory_s* factory; 51 | }; 52 | 53 | void librdf_init_storage_list(librdf_world *world); 54 | 55 | void librdf_init_storage_hashes(librdf_world *world); 56 | 57 | void librdf_init_storage_trees(librdf_world *world); 58 | 59 | void librdf_init_storage_file(librdf_world *world); 60 | 61 | #ifdef STORAGE_MYSQL 62 | void librdf_init_storage_mysql(librdf_world *world); 63 | #endif 64 | 65 | #ifdef STORAGE_VIRTUOSO 66 | void librdf_init_storage_virtuoso(librdf_world *world); 67 | #endif 68 | 69 | #ifdef STORAGE_POSTGRESQL 70 | void librdf_init_storage_postgresql(librdf_world *world); 71 | #endif 72 | 73 | #ifdef STORAGE_TSTORE 74 | void librdf_init_storage_tstore(librdf_world *world); 75 | #endif 76 | 77 | #ifdef STORAGE_SQLITE 78 | void librdf_init_storage_sqlite(librdf_world *world); 79 | #endif 80 | 81 | 82 | /* module init */ 83 | void librdf_init_storage(librdf_world *world); 84 | 85 | /* module terminate */ 86 | void librdf_finish_storage(librdf_world *world); 87 | 88 | /* class methods */ 89 | librdf_storage_factory* librdf_get_storage_factory(librdf_world* world, const char *name); 90 | 91 | 92 | /* rdf_storage_sql.c */ 93 | typedef struct 94 | { 95 | char* filename; 96 | 97 | const char** predicate_uri_strings; 98 | int predicates_count; 99 | 100 | /* array of char* with NULL at end - size predicates_count */ 101 | char** values; 102 | } librdf_sql_config; 103 | 104 | librdf_sql_config* librdf_new_sql_config(librdf_world* world, const char *storage_name, const char* layout, const char* config_dir, const char** predicate_uri_strings); 105 | librdf_sql_config* librdf_new_sql_config_for_storage(librdf_storage* storage, const char* layout, const char* dir); 106 | void librdf_free_sql_config(librdf_sql_config* config); 107 | 108 | typedef enum { 109 | DBCONFIG_CREATE_TABLE_STATEMENTS, 110 | DBCONFIG_CREATE_TABLE_LITERALS, 111 | DBCONFIG_CREATE_TABLE_RESOURCES, 112 | DBCONFIG_CREATE_TABLE_BNODES, 113 | DBCONFIG_CREATE_TABLE_MODELS, 114 | DBCONFIG_CREATE_TABLE_LAST = DBCONFIG_CREATE_TABLE_MODELS 115 | } librdf_dbconfig; 116 | 117 | extern const char* librdf_storage_sql_dbconfig_predicates[DBCONFIG_CREATE_TABLE_LAST+2]; 118 | 119 | 120 | 121 | #ifdef __cplusplus 122 | } 123 | #endif 124 | 125 | #endif 126 | -------------------------------------------------------------------------------- /src/rdf_storage_sql_test.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_storage_sql_test.c - RDF Storage SQL config test program 4 | * 5 | * Copyright (C) 2008, David Beckett http://www.dajobe.org/ 6 | * 7 | * This package is Free Software and part of Redland http://librdf.org/ 8 | * 9 | * It is licensed under the following three licenses as alternatives: 10 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 11 | * 2. GNU General Public License (GPL) V2 or any newer version 12 | * 3. Apache License, V2.0 or any newer version 13 | * 14 | * You may not use this file except in compliance with at least one of 15 | * the above three licenses. 16 | * 17 | * See LICENSE.html or LICENSE.txt at the top of this package for the 18 | * complete terms and further detail along with the license texts for 19 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 20 | * 21 | * 22 | */ 23 | 24 | 25 | #ifdef HAVE_CONFIG_H 26 | #include 27 | #endif 28 | 29 | #ifdef WIN32 30 | #include 31 | #endif 32 | 33 | #include 34 | #include 35 | #ifdef HAVE_STDLIB_H 36 | #include 37 | #endif 38 | #ifdef HAVE_UNISTD_H 39 | #include 40 | #endif 41 | 42 | #include 43 | 44 | /* one prototype needed */ 45 | int main(int argc, char *argv[]); 46 | 47 | 48 | int 49 | main(int argc, char *argv[]) 50 | { 51 | librdf_world* world; 52 | int failures=0; 53 | int i; 54 | const char *program=librdf_basename((const char*)argv[0]); 55 | const char* storage="mysql"; 56 | const char* dir; 57 | 58 | if(argc>1) 59 | dir=argv[1]; 60 | else 61 | dir="."; 62 | 63 | world=librdf_new_world(); 64 | librdf_world_open(world); 65 | 66 | for(i=0; i<2; i++) { 67 | const char* layout=(i == 0) ? "v1" : "v2"; 68 | librdf_sql_config* config; 69 | 70 | fprintf(stderr, "%s: Opening SQL config for storage %s layout %s\n", 71 | program, storage, layout); 72 | 73 | config=librdf_new_sql_config(world, storage, layout, dir, 74 | librdf_storage_sql_dbconfig_predicates); 75 | if(config) { 76 | const char* value=config->values[DBCONFIG_CREATE_TABLE_BNODES]; 77 | if(value) 78 | fprintf(stderr, "%s: Bnode table declaration found of %zu bytes size\n", 79 | program, strlen(value)); 80 | else { 81 | fprintf(stderr, "%s: FAILED Bnode table declaration not found\n", 82 | program); 83 | failures++; 84 | } 85 | 86 | librdf_free_sql_config(config); 87 | } else { 88 | fprintf(stderr, "%s: FAILED to get complete SQL configuration\n", 89 | program); 90 | failures++; 91 | } 92 | } 93 | 94 | librdf_free_world(world); 95 | 96 | return failures; 97 | } 98 | -------------------------------------------------------------------------------- /src/rdf_stream.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_stream.h - RDF Stream interface and definitions 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | #ifndef LIBRDF_STREAM_H 27 | #define LIBRDF_STREAM_H 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | /** 34 | * librdf_stream_map_handler: 35 | * @stream: Stream that this map is operating over. 36 | * @map_context: Map data context pointer. 37 | * @item: Pointer to the current item in the iteration. 38 | * 39 | * Map function for a #librdf_stream map operation. 40 | * 41 | * See librdf_stream_add_map(). 42 | * 43 | * Returns: item in keep the iteration or NULL to remove it 44 | */ 45 | typedef librdf_statement* (*librdf_stream_map_handler)(librdf_stream *stream, void *map_context, librdf_statement *item); 46 | 47 | /** 48 | * librdf_stream_map_free_context_handler: 49 | * @map_context: Map data context pointer. 50 | * 51 | * Free handler function for a #librdf_stream map operation. 52 | * 53 | * See librdf_stream_add_map(). 54 | */ 55 | typedef void (*librdf_stream_map_free_context_handler)(void *map_context); 56 | 57 | #ifdef LIBRDF_INTERNAL 58 | #include 59 | #endif 60 | 61 | 62 | /** 63 | * librdf_stream_get_method_flags: 64 | * @LIBRDF_STREAM_GET_METHOD_GET_OBJECT: get object from iterator - implementing librdf_stream_get_object() 65 | * @LIBRDF_STREAM_GET_METHOD_GET_CONTEXT: get context from iterator - implementing librdf_stream_get_context() 66 | * 67 | * Flags for librdf_new_stream() get_method function pointer. 68 | */ 69 | typedef enum { 70 | LIBRDF_STREAM_GET_METHOD_GET_OBJECT = LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT, 71 | LIBRDF_STREAM_GET_METHOD_GET_CONTEXT = LIBRDF_ITERATOR_GET_METHOD_GET_CONTEXT 72 | } librdf_stream_get_method_flags; 73 | 74 | 75 | /* constructor */ 76 | 77 | REDLAND_API 78 | librdf_stream* librdf_new_stream(librdf_world *world, void* context, int (*is_end_method)(void*), int (*next_method)(void*), void* (*get_method)(void*, int), void (*finished_method)(void*)); 79 | REDLAND_API 80 | librdf_stream* librdf_new_stream_from_node_iterator(librdf_iterator* iterator, librdf_statement* statement, librdf_statement_part field); 81 | 82 | /* destructor */ 83 | 84 | REDLAND_API 85 | void librdf_free_stream(librdf_stream* stream); 86 | 87 | /* methods */ 88 | REDLAND_API 89 | int librdf_stream_end(librdf_stream* stream); 90 | 91 | REDLAND_API 92 | int librdf_stream_next(librdf_stream* stream); 93 | REDLAND_API 94 | librdf_statement* librdf_stream_get_object(librdf_stream* stream); 95 | REDLAND_API 96 | librdf_node* librdf_stream_get_context2(librdf_stream* stream); 97 | REDLAND_API REDLAND_DEPRECATED 98 | void* librdf_stream_get_context(librdf_stream* stream); 99 | 100 | REDLAND_API 101 | int librdf_stream_add_map(librdf_stream* stream, librdf_stream_map_handler map_function, librdf_stream_map_free_context_handler free_context, void *map_context); 102 | 103 | REDLAND_API REDLAND_DEPRECATED 104 | void librdf_stream_print(librdf_stream *stream, FILE *fh); 105 | REDLAND_API 106 | int librdf_stream_write(librdf_stream *stream, raptor_iostream *iostr); 107 | 108 | REDLAND_API 109 | librdf_stream* librdf_new_empty_stream(librdf_world *world); 110 | 111 | #ifdef __cplusplus 112 | } 113 | #endif 114 | 115 | #endif 116 | -------------------------------------------------------------------------------- /src/rdf_stream_internal.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_stream_internal.h - Internal RDF Stream definitions 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | #ifndef LIBRDF_STREAM_INTERNAL_H 27 | #define LIBRDF_STREAM_INTERNAL_H 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | /* used in map_list below */ 34 | typedef struct { 35 | void *context; /* context to pass on to map */ 36 | librdf_stream_map_handler fn; 37 | librdf_stream_map_free_context_handler free_context; 38 | } librdf_stream_map; 39 | 40 | 41 | struct librdf_stream_s { 42 | librdf_world *world; 43 | void *context; 44 | int is_finished; /* 1 when have no more statements */ 45 | int is_updated; /* 1 when we know there is a current item */ 46 | int is_updating; /* 1 when are in the middle of update process */ 47 | 48 | /* Used when mapping */ 49 | librdf_statement *current; 50 | librdf_list *map_list; /* non-empty means there is a list of maps */ 51 | 52 | int (*is_end_method)(void*); 53 | int (*next_method)(void*); 54 | void* (*get_method)(void*, int); /* flags: type of get */ 55 | void (*finished_method)(void*); 56 | }; 57 | 58 | librdf_statement* librdf_stream_statement_find_map(librdf_stream *stream, void* context, librdf_statement* statement); 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /src/rdf_types.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_types.h - RDF data types used by some bit-twiddling routines 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | 27 | #ifndef LIBRDF_TYPES_H 28 | #define LIBRDF_TYPES_H 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | #include 35 | 36 | #ifndef HAVE_U64 37 | #if SIZEOF_UNSIGNED_INT == 8 38 | typedef unsigned int u64; 39 | #define UINT64_T_FMT "%u" 40 | #elif SIZEOF_UNSIGNED_LONG == 8 41 | typedef unsigned long u64; 42 | #define UINT64_T_FMT "%lu" 43 | #elif SIZEOF_UNSIGNED_LONG_LONG == 8 44 | #ifdef WIN32 45 | typedef __int64 u64; 46 | #define UINT64_T_FMT "%I64u" 47 | #else 48 | typedef unsigned long long u64; 49 | #define UINT64_T_FMT "%llu" 50 | #endif 51 | #else 52 | #error u64 type not defined 53 | #endif 54 | #endif 55 | 56 | #ifndef HAVE_U32 57 | #if SIZEOF_UNSIGNED_INT == 4 58 | typedef unsigned int u32; 59 | #elif SIZEOF_UNSIGNED_LONG == 4 60 | typedef unsigned long u32; 61 | #else 62 | #error u32 type not defined 63 | #endif 64 | #endif 65 | 66 | 67 | #ifndef HAVE_BYTE 68 | #if SIZEOF_UNSIGNED_CHAR == 1 69 | typedef unsigned char byte; 70 | #else 71 | #error byte type not defined 72 | #endif 73 | #endif 74 | 75 | 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /src/rdf_uri.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_uri.h - RDF URI Definition 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | 27 | #ifndef LIBRDF_URI_H 28 | #define LIBRDF_URI_H 29 | 30 | #ifdef LIBRDF_INTERNAL 31 | #include 32 | #endif 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | /** 39 | * librdf_uri_filter_func: 40 | * @user_data: user data 41 | * @uri: #librdf_uri URI to check 42 | * 43 | * Callback function for librdf_parser_set_uri_filter() 44 | * 45 | * Return value: non-0 to filter the URI 46 | */ 47 | typedef int (*librdf_uri_filter_func)(void *user_data, librdf_uri* uri); 48 | 49 | 50 | /* constructors */ 51 | REDLAND_API 52 | librdf_uri* librdf_new_uri (librdf_world *world, const unsigned char *uri_string); 53 | REDLAND_API 54 | librdf_uri* librdf_new_uri2 (librdf_world *world, const unsigned char *uri_string, size_t length); 55 | /* Create a new URI from an existing URI - CLONE */ 56 | REDLAND_API 57 | librdf_uri* librdf_new_uri_from_uri (librdf_uri* old_uri); 58 | /* Create a new URI from an existing URI and local name */ 59 | REDLAND_API 60 | librdf_uri* librdf_new_uri_from_uri_local_name (librdf_uri* old_uri, const unsigned char *local_name); 61 | 62 | /* destructor */ 63 | REDLAND_API 64 | void librdf_free_uri(librdf_uri *uri); 65 | 66 | /* methods */ 67 | REDLAND_API 68 | unsigned char* librdf_uri_as_string (librdf_uri *uri); 69 | REDLAND_API 70 | unsigned char* librdf_uri_as_counted_string (librdf_uri *uri, size_t *len_p); 71 | REDLAND_API 72 | void librdf_uri_print (librdf_uri* uri, FILE *fh); 73 | REDLAND_API 74 | unsigned char* librdf_uri_to_string (librdf_uri* uri); 75 | REDLAND_API 76 | unsigned char* librdf_uri_to_counted_string (librdf_uri* uri, size_t* len_p); 77 | REDLAND_API 78 | int librdf_uri_equals(librdf_uri* first_uri, librdf_uri* second_uri); 79 | REDLAND_API 80 | int librdf_uri_compare(librdf_uri* uri1, librdf_uri* uri2); 81 | REDLAND_API 82 | int librdf_uri_is_file_uri(librdf_uri* uri); 83 | REDLAND_API 84 | const char* librdf_uri_to_filename(librdf_uri* uri); 85 | REDLAND_API 86 | librdf_uri* librdf_new_uri_normalised_to_base(const unsigned char *uri_string, librdf_uri* source_uri, librdf_uri* base_uri); 87 | REDLAND_API 88 | librdf_uri* librdf_new_uri_relative_to_base(librdf_uri* base_uri, const unsigned char *uri_string); 89 | REDLAND_API 90 | librdf_uri* librdf_new_uri_from_filename(librdf_world* world, const char *filename); 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif 97 | -------------------------------------------------------------------------------- /src/rdf_uri_internal.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_uri_internal.h - Internal RDF URI definitions 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | 27 | #ifndef LIBRDF_URI_INTERNAL_H 28 | #define LIBRDF_URI_INTERNAL_H 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | 35 | #if defined(LIBRDF_DEBUG) && LIBRDF_DEBUG > 1 36 | struct librdf_uri_s 37 | { 38 | librdf_world *world; 39 | unsigned char *string; 40 | int string_length; /* useful for fast comparisons (that fail) */ 41 | int usage; 42 | int max_usage; 43 | }; 44 | #else 45 | struct librdf_uri_s 46 | { 47 | librdf_world *world; 48 | unsigned char *string; 49 | int string_length; /* useful for fast comparisons (that fail) */ 50 | int usage; 51 | }; 52 | #endif 53 | 54 | /* class methods */ 55 | void librdf_init_uri(librdf_world *world); 56 | void librdf_finish_uri(librdf_world *world); 57 | 58 | /* exported public in error but never usable */ 59 | librdf_digest* librdf_uri_get_digest (librdf_world *world, librdf_uri *uri); 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /src/rdf_utf8.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * rdf_utf8.h - RDF UTF8 / Unicode chars helper routines Definition 4 | * 5 | * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | 27 | #ifndef LIBRDF_UTF8_H 28 | #define LIBRDF_UTF8_H 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | #include 35 | 36 | /** 37 | * librdf_unichar: 38 | * 39 | * Unicode codepoint. 40 | * 41 | */ 42 | typedef raptor_unichar librdf_unichar; 43 | 44 | REDLAND_API REDLAND_DEPRECATED 45 | int librdf_unicode_char_to_utf8(librdf_unichar c, unsigned char *output, int length); 46 | REDLAND_API REDLAND_DEPRECATED 47 | int librdf_utf8_to_unicode_char(librdf_unichar *output, const unsigned char *input, int length); 48 | REDLAND_API 49 | unsigned char* librdf_latin1_to_utf8_2(const unsigned char *input, size_t length, size_t *output_length); 50 | REDLAND_API 51 | unsigned char* librdf_utf8_to_latin1_2(const unsigned char *input, size_t length, unsigned char discard, size_t *output_length); 52 | REDLAND_API REDLAND_DEPRECATED 53 | unsigned char* librdf_utf8_to_latin1(const unsigned char *input, int length, int *output_length); 54 | REDLAND_API REDLAND_DEPRECATED 55 | unsigned char* librdf_latin1_to_utf8(const unsigned char *input, int length, int *output_length); 56 | REDLAND_API 57 | void librdf_utf8_print(const unsigned char *input, int length, FILE *stream); 58 | 59 | 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /src/redland.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * redland.h - Redland RDF Application Framework main header 4 | * 5 | * Copyright (C) 2000-2010, David Beckett http://www.dajobe.org/ 6 | * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | #ifndef REDLAND_H 27 | #define REDLAND_H 28 | 29 | #ifndef LIBRDF_OBJC_FRAMEWORK 30 | #include 31 | #else 32 | #include 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/win32/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST=\ 2 | README.txt \ 3 | librdf.vcproj msvc.def 4 | -------------------------------------------------------------------------------- /src/win32/README.txt: -------------------------------------------------------------------------------- 1 | This is user contributed win32 configuration for building redland 2 | using MS Windows development environments. 3 | 4 | The files here are *.vcproj and msvc.def files for MS Visual Studio 5 | 8, provided by John Barstow. 6 | 7 | The project files assume that raptor and rasqal have been installed 8 | or compiled in sibling directories, following the directory structure 9 | of the redland release. The project file may also depend on external 10 | libraries such as SleepyCat, MySQL to provide other functionality. 11 | See librdf.vcproj for the exact paths used, which can be 12 | version-number dependant. 13 | 14 | I do not test this configuration since I don't use Windows. I am 15 | happy to receive patches to fix things though. 16 | 17 | Dave 18 | 2005-05-19 19 | -------------------------------------------------------------------------------- /src/win32/msvc.def: -------------------------------------------------------------------------------- 1 | LIBRARY librdf 2 | EXPORTS 3 | librdf_version_major DATA 4 | librdf_version_minor DATA 5 | librdf_version_release DATA 6 | librdf_version_decimal DATA 7 | librdf_short_copyright_string DATA 8 | librdf_copyright_string DATA 9 | librdf_version_string DATA 10 | 11 | -------------------------------------------------------------------------------- /utils/.gitignore: -------------------------------------------------------------------------------- 1 | *.db 2 | *.o 3 | *.plist 4 | .deps 5 | .libs 6 | TAGS 7 | rdfproc 8 | rdfproc.exe 9 | rdfproc.html 10 | redland-db-upgrade 11 | redland-db-upgrade.exe 12 | redland-virtuoso-test 13 | redland-virtuoso-test.exe 14 | run* 15 | -------------------------------------------------------------------------------- /utils/Makefile.am: -------------------------------------------------------------------------------- 1 | MYSQL_UTILS=rdf-tree 2 | 3 | bin_PROGRAMS=redland-db-upgrade rdfproc 4 | 5 | if STORAGE_VIRTUOSO 6 | noinst_PROGRAMS=redland-virtuoso-test 7 | endif 8 | 9 | AM_INSTALLCHECK_STD_OPTIONS_EXEMPT=redland-db-upgrade 10 | 11 | EXTRA_PROGRAMS=$(MYSQL_UTILS) 12 | 13 | man_MANS = redland-db-upgrade.1 rdfproc.1 14 | 15 | EXTRA_DIST= rdfproc.html \ 16 | $(man_MANS) \ 17 | fix-groff-xhtml 18 | 19 | CLEANFILES=*.db $(EXTRA_PROGRAMS) *.plist 20 | 21 | AM_CPPFLAGS=@LIBRDF_INTERNAL_CPPFLAGS@ @LIBRDF_CPPFLAGS@ -I$(top_srcdir)/src @LIBRDF_EXTERNAL_CPPFLAGS@ 22 | LDADD=@LIBRDF_DIRECT_LIBS@ $(top_builddir)/src/librdf.la 23 | AM_LDFLAGS=@LIBRDF_LDFLAGS@ 24 | 25 | redland_db_upgrade_SOURCES = db_upgrade.c 26 | 27 | redland_virtuoso_test_SOURCES = redland-virtuoso-test.c 28 | redland_virtuoso_test_LDADD= @LIBRDF_DIRECT_LIBS@ @LIBRDF_LDFLAGS@ $(top_builddir)/src/librdf.la 29 | 30 | rdfproc_SOURCES = rdfproc.c 31 | if GETOPT 32 | rdfproc_SOURCES += getopt.c rdfproc_getopt.h 33 | endif 34 | 35 | ANALYZE = clang 36 | ANALYZE_FLAGS = "--analyze" 37 | # Based on COMPILE target 38 | ANALYZE_COMMAND = $(ANALYZE) \ 39 | $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ 40 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) \ 41 | $(ANALYZE_FLAGS) 42 | 43 | mysql-utils: $(MYSQL_UTILS) 44 | 45 | @MAINT@rdfproc.html: $(srcdir)/rdfproc.1 $(srcdir)/fix-groff-xhtml 46 | @MAINT@ -groff -man -Thtml -P-l $< | tidy -asxml -wrap 1000 2>/dev/null | $(PERL) $(srcdir)/fix-groff-xhtml $@ 47 | 48 | $(top_builddir)/src/librdf.la: 49 | cd $(top_builddir)/src && $(MAKE) librdf.la 50 | 51 | if MAINTAINER_MODE 52 | # Run Clang static analyzer over sources. 53 | analyze: $(SOURCES) 54 | @list='$(SOURCES)'; \ 55 | result=0; \ 56 | for file in $$list; do \ 57 | if echo $$file | grep '\.c$$' >/dev/null 2>&1; then \ 58 | $(RECHO) "Analyzing $$file"; \ 59 | $(ANALYZE_COMMAND) $(srcdir)/$$file; \ 60 | status=$$?; \ 61 | if test $$status != 0; then \ 62 | result=1; \ 63 | fi; \ 64 | fi; \ 65 | done; \ 66 | set -e; exit $$result 67 | endif 68 | -------------------------------------------------------------------------------- /utils/db_upgrade.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: c; c-basic-offset: 2 -*- 2 | * 3 | * db_upgrade.c - Upgrade a redland on-disk BDB store 4 | * 5 | * Copyright (C) 2003-2006, David Beckett http://purl.org/net/dajobe/ 6 | * Copyright (C) 2003-2004, University of Bristol, UK http://www.bristol.ac.uk/ 7 | * 8 | * This package is Free Software and part of Redland http://librdf.org/ 9 | * 10 | * It is licensed under the following three licenses as alternatives: 11 | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version 12 | * 2. GNU General Public License (GPL) V2 or any newer version 13 | * 3. Apache License, V2.0 or any newer version 14 | * 15 | * You may not use this file except in compliance with at least one of 16 | * the above three licenses. 17 | * 18 | * See LICENSE.html or LICENSE.txt at the top of this package for the 19 | * complete terms and further detail along with the license texts for 20 | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. 21 | * 22 | * 23 | */ 24 | 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #include 32 | 33 | 34 | /* one prototype needed */ 35 | int main(int argc, char *argv[]); 36 | 37 | 38 | 39 | int 40 | main(int argc, char *argv[]) 41 | { 42 | librdf_world* world; 43 | librdf_storage *storage, *new_storage; 44 | librdf_model *model, *new_model; 45 | librdf_stream *stream; 46 | char *program=argv[0]; 47 | char *name; 48 | char *new_name; 49 | 50 | if(argc < 2 || argc >3) { 51 | fprintf(stderr, "USAGE: %s: [new DB name]\n", program); 52 | return(1); 53 | } 54 | 55 | name=argv[1]; 56 | 57 | if(argc < 3) { 58 | new_name=librdf_heuristic_gen_name(name); 59 | if(!new_name) { 60 | fprintf(stderr, "%s: Failed to create new name from '%s'\n", program, 61 | name); 62 | return(1); 63 | } 64 | } else { 65 | new_name=argv[2]; 66 | } 67 | 68 | fprintf(stderr, "%s: Upgrading DB '%s' to '%s'\n", program, name, new_name); 69 | 70 | world=librdf_new_world(); 71 | librdf_world_open(world); 72 | 73 | storage=librdf_new_storage(world, "hashes", name, 74 | "hash-type='bdb',dir='.',write='no',new='no'"); 75 | if(!storage) { 76 | fprintf(stderr, "%s: Failed to open old storage '%s'\n", program, name); 77 | return(1); 78 | } 79 | 80 | new_storage=librdf_new_storage(world, "hashes", new_name, 81 | "hash-type='bdb',dir='.',write='yes',new='yes'"); 82 | if(!storage) { 83 | fprintf(stderr, "%s: Failed to create new storage '%s'\n", program, new_name); 84 | return(1); 85 | } 86 | 87 | model=librdf_new_model(world, storage, NULL); 88 | if(!model) { 89 | fprintf(stderr, "%s: Failed to create model for '%s'\n", program, name); 90 | return(1); 91 | } 92 | 93 | new_model=librdf_new_model(world, new_storage, NULL); 94 | if(!new_model) { 95 | fprintf(stderr, "%s: Failed to create new model for '%s'\n", program, new_name); 96 | return(1); 97 | } 98 | 99 | stream=librdf_model_as_stream(model); 100 | if(!stream) { 101 | fprintf(stderr, "%s: librdf_model_as_stream returned NULL stream\n", 102 | program); 103 | return(1); 104 | } else { 105 | int count = 0; 106 | while(!librdf_stream_end(stream)) { 107 | librdf_statement *statement=librdf_stream_get_object(stream); 108 | if(!statement) { 109 | fprintf(stderr, "%s: librdf_stream_next returned NULL\n", program); 110 | break; 111 | } 112 | 113 | librdf_model_add_statement(new_model, statement); 114 | 115 | librdf_stream_next(stream); 116 | count++; 117 | } 118 | librdf_free_stream(stream); 119 | fprintf(stderr, "%s: stream returned %d statements\n", program, count); 120 | } 121 | 122 | 123 | librdf_free_model(model); 124 | librdf_free_model(new_model); 125 | 126 | librdf_free_storage(storage); 127 | librdf_free_storage(new_storage); 128 | 129 | librdf_free_world(world); 130 | 131 | if(argc < 3) 132 | free(new_name); 133 | 134 | 135 | #ifdef LIBRDF_MEMORY_DEBUG 136 | librdf_memory_report(stderr); 137 | #endif 138 | 139 | /* keep gcc -Wall happy */ 140 | return(0); 141 | } 142 | -------------------------------------------------------------------------------- /utils/fix-groff-xhtml: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | # Format XHTML generated by groff -Thtml (via tidy) for websites 4 | # 5 | # Usage: groff -Thtml -P-l something.man | tidy -asxml ... | fix-groff-xhtml OUTPUT-FILE 6 | # 7 | # (C) Copyright 2003-2006 Dave Beckett 8 | # 9 | 10 | use strict; 11 | use File::Basename; 12 | 13 | my $progname=basename $0; 14 | 15 | my $raptor_title="Raptor RDF Parser Toolkit"; 16 | my $redland_title="Redland RDF Application Framework"; 17 | my $rasqal_title="Rasqal RDF Query Library"; 18 | 19 | die "USAGE: $progname OUTPUT-FILE\n" if @ARGV < 1; 20 | 21 | my $doc_title; 22 | 23 | my($file)=@ARGV; 24 | 25 | open(OUT, ">$file") or die "$progname: Cannot create $file - $!\n"; 26 | open(IN, "-"); 27 | while() { 28 | 29 | s%libraptor%$raptor_title - Raptor API%; 30 | s%

libraptor

%

$raptor_title - Raptor API

%; 31 | 32 | s%rapper%$raptor_title - Raptor RDF parser utility%; 33 | s%

rapper

%

$raptor_title - Raptor RDF parser utility

%; 34 | 35 | s%rdfproc%$redland_title - Redland RDF processor utility%; 36 | s%

rdfproc

%

$redland_title - Redland RDF processor utility

%; 37 | 38 | s%librasqal%$rasqal_title - Rasqal API%; 39 | s%

librasqal

%

$rasqal_title - Rasqal API

%; 40 | 41 | s%roqet%$rasqal_title - Rasqal RDF parser utility%; 42 | s%

roqet

%

$rasqal_title - Rasqal RDF parser utility

%; 43 | 44 | next if /^%%; 47 | 48 | # This is not xhtml 49 | s% cols="\d+" % %; 50 | 51 | s%(name|id)="([^"]+)"%my($at,$val)=($1,$2); $val =~ s/ /_/g; qq{$at="$val"};%eg; 52 | 53 | s%(Dave Beckett|Institute for Learning and Research Technology .ILRT.|University of Bristol) (?:- |)(http://[^<]+)%$1%; 54 | 55 | my $year=1900+(localtime)[5]; 56 | print OUT <<"EOT" if m%^%; 57 | 58 |

Copyright 2002-$year Dave Beckett
2002-$year University of Bristol

59 | 60 | EOT 61 | print OUT; 62 | } 63 | close(IN); 64 | close(OUT); 65 | -------------------------------------------------------------------------------- /utils/getopt.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Public Domain getopt - history below 3 | * 4 | */ 5 | 6 | /* 7 | * From: gwyn@brl-tgr.ARPA (Doug Gwyn ) Newsgroups: net.sources 8 | * Subject: getopt library routine Date: 30 Mar 85 04:45:33 GMT 9 | */ 10 | 11 | /* 12 | * getopt -- public domain version of standard System V routine 13 | * 14 | * Strictly enforces the System V Command Syntax Standard; provided by D A 15 | * Gwyn of BRL for generic ANSI C implementations 16 | * 17 | * #define STRICT to prevent acceptance of clustered options with arguments 18 | * and ommision of whitespace between option and arg. 19 | */ 20 | 21 | /* 22 | * Modified by Manuel Novoa III on 1/5/01 to use weak symbols. 23 | * Programs needing long options will link gnu_getopt instead. 24 | */ 25 | 26 | /* 27 | * Last public domain version 1.5 downloaded from uclibc CVS: 28 | * http://www.uclibc.org/cgi-bin/cvsweb/uClibc/libc/unistd/getopt.c 29 | * on 2003-02-18 by Dave Beckett and tidied: 30 | * Ran through "indent getopt.c -gnu" then fixed up the mess 31 | * Removed register - compilers are smart these days 32 | * ANSI-fied the declarations 33 | * Prefixed with rdfproc_ so that it doesn't clash with any getopt 34 | * linked in later. 35 | */ 36 | 37 | 38 | #include 39 | #include 40 | 41 | #include 42 | 43 | int opterr; /* error => print message */ 44 | int optind; /* next argv[] index */ 45 | int optopt; /* Set for unknown arguments */ 46 | char *optarg; /* option parameter if any */ 47 | 48 | /* 49 | * Err: 50 | * program name argv[0] 51 | * specific message 52 | * defective option letter 53 | */ 54 | static int 55 | Err (char *name, char *mess, int c) /* returns '?' */ 56 | { 57 | optopt = c; 58 | if (opterr) 59 | { 60 | (void) fprintf (stderr, "%s: %s -- %c\n", name, mess, c); 61 | } 62 | 63 | return '?'; /* erroneous-option marker */ 64 | } 65 | 66 | 67 | int 68 | getopt (int argc, char * const argv[], const char *optstring) 69 | { 70 | static int sp = 1; /* position within argument */ 71 | int osp; /* saved `sp' for param test */ 72 | 73 | #ifndef STRICT 74 | int oind; /* saved `optind' for param test */ 75 | #endif 76 | int c; /* option letter */ 77 | char *cp; /* -> option in `optstring' */ 78 | 79 | optarg = NULL; 80 | 81 | /* initialise getopt vars */ 82 | if (optind == 0) 83 | { 84 | optind = 1; 85 | opterr = 1; 86 | optopt = 1; 87 | optarg = NULL; 88 | } 89 | 90 | if (sp == 1) 91 | { /* fresh argument */ 92 | if (optind >= argc /* no more arguments */ 93 | || argv[optind][0] != '-' /* no more options */ 94 | || argv[optind][1] == '\0' /* not option; stdin */ 95 | ) 96 | return EOF; 97 | else if (strcmp (argv[optind], "--") == 0) 98 | { 99 | ++optind; /* skip over "--" */ 100 | return EOF; /* "--" marks end of options */ 101 | } 102 | } 103 | 104 | c = argv[optind][sp]; /* option letter */ 105 | osp = sp++; /* get ready for next letter */ 106 | 107 | #ifndef STRICT 108 | oind = optind; /* save optind for param test */ 109 | #endif 110 | if (argv[optind][sp] == '\0') 111 | { /* end of argument */ 112 | ++optind; /* get ready for next try */ 113 | sp = 1; /* beginning of next argument */ 114 | } 115 | 116 | if (c == ':' 117 | || c == '?' /* optstring syntax conflict */ 118 | || (cp = strchr (optstring, c)) == NULL) /* not found */ 119 | { 120 | return Err (argv[0], "illegal option", c); 121 | } 122 | 123 | if (cp[1] == ':') 124 | { /* option takes parameter */ 125 | #ifdef STRICT 126 | if (osp != 1) 127 | { 128 | return Err (argv[0], "option must not be clustered", c); 129 | } 130 | 131 | /* reset by end of argument */ 132 | if (sp != 1) 133 | { 134 | return Err (argv[0], "option must be followed by white space", c); 135 | } 136 | #else 137 | if (oind == optind) 138 | { /* argument w/o whitespace */ 139 | optarg = &argv[optind][sp]; 140 | sp = 1; /* beginning of next argument */ 141 | } 142 | 143 | else 144 | #endif 145 | if (optind >= argc) 146 | { 147 | return Err (argv[0], "option requires an argument", c); 148 | } 149 | 150 | else /* argument w/ whitespace */ 151 | optarg = argv[optind]; 152 | 153 | ++optind; /* skip over parameter */ 154 | } 155 | 156 | return c; 157 | } 158 | -------------------------------------------------------------------------------- /utils/rdfproc_getopt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Public Domain getopt header 3 | * 4 | */ 5 | 6 | #ifndef RDFPROC_GETOPT_H 7 | #define RDFPROC_GETOPT_H 8 | 9 | int getopt(int argc, char * const argv[], const char *optstring); 10 | extern char *optarg; 11 | extern int optind, opterr, optopt; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /utils/redland-db-upgrade.1: -------------------------------------------------------------------------------- 1 | .\" Hey, EMACS: -*- nroff -*- 2 | .\" 3 | .\" redland-db-upgrade.1 - Redland database upgrade utility manual page 4 | .\" 5 | .\" Copyright (C) 2003-2006 David Beckett - http://purl.org/net/dajobe/ 6 | .\" Copyright (C) 2003 University of Bristol - http://www.bristol.ac.uk/ 7 | .\" 8 | .TH redland-db-upgrade 1 "2003-08-19" 9 | .\" Please adjust this date whenever revising the manpage. 10 | .SH NAME 11 | redland-db-upgrade \- upgrade older Redland databases to 0.9.12 format 12 | .SH SYNOPSIS 13 | .B redland-db-upgrade 14 | \fIold BDB Name\fP \fInew BDB name\fP 15 | .SH DESCRIPTION 16 | \fIredland-db-upgrade\fP converts Redland databases from the format 17 | in 0.9.11 and earlier into the new format. It must be run on 18 | each Redland database. For example if database \fIa\fP 19 | created files \fIa-sp2o.db\fP, \fIa-so2p.db\fP and \fIa-po2s.db\fP 20 | it could be converted to a new database \fIb\fP with: 21 | .IP 22 | redland-db-upgrade a b 23 | .SH SEE ALSO 24 | .BR redland (3), 25 | .SH AUTHOR 26 | Dave Beckett - 27 | .UR http://purl.org/net/dajobe/ 28 | http://purl.org/net/dajobe/ 29 | .UE 30 | --------------------------------------------------------------------------------