Raptor
is a free software / Open Source C library that provides
a set of parsers and serializers that
generate Resource Description Framework (RDF) triples
by parsing syntaxes or serialize the triples into a syntax.
The supported parsing syntaxes are RDF/XML, N-Quads, N-Triples 1.0
and 1.1, TRiG, Turtle 2008 and 2013, RDFa 1.0 and 1.1, RSS tag soup
including all versions of RSS, Atom 0.3 and Atom 1.0, GRDDL and
microformats for HTML, XHTML and XML. The serializing syntaxes are
RDF/XML (regular, abbreviated, XMP), Turtle 2013, N-Quads, N-Triples
1.1, Atom 1.0, RSS 1.0, GraphViz DOT, HTML, JSON and mKR.
Raptor was designed to work closely with the
Redland RDF library
(RDF Parser Toolkit for Redland)
but is entirely separate. It is a portable library that works
across many POSIX systems (Unix, GNU/Linux, BSDs, OSX, cygwin, win32).
A summary of the changes can be found in the
NEWS file,
detailed API changes in the release notes
and file-by-file changes in the ChangeLog.
Details of upgrading from Raptor 1 as described in the
Upgrading document.
A parser for the
RDF 1.1 N-Quads - A line-based syntax for an RDF datasets, W3C Candidate Recommendation, 05 November 2013.
This is an extension to N-Triples, providing an optional 4th context
graph term at the end of the line when a triple is associated with a
named graph.
The parser does not support the entire 1.1 TRiG specification; the
'{' ... '}' around a graph and the GRAPH keyword may not
be omitted.
RSS "tag soup" parser
A parser for the multiple XML RSS formats that use the elements
such as channel, item, title, description in different ways.
Attempts to turn the input into
RSS 1.0
RDF triples. True RSS 1.0,
as a full RDF vocabulary, is best parsed by the RDF/XML parser.
It also generates triples for RSS enclosures.
This parser also provides support for the Atom 1.0 syndication
format defined in IETF
RFC 4287
as well as the earlier Atom 0.3.
GRDDL and microformats parser
A parser/processor for
Gleaning Resource Descriptions from Dialects of Languages (GRDDL)
syntax, W3C Recommendation of 2007-09-11 which allows reading XHTML
and XML as RDF triples by using profiles in the document that declare
XSLT transforms from the XHTML or XML content into RDF/XML or other
RDF syntax which can then be parsed. It uses either an XML or
a lax HTML parser to allow HTML tag soup to be read.
The parser passes the all the GRDDL tests as of Raptor 1.4.16.
The parser also handles hCard and hReview using public XSL sheets.
RDFa parser
A parser for
RDFa 1.0
(W3C Recommendation 14 October 2008) and
RDFa 1.1
(W3C Recommendation 07 June 2012)
implemented via librdfa
linked inside Raptor. librdfa was, written primarily by Manu Sporny
of Digital Bazaar and is licensed with the same license as Raptor.
A serializer to the standard
RDF/XML syntax
as revised by the
W3C RDF Core working group
in 2004. This writes a plain triple-based RDF/XML serialization with
no optimisation or pretty-printing.
A second serializer is provided using several of the RDF/XML
abbreviations to provide a more compact readable format, at the cost
of some pre-processing. This is suitable for small documents.
N-Quads Serializer
A serializer for the
RDF 1.1 N-Quads -A line-based syntax for an RDF datasets, W3C Candidate Recommendation, 05 November 2013.
This is an extension to N-Triples, providing an optional 4th context
graph term at the end of the line when a triple is associated with a
named graph.
The public API is described in the
libraptor.3 UNIX manual page.
It is demonstrated in the
rapper
utility program which shows how to call the parser and write
the triples in a serialization. When Raptor is used inside
Redland,
the Redland documentation explains
how to call the parser and contains several example programs.
There are also further examples in the example directory
of the distribution.
raptor2-2.0.16/README 0000644 0001750 0001750 00000017234 14377546403 011016 0000000 0000000 #DOAP
Raptor RDF Syntax Library
Dave Beckett
Overview
Raptor is a free software / Open Source C library that provides a set
of parsers and serializers that generate Resource Description Framework
(RDF) triples by parsing syntaxes or serialize the triples into a
syntax. The supported parsing syntaxes are RDF/XML, N-Quads, N-Triples
1.0 and 1.1, TRiG, Turtle 2008 and 2013, RDFa 1.0 and 1.1, RSS tag soup
including all versions of RSS, Atom 0.3 and Atom 1.0, GRDDL and
microformats for HTML, XHTML and XML. The serializing syntaxes are
RDF/XML (regular, abbreviated, XMP), Turtle 2013, N-Quads, N-Triples
1.1, Atom 1.0, RSS 1.0, GraphViz DOT, HTML, JSON and mKR.
Raptor was designed to work closely with the Redland RDF library (RDF
Parser Toolkit for Redland) but is entirely separate. It is a portable
library that works across many POSIX systems (Unix, GNU/Linux, BSDs,
OSX, cygwin, win32).
A summary of the changes can be found in the NEWS file, detailed API
changes in the release notes and file-by-file changes in the ChangeLog.
Details of upgrading from Raptor 1 as described in the Upgrading
document.
* Designed to integrate well with Redland
* Parses content on the web if libcurl, libxml2 or BSD libfetch is
available.
* Supports all RDF terms including datatyped and XML literals
* Optional features including parsers and serialisers can be selected
at configure time.
* Language bindings to Perl, PHP, Python and Ruby when used via
Redland
* No memory leaks
* Fast
* Standalone rapper RDF parser utility program
Known bugs and issues are recorded in the Redland issue tracker or at
GitHub issues for Raptor.
Parsers
RDF/XML Parser
A Parser for the standard RDF/XML syntax.
* Fully handles the RDF/XML syntax updates for XML Base, xml:lang,
RDF datatyping and Collections.
* Handles all RDF vocabularies such as FOAF, RSS 1.0, Dublin Core,
OWL, DOAP
* Handles rdf:resource / resource attributes
* Uses libxml XML parser
N-Quads Parser
A parser for the RDF 1.1 N-Quads - A line-based syntax for an RDF
datasets, W3C Candidate Recommendation, 05 November 2013. This is an
extension to N-Triples, providing an optional 4th context graph term at
the end of the line when a triple is associated with a named graph.
N-Triples Parser
A parser for the RDF 1.1 N-Triples - A line-based syntax for an RDF
graph, W3C Candidate Recommendation, 05 November 2013 (aka N-Triples
2013) based on the older N-Triples.
Turtle Parser
A parser for the Turtle Terse RDF Triple Language W3C Candidate
Recommendation, 19 February 2013 based on earlier work Turtle Terse RDF
Triple Language (2004)
TRiG Parser
A parser for the RDF 1.1 TriG RDF Dataset Language.
The parser does not support the entire 1.1 TRiG specification; the '{'
... '}' around a graph and the GRAPH keyword may not be omitted.
RSS "tag soup" parser
A parser for the multiple XML RSS formats that use the elements such as
channel, item, title, description in different ways. Attempts to turn
the input into RSS 1.0 RDF triples. True RSS 1.0, as a full RDF
vocabulary, is best parsed by the RDF/XML parser. It also generates
triples for RSS enclosures.
This parser also provides support for the Atom 1.0 syndication format
defined in IETF RFC 4287 as well as the earlier Atom 0.3.
GRDDL and microformats parser
A parser/processor for Gleaning Resource Descriptions from Dialects of
Languages (GRDDL) syntax, W3C Recommendation of 2007-09-11 which allows
reading XHTML and XML as RDF triples by using profiles in the document
that declare XSLT transforms from the XHTML or XML content into RDF/XML
or other RDF syntax which can then be parsed. It uses either an XML or
a lax HTML parser to allow HTML tag soup to be read.
The parser passes the all the GRDDL tests as of Raptor 1.4.16.
The parser also handles hCard and hReview using public XSL sheets.
RDFa parser
A parser for RDFa 1.0 (W3C Recommendation 14 October 2008) and RDFa 1.1
(W3C Recommendation 07 June 2012) implemented via librdfa linked inside
Raptor. librdfa was, written primarily by Manu Sporny of Digital Bazaar
and is licensed with the same license as Raptor.
As of Raptor 2.0.8 the RDFa parser passes all of the RDFa 1.0 test
suite except for 4 tests and all of the RDFa 1.1 test suite except for
30 tests.
Serializers
RDF/XML Serializer
A serializer to the standard RDF/XML syntax as revised by the W3C RDF
Core working group in 2004. This writes a plain triple-based RDF/XML
serialization with no optimisation or pretty-printing.
A second serializer is provided using several of the RDF/XML
abbreviations to provide a more compact readable format, at the cost of
some pre-processing. This is suitable for small documents.
N-Quads Serializer
A serializer for the RDF 1.1 N-Quads -A line-based syntax for an RDF
datasets, W3C Candidate Recommendation, 05 November 2013. This is an
extension to N-Triples, providing an optional 4th context graph term at
the end of the line when a triple is associated with a named graph.
N-Triples Serializer
A serializer for the RDF 1.1 N-Triples - A line-based syntax for an RDF
graph (aka N-Triples 2013) based on the earlier N-Triples syntax as
used by the W3C RDF Core working group for the RDF Test Cases.
Atom 1.0 Serializer
A serializer to the Atom 1.0 syndication format defined in IETF RFC
4287.
JSON Serializers
Two serializers for to write triples encoded in JSON:
1. json: in a resource-centric abbreviated form like Turtle or
RDF/XML-Abbreviated as defined by: RDF 1.1 JSON Alternate
Serialization (RDF/JSON), W3C Working Group Note, 07 November 2013
2. json-triples: a triple-centric format based on the SPARQL results
in JSON format.
JSON-LD is not supported - too complex to implement.
GraphViz DOT Serializer
An serializer to the GraphViz DOT format which aids visualising RDF
graphs.
RSS 1.0 Serializer
A serializer to the RDF Site Summary (RSS) 1.0 format.
Turtle Serializer
A serializer for the Turtle Terse RDF Triple Language W3C Candidate
Recommendation, 19 February 2013
XMP Serializer
An alpha quality serializer to the Adobe XMP profile of RDF/XML
suitable for embedding inside an external document.
mKR Serializer
A serializer for the mKR (my Knowledge Representation) Language
Documentation
The public API is described in the libraptor.3 UNIX manual page. It is
demonstrated in the rapper utility program which shows how to call the
parser and write the triples in a serialization. When Raptor is used
inside Redland, the Redland documentation explains how to call the
parser and contains several example programs. There are also further
examples in the example directory of the distribution.
To install Raptor see the Installation document.
Sources
The packaged sources are available from
http://download.librdf.org/source/ (master site) The development GIT
sources can also be browsed at GitHub or checked out at
git://github.com/dajobe/raptor.git
License
This library is free software / open source software released under the
LGPL (GPL) or Apache 2.0 licenses. See LICENSE.html for full details.
Mailing Lists
The Redland mailing lists discusses the development and use of Raptor
and Redland as well as future plans and announcement of releases.
__________________________________________________________________
Copyright (C) 2000-2023 Dave Beckett
Copyright (C) 2000-2005 University of Bristol
raptor2-2.0.16/RELEASE.html 0000644 0001750 0001750 00000527715 14377546071 012117 0000000 0000000
Raptor RDF Syntax Library - Release Notes
CVE-2017-18926
fixed in commit 590681e546cd9aa18d57dc2ea1858cb734a3863f
CVE-2020-25713
fixed in commit 4f5dbbffcc1c6cf0398bd03450453289a0979dea
Issues Fixed:
0000600: Can't compile on Cygwin: sort_r.h "Cannot detect operating system"
0000606: "JSON" format outputs invalid Unicode escapes
0000617: heap buffer overflow in raptor_qname_format_as_xml
0000618: heap buffer overflow in raptor_xml_writer_start_element_common
0000650: Out of bounds read leads to segfault in raptor_xml_writer_start_element_common
0000652: Manpage for the rapper utility describes the wrong Atom version
Parser changes
The Turtle parser was improved to process input in chunks, rather
than all in one step (with a large memory buffer). This allows
Turtle to read and parse files much larger than the system memory; it
splits the inputs after the end of a turtle "sentence" that ends in a
.. Includes memory usage minimizing with AVLTree
pruning during serializing and addition of turtle serializer flush
implementation.
This improvment across multiple patches was contributed by
Sebastian Freundt. Thanks
Pull Request #37Pull Request #38
Turtle parser improvements for Bison 3+ and removing deprecated or
older style directives.
Thanks to fix from Akim DemaillePull Request #43
Turtle parser fixes for cleaning up va_arg on failure paths.
[coverity CID 343351]
grddl parser: fix leak on failure paths of WWW model methods
[coverity CID 343353]
XML writer calculate max nspace declarations correctly.
Fixes Issues
#0000617
and
#0000618
JSON writer changed to write UTF-8 for JSON literals
Add RAPTOR_ESCAPED_WRITE_BITFLAG_UTF8 to
RAPTOR_ESCAPED_WRITE_JSON_LITERAL
Fixes Issue
#0000606
rdfxmla serializer was fixed to handle leak of iter object on some
failure pathes. [coverity CID 343354] [coverity CID 343358]
Fix for RSS 1.0 serializing default namespaces.
Writer changes
XML Writer: compare namespace declarations correctly. Applied a patch from
0001-CVE-2020-25713-raptor2-malformed-input-file-can-lead.patch.1
that fixes
Issue #0000650
which overwrote heap during XML writing in parse type literal
content. This was detected with clang asan. Thanks to fix from Michael Stahl
/ mst2.
Build and portability fixes
CMake fixes
Fix cmake builds for time.h check change, generated pc file.
Thanks to fix from Artturin.
Pull Request #52
Multiple fixes for Appveyor's Windows build using CMake
Thanks to fix from 0u812.
Multiple fixes for Cmake build system to allow building from
source including running flex, bison and running the tests.
Thanks to fix from 0u812.
Made Raptor build again with CMake under Windows via CI as a
service Appveyor. The resulting binaries and libraries were not
tested.
Remove and fix obsolete autoconf: AC_PROG_LEX AC_HEADER_TIME AC_HEADER_STDC.
Update bison check to find first new enough GNU bison
Fix configure.ac -Wimplicit-function-declaration in
HAVE___FUNCTION__ test to provide Clang 16 support. Fix
from Sam James, thanks.
Support newer ICU UC version (>=56) for newer NFC check
interface unorm2_quickCheck()..
Several minor fixes and workarounds for clang ASAN warnings or
false warnings - not able to understand raptor's reference model.
Updated fix-flex.pl script for newer flex naming conventions.
Portability fixes found with GCC 10 and newer compilers for wrong
error message callbacks in turtle and grddl parsers
Later, updated to make bison 3.4 the minimum.
Update turtle parser and support scripts to work with Bison 3.0.5
Patch contributed by Adam Novak. Thanks.
Pull Request #39
Fix GNUInstallDirs for install paths to be able to install
libraptor2.a and raptor2.pc to a specific directory when
cross-compiling. Thanks to fix from
Eric Le Lay.
Pull Request #36
Made some code changes to quiet GCC extra warnings.
Portability fixes for OpenBSD
Some portability for building under cygwin by Richard
H. McCullough while developing the mkr serializer.
Portability fixes in the raptor2.spec file.
Thanks to fix by philjohn
Enable pkg-config to work when cross-building such as
with yocto. Thanks to fix by Andreas Müller.
Use only pkgconfig for libxslt and ICU UC. Patches from Hugh
McMaster. Thanks.
Updated Travis configuration to try builds across a wider range of
compilers and with clang ASAN enabled.
Other changes
Handle deleting empty avltree. Fixes invalid pointer reference
reported by Li Qiang via email. Thanks.
Change rapper(1) utility to count in longs instead of
ints. Because: billions and billions of triples. Thanks to patch
from Jerven Bolleman.
Accept cygwin as a Linux-like.
Fixes Issue #0000600.
Mention Atom 0.3 in docs and manual page
Fixes Issue #0000652.
Check curl_easy_setopt() return values for errors In
several places check for curl_easy_setopt() erorr
returns and fail. [coverity CID 343360]
Fixed internal ICU string NFC check to convert to UTF-16 first
before trying to do a NFC normalization check. This allows returning
an error response.
raptor_uri_counted_filename_to_uri_string() fix to
copy NUL when copying the file://code prefix. Coverity
false positive since the following lines of code always add more
characters and a NUL. "Fixes" [Coverity CID 353858]
This release mainly made general bug fixes as well as several
fixes to the Turtle / N-Triples family of parsers and serializers. It
added utility functions for re-entrant sorting of objects and
sequences and a few other useful methods.
0000576: Wrong assert for a counted string being nul terminated
0000577: iri parsing does not conform to REC-n-quads-20140225
0000579: raptor_world_generate_bnodeid accepts world not parser
0000581: My patch for parser and serializers count
0000584: raptor fails to parse trig files with dos line endings
Parser changes
Fixed raptor_grddl_filter_triples() check for three
URIs which has been broken since 2007 but just did more work. Found
via gcc5 warning.
The TRiG parser now accepts \r newlines between the graph name and
the following '{'.
Fixes Issue #0000584
Turtle, TRiG, N-Triples and N-Quads parsers now check escapes
correctly for URI strings. \t \b \n \r \f are forbidden. Check that
raw ' ' or \u0020, \u003C or \u003E are also not accepted.
Fixes Issue #0000577
N-Triples / N-Quads parsers nwo accept '_' as an alias for '-' in
lang strings. '_' is not legal.
Fixes Issue #0000574
Updated RDFa parser (librdfa) to support full URLs for
typeof from upstream. Re-checked several tests which
have been passing for some time but the expected output was not a
correct conversion from the testsuite sparql.
Serializer changes
Turtle serializer now writes () instead of
rdf:nil via
Pull Request #16
from Richard H. McCullough. Thanks!
I/O-stream class changes
raptor_iostream_decimal_write() and
raptor_iostream_hexadecimal_write now return non-0 if
they do not succeed in writing successfully.
Fixes Issue #0000575
Term class changes
raptor_new_term_from_blank() now also accepts "" as
the same as a NULL blank node ID argument.
URI class changes
Fixed raptor_uri_counted_filename_to_uri_string() to
use the passed in len, not look for end NUL char and count lengths.
Fixes Issue #0000576.
raptor_new_uri_from_counted_string() no longer
assumes a NUL terminated string. Remove a debug assert and use
fwrite() to emit the counted URI string to the debug
file handler.
Fixed raptor_uri_normalize_path() to check the size of
output buffer is big enough.
Writer class changes
Fixed raptor_turtle_writer_quoted_counted_string() to
use the passed in length, drop the strlen() call and use
the length internally.
Fixes Issue #0000576.
World class changes
Added raptor_world_get_parsers_count()
and raptor_world_get_serializers_count()
with patch from Victor Porton. Thanks!
Fixes Issue #0000581.
Other Changes
Made raptor work with Travis CI again; have to download and
install Bison 3.
Added raptor_sort_r() and
raptor_sequence_sort_r() re-entrant sort utility methods
based on the public domain sort_r code by Isaac
Turner.
Ensure raptor_locator_format() always adds a NUL to
terminate the output string.
Fix a -99 <= var <= 99 timezone interval check. Thanks to
Richard Trieu for the report.
Improve configure warning check using AC_LANG_WERROR
Use C99 __FUNCTION__ replacing __func__
from C90.
Improve build-time flex and bison output to be more silent.
Added Intel C compiler (icc) support from Sebastian Freundt
(hroptatyr on GitHub) - Thanks.
The N-Triples / N-Quads parser was updated to allow ' in URIs.
Fixes Issue #0000562.
Configuration changes
Use the discovery of the xml2-config(1) /
curl-config(1) programs as test for presence of the
libraries. This fixes the issue where that after configuring, curl
was present but was not used for WWW fetching. This is seen when
the output of curl-config --cflags is empty / whitespace.
Updated to use the AC_CHECK_PROGS macro to find jing
since AC_CHECK_PROG doesn't default to setting it as
found when present!
Internal changes
The Turtle and parsedate parsers and the turtle lexer were updated
to use and require Bison 3.0.0.
The JSON and turtle writers were updated to save several expensive
strlen() calls.
handle a single short document with no end of line
support NULs inside literals
handle unescaped newlines inside literals
Term class changes
Added raptor_new_term_from_counted_string() to
create a term from a Turtle or N-Triples string syntax. This is
the opposite of raptor_term_to_turtle_counted_string()
and raptor_term_to_turtle_string() and also reads the
strings created by raptor_term_to_counted_string() and
raptor_term_to_string().
0000556: Problem with relative URI in rdf:about, rdf:resource etc.
0000554: RDF/XML serializer does not canonicalize attribute order in XMLLiterals
Parser changes
N-Triples parser was updated to support all of
RDF 1.1
N-Triples - A line-based syntax for an RDF graph (aka N-Triples 2013)
It now supports # comments after the end of
lines, checks for illegal unicode escapes, checks for bad URIs and
checks language tags.
Also removed support for legacy N-Triples
"foo"-LANGTOKEN.
Many internal changes were also made.
RDF/XML parser fixed the XML Canonicalization so that it writes
the XML attributes in sorted order.
Fixes
Issue #0000554.
URI class changes
Added raptor_uri_uri_string_is_absolute() to
check if a URI is absolute.
QName class changes
Added raptor_qname_format_as_xml() to turn a qname
into an XML declaration.
Configuration and build changes
Restructured code to build an internal librdfa convenience library
(never installed) so that newer automake will stop moaning about
subdir-objects.
configure now checks for clang to correctly find
supported warnings.
Various portability and build fixes (Daniel Richard G)
Build fixes: make check will now work if jing is not
installed (for feed XML generation validation).
Other changes
Fixed a few issues found with LLVM 3.4 (SVN) run with address
sanitizing.
0000548: xml:lang inside rdf:parseType="Literal" are removed in parsed output
Parser changes
Turtle parser was updated to handle
Turtle Terse RDF Triple Language W3C Candidate Recommendation 19 February 2013
(Turtle 2013)
The main changes were to align with SPARQL-style blank node names,
prefixes and local names.
N-Triples parser was updated to handle
N-Triples - A line-based syntax for an RDF graph W3C Working Group Note 09 April 2013 (N-Triples 2013)
The main changes were to allow \b \f, UTF-8 in strings and
URIs and the SPARQL-style blank node names.
RDF/XML parser updated to understand the new RDF 1.1 datatypes:
rdf:HTML and rdf:langString
Serializer changes
Updated N-Triples and Turtle serializers (via writers) for 2013
versions based on SPARQL 1.1 definitions. These new formats
have incompatible changes.
Added functions for writing escaped Turtle / N-Triples terms:
int raptor_string_escaped_write(const unsigned char *string,
size_t len, const char delim, unsigned int flags, raptor_iostream *iostr);
int raptor_term_escaped_write(const raptor_term *term, unsigned int flags,
raptor_iostream* iostr);
int raptor_uri_escaped_write(raptor_uri* uri, raptor_uri* base_uri,
unsigned int flags, raptor_iostream *iostr);
These uses the new new raptor_escaped_write_bitflags
enum bitflag values for the flags argument.
Deprecated raptor_string_python_write() for
raptor_string_escaped_write() with flags.
Configuration and build changes
configure now recommends flex 2.5.36
configure was updated to switch configuring libxml
and libcurl to use the PKG_PROG_PKG_CONFIG and
PKG_CHECK_MODULES macros. The preference remains to
prefer looking for the xml2-config and curl-config programs before
trying pkg-config unless --with-curl-config=no--with-xml2-config=no are used.
configure now dies if xml2-config or xslt-config
point at non executable files. Patch from Michael Stahl - thanks.
Fixes Issue #0000534
configure now adds curl or libxml pkg-config requires
only if they were found via pkg-config; this prevents unnecessary
dependency on pkg-config files if they are not needed.
Updated autogen.sh and code to handle variations of header
macro.
Fixes Issue #0000532
This includes accepting new keywords from SPARQL
(BASE and PREFIX), triples forms and
details of the characters allowed in URIs, Literals, Prefix Names,
Local Names and Blank Node identifiers. Some existing documents that
used \-escapes in URIs to encode characters not allowed
in URIs, are now forbidden. For example ASCII 32 (0x20) - space,
which should be written as %20.
Serializer changes
Turtle Serializer: Added full support for
Turtle Terse RDF Triple Language W3C Candidate Recommendation 19 February 2013
which particular effects the encoding of URIs in the serializer.
Configuration and build changes
Added CMake build framework for building Raptor on Microsoft
Windows. Removed the old win32/ area and
win32_raptor_config.h references. Contributed by Daniel
Richard G. for Teragram Inc.
Ensure that a small system BUFSIZ does not affect parser guessing
Patch from Daniel Richard G for Teragram Inc.
Added a compile-time check for
raptor_world_guess_parser_name() to ensure that
RAPTOR_READ_BUFFER_SIZE is at least as large as
FIRSTN, because otherwise the guesser sees fewer than
FIRSTN bytes from the document. Patch from Daniel
Richard G for Teragram Inc.
Update configure to allow xml2-config and curl-config
to work for libxml and libcurl. It now report on the source of xml, curl
libraries in the configuration status.
autogen.sh updates to abort the run if a configuring
program fails, Generate NEWS with old timestamp if missing so
automake can run.
raptor_www_set_ssl_verify_options() now supports the
Curl 7.28.1 removal of CURLOPT_SSL_VERIFYHOST with a
value of 2. Now verify_host non-0 means to verify CN, 0
means to not verify.
Remove -m MODE from the rapper(1) help
message which was removed in commit
f94fa561db05b21132b14a2b72f05b77e666c252 on Wed Apr 28 21:31:54 2010
-0700 as part of the Raptor V2 work.
Guessing a parser with
raptor_world_guess_parser_name() now returns NULL failure
when the guess is very poor, rather just return the first bad result.
Fixes
Issue #0000487
which was reported in Redland librdf but
is implemented here.
Guess parser: now returns error file and line location information
from the guessed parser.
RDFa parser: Updated librdfa
to the latest GIT supporting
RDFa 1.1
with 30 tests still not passing - mostly issues in the core librdfa.
Made several resilience and crash fixes. Updated the RDFa 1.0 test
suite to latest tests and made fixes. The RDFa parser now accepts
aliases 'rdfa10', 'rdfa11' and the default 'rdfa' is RDFa 1.1
RSS tag soup parser: Use time() when
gettimeofday() is not available. Fix several reference
leaks.
RDF/XML parser: The range of RDF/XML entity recognizing heuristic was
broadened to allow recognition of documents produced by Stanford's
Protege software (and possibly others). Fixed some parser memory
leaks / double frees.
Turtle parser: Do not report multiple errors for Turtle string decoding
problems. When a Turtle qname cannot be found, a fatal error is no
longer generated but a regular error message giving information on
the qname that failed (usually due to unknown prefix).
Fixes Issue #0000507
SAX2 API changes
raptor_sax2_inscope_xml_language() will now return ""
for explicit no language (xml:lang="") as well as NULL
for undefined language (no xml:lang present).
Serializer class changes
Turtle: Do not emit a Turtle (...) collection if the
list item is a URI. This fixes
Issue #0000381.
Term class changes
Added raptor_term_to_turtle_counted_string() counted
string form of raptor_term_to_turtle_string.
Unicode class changes
raptor_unicode_utf8_string_put_char() and
raptor_unicode_utf8_string_get_char()
now allow reading / writing U+D800 to U+DFFF (UTF-16 surrogates).
rather than returning failure. BOMs remain forbidden - definitely not UTF-8.
Fixes Issue #0000505
URI class changes
Fixed URI resolving with reference (relative) URIs that are bare
queries like '?y' with no path. Now matches the specification
RFC3986 section 5.4.1 Normal Examples.
Added raptor_new_uri_relative_to_base_counted()
to construct URI relative to current base.
Added raptor_uri_to_turtle_counted_string() counted
string form of raptor_uri_to_turtle_string.
WWW class changes
The Curl WWW implementation now interprets
Content-Locationcode> header as absolute or relative URI.
Configuration and build changes
All configure --with-foo options now handle --without-foo (and
--with-foo=no) to disable attempting to find the value in the PATH.
This can be used with --with-xml2-config, --with-xslt-config,
--with-curl-config, --with-icu-config and --with-libwww-config where
the value 'no' or --without-foo can be used to disable it and prevent
automatic searches for the config script in the PATH.
The -DRAPTOR_DEBUG and -DMAINTAINER_MODE
flags are now written to the config header instead of added to
CPPFLAGS.
The -g flag is no longer added to CFLAGS or CPPFLAGS
with --enable-debug.
The existing --disable-release (default) now
correctly removes -O options in flag variables for the maintainer.
autogen.sh now looks for the environment variable
NOCONFIGURE to prevent it running configure at the end
of the auto generation run.
The configure vsnprintf() check was made more
comprehensive.
Other changes
Multiple portability improvements to vsnprintf code and macros.
Also fixed uninitialized variable problems in non-c99 variant of
raptor_vsnprintf2(). Thanks to John Emmas for reporting.
Multiple portability fixes for building out of the source tree.
Out of source tree 'make check' and 'make dist' should both work.
Thanks to Daniel Richard G. for the patches.
Multiple portability fixes for building on old Solaris versions.
Thanks to Daniel Richard G. for the patches.
Multiple portability fixes for building on Windows including
strcasecmp(), windows headers, configuration fixes, parsedate code,
URI test builds, vsnprintf building. Thanks to Daniel Richard G.
for the patches.
Updated the example rdfguess to accept a file called
or no arguments to read from stdin.
0000448: Turtle parser does not return error status from turtle_parse_chunk()
0000469: Allow rapper to bypass server SSL certs checks in libcurl
Removed Expat support since expat has not had a release in years
and libxml2 works well. This allows some code simplification.
Updated configure so that if Raptor is configured with
no parser that requires an XML parser, libxml2 will not be required.
Removed internal Unicode NFC checking code used for checking
RDF/XML literals conformance which was expensive to check and a large
of compiled-in static dataset that was rather out of date. Replaced
with optional compiled use of ICU.
If ICU is not explicitly configured, no literal checking is done.
Options changes
Added new options:
RAPTOR_OPTION_NO_FILE
Deny file requests during parsing. Enabled by default.
RAPTOR_OPTION_LOAD_EXTERNAL_ENTITIES
Allow loading of XML external entity loading. Disabled by
default.
RAPTOR_OPTION_WWW_SSL_VERIFY_PEER
Controls verifying an SSL peer during parsing / WWW. Takes an
integer value: non-0 to verify peer SSL certificate (default
1).
RAPTOR_OPTION_WWW_SSL_VERIFY_HOST
Controls verifying an SSL host during parsing / WWW. Takes an
integer value: 0 none, 1 CN match, 2 host match (default). Other
values are ignored.
Parser class changes
The RDF/XML, RSS Tag Soup and RDFa parsers now pass on network,
file and entity loading parser options to the internal SAX2 to enable
enforcing of network, file and entity loading policy.
RDF/JSON parser handles an API change between YAJL V1 and V2.
Turtle parser now returns parser errors to
raptor_parse_chunk().
Fixes Issue #0000488
SAX2 class changes
Added raptor_sax2_set_uri_filter() to set a URI
filter for any SAX2 calls that do internal lookups of URIs.
Control file and network loading inside SAX2. Option
RAPTOR_OPTION_LOAD_EXTERNAL_ENTITIES now enforces
loading external XML entities and is by default enabled. If enabled,
RAPTOR_OPTION_NO_FILE and
RAPTOR_OPTION_NO_NET are also checked. All URIs loaded
are also passed through any URI filter, if set by
raptor_sax2_set_uri_filter().
URI class changes
Added new URI constructor
raptor_new_uri_from_uri_or_file_string()
to build a URI from a URI string or a filename string, normalizing
the result to a file: URI.
Added
raptor_uri_uri_string_to_counted_filename_fragment() to
turn a URI string to a filename and URI fragment along with string
output string counts.
Added utility methods for checking if a file: URI or filename is a
file that exists:
raptor_uri_file_exists() and
raptor_uri_filename_exists()
WWW class changes
Added raptor_www_set_ssl_verify_options() to set SSL
verify options.
Fixes Issue# 0000469.
The raptor_www_fetch() call now returns the status
from any URI filter that returns a non-0 response.
Build changes
Added --with-icu-config=PATH option
to enable use of ICU for NFC checking.
Requires automake 1.11.2+ for -Wextra-portability
configure uses AM_PROG_AR to make
automake -Wextra-portability happy.
Handle libCurl SSL options before 7.16.4 (that's 2007) since old
libcurl is still around on Enterprise (that means old) linux systems.
Sequence Changes
Added utility functions to swap elements, reverse the sequence and
generate permuations:
int raptor_sequence_swap(raptor_sequence* seq,
int i, int j);
int raptor_sequence_reverse(raptor_sequence* seq,
int start_index, int length);
int raptor_sequence_next_permutation(raptor_sequence *seq,
raptor_data_compare_handler compare);
0000476: Add Format URIs to raptor_syntax_descriptions
0000479: raptor 2.0.4 : -i nquads fails to treat the context term as optional bugs.librdf.org
0000481: Invalid unicode characters cause raptor to emit infinite output while converting n-quads to n-triples
Parser class changes
Updated all parser URIs to use the
W3C Format URIs
as the primary URIs. Existing URIs become aliases. (Nicholas J Humfrey)
GRDDL parser: Correctly set the base_uri when resolving the
sheet URI.
N-Quads parser: Make context optional. (Lauri Aalto)
Fixes
Issue #0000479.
When guessing formats, make N-Quads always beat N-Triples since
since now all ntriples parse fine with the nquads parser. (Lauri Aalto)
RDFA parser: fix when building with 64-bit systems to prevent
value truncation.
Turtle parser: now uses the official text/turtle mime
type in the syntax recognizing code.
Serializer class changes
Updated all serializer URIs to use the
W3C Format URIs
as the primary URIs. Existing URIs become aliases. (Nicholas J Humfrey)
Turtle serializer now uses the official text/turtle mime
type in the syntax recognizing code.
Do not generate infinite output when the input Unicode UTF-8 encoding
is bad.
Fixes Issue #000481.
Unicode class changes
Added new utility functions for calculating number of Unicode
characters in a UTF-8
string raptor_unicode_utf8_strlen() and getting a subset
of a UTF-8 string raptor_unicode_utf8_substr():
int raptor_unicode_utf8_strlen(const unsigned char *string,
size_t length);
size_t raptor_unicode_utf8_substr(
unsigned char* dest, size_t* dest_length_p,
const unsigned char* src, size_t src_length,
int startingLoc, int length);
URI class changes
raptor_uri_string_to_relative_uri_string() now
compares URI paths not files. (Joe Presbrey)
Fixes Issue #0000472
Build changes
The library no longer needs trunc(),
lround(), round() or anything else from
libm. Removed the checks for these functions from
configure.
configure no longer enables debug messages by default
for --enable-maintainer-mode but now requires the
--enable-debug option to be given.
Other changes
Records GIT version in the version string when building from GIT
sources with --enable-maintainer-mode. This makes it
clearer when an non-released version is being used.
Added internal raptor_format_integer() which enabled
the removal of all internal use of snprintf().
Added raptor_vsnprintf2() deprecating
raptor_vsnprintf() which does not actually have the
vsnprintf() calling contention. Added raptor_snprintf()
with snprintf() calling convention. Added
raptor_vasprintf() with vasprintf() (GNU) calling
convention.
int raptor_vsnprintf2(char *buffer, size_t size,
const char *format, va_list arguments);
int raptor_snprintf(char *buffer, size_t size, const char *format, ...);
int raptor_vasprintf(char **ret, const char *format, va_list arguments);
raptor_locator_format() now picks a large enough
buffer size if snprintf() is likely not portable, when
HAVE_C99_VSNPRINTF is not defined.
Fixes Issue #0000465
Internal code style changes for how allocation is done and casting
with new macros.
RAPTOR_GOOD_CAST: code checks or logic ensures cast will not
truncate
RAPTOR_BAD_CAST: value may be truncated; may require API
change/break. Might be unrealistic e.g. a >4G error message,
qname prefix.
Some good uses:
narrowing a known, checked unicode char to a U16
Some 'bad' uses:
only handing error messages, literal language, qname prefixes of
a max len constrained by int
passing in data to libxml constrained by int max len
locator column field constrained to int size
Some bad uses:
iostream read_bytes and write-bytes methods return int but could
easily return a lot more in the size_t range (compare to fread).
API change needed.
locator byte field constrained to int size. should be size_t
raptor_nfc_check returns int offset into a buffer that could
be larger
raptor_ntriples_parser_context changed line_length and offset
to size_t
raptor_turtle_parser changed buffer_length to size_t
Updated code to use size_t for sizes such as those
from strlen() and ptrdiff_t for pointer
differences so that on 64-bit architectures, values are not
potentially truncated to size of int.
0000308: undefined reference to round and trunc while cross compiling for mipsel
0000449: ntriples serializer and parser inconsistent w.r.t. _ in name tokens
0000451: Incorrect qname definition in TRiG parser
0000455: Incorrect AVL tree operations. [ with fix ]
0000456: raptor-2.0.3 fails to build against yajl-2.0.2 API
0000457: raptor-2.0.3 fails to build with curl-7.21.7
Parser class changes
The raptor_option enumeration gains values for
setting SSL client side certificates:
RAPTOR_OPTION_WWW_CERT_FILENAME for the certificate
filename, RAPTOR_OPTION_WWW_CERT_TYPE for the
certificate type and RAPTOR_OPTION_WWW_CERT_PASSPHRASE
for the certificate passphrase.
raptor_parser_parse_uri_with_connection() (which is
called by raptor_parse_uri()) now uses
raptor_www_set_ssl_cert_options() to turn the parser
options above into settings on the WWW object.
RDF/JSON parser: Gains support for building with
YAJL V2. Note that YAJL
V1 and V2 both install the same library name 'libyajl' even though
they have different ABI and APIs.
TRiG parser: Fixed to support the legal uri:
{ ... } syntax naming a graph where the
':' is optional.
Turtle parser: Modified to not include the internal
input() function in the lexer which is never needed.
Serializer class changes
N-Triples and Turtle serializers: Now
use raptor_bnodeid_ntriples_write() to always write
legal blank node IDs.
WWW class changes
Added support for raptor_www to handle setting SSL
client certificate options during WWW retrieval.
Added raptor_www_set_ssl_cert_options() method to set
the SSL client certificates on a WWW object.
Other changes
Make Raptor build against Curl 7.21.7 which removed a header file
that was made an empty file in the libcurl source code on April 26
2004 around version 7.12.0 which is now the minimum version Raptor
supports..
Fixed an AVL Tree issue during deletion that messes up some pointers.
Patch from 'v-for-vandal'. Thanks.
Added a utility function
raptor_bnodeid_ntriples_write() to write a N-Triples
blank node ID in legal form, replacing any letters not in the allowed
set.
Expanded GCC warnings and corrected a few internal uses
of int when size_t was meant. Others
remain.
Reduced stack use of raptor_www_file_handle_fetch()
and raptor_parser_parse_iostream() by moving I/O buffer
to the www or parser objects respectively.
The main change is to add the new main header file
raptor2.h. The new header has been added to allow
applications to be sure they have got the raptor V2 header
(with #include <raptor2.h> and not the raptor V1
header file (#include <raptor.h>).
The raptor.h header will NOT be removed until the next
major raptor release (V3).
Turtle / TRiG parser changes
Alter the parser to not use a large token stack when parsing TRiG
graphs, enabling the parser to handle much larger files. The parser
still gathers all input into a single memory segment so the maximum
amount of input is probably memory size/3.
TRiG parser now allows a QName for the graph name.
Attempted to make the parser handle streaming lexing and parsing
but only partially successful; bison could be made to stream parse
but flex could not be made to stream lex. This meant it could not
be convinced to return a "need more input" response at the end of a
chunk of data and continue lexing later.
Fix value ownership fix graph name.
Fixes Issue #0000437
Other Changes
Raptor was ran through the
LLVM clang static code
analyzer and several issues fixed, mostly in unused variables and in
unlikely error recovery conditions. Some actual potential crash bugs
were found:
The workaround for
ancient libxml2 error handling
in raptor_libxml_xmlStructuredError_handler_parsing()
was broken for some time, so that probably means nobody uses old
libxml2.
librdfa URI
resolving in rdfa_resolve_uri() used unallocated
memory in some relative URI cases.
Bison 2.4 is required to build Raptor from GIT source with
no pregenerated files.
DO NOT USE. Use 2.0.2 which fixes a too strict version
checking bug in raptor_new_world()
Parser class changes
The internal librdfa parser that uses Raptor internals now exports
symbols prefixed with raptor_librdfa so that Raptor can be linked
with the standard librdfa in applications without symbol clashes.
Fixes Issue #0000416
Serializer class changes
The N-Quads serializer was fixed to output the graph name in the
fourth column, instead of repeating the object.
Internal changes
Replaced all internal fatal errors that went to
an abort() with regular logged error.
1.9.1 is the second beta release of Raptor 2 and intended to be
the last release before 2.0.0.
Raptor V1 to V2 upgrading changes
Improved the upgrade-script.pl raptor V1 to V2
upgrade script to handle changes to enums and macros as well as
handle statement field renaming. Updated the generated documentation
to also include enum and macro changes.
Added defensive code in each constructor to check the passed-in
raptor world object is a valid Raptor V2 world rather than V1. It
generates a warning once per run of the program.
The raptor_new_world() function is now a macro that
calls an internal function raptor_check_world_internal()
with a version macro argument to detect when Raptor V2 is invoked with
an inconsistent header and library.
AVLTree class changes
Free the iterator at the end of debug method
raptor_avltree_print().
I/O Stream class changes
Fix major copying too much error in the internal
raptor_read_string_iostream_read_bytes() memcpy that
could cause crashes - the function always copied the maximum amount
the user requested in the read method even if the string was
smaller.
Parser class changes
JSON parser: Made relative URIs option work.
N-Quads parser: Added. The serializer already existed.
librdfa parser: Updated to latest librdfa GIT
1a1a08c790b7649a7f6c12fb9e40c0d3dbe70481
Serializer class changes
Fix raptor_serializer_start_to_iostream() to prevent
crash when this method is used more than once on the same
serializer.
RSS/Atom serializer: Fix crashes with feeds containing entries
with blank node items.
Stringbuffer class changes
Added utility methods
raptor_stringbuffer_append_uri_escaped_counted_string()
and raptor_stringbuffer_append_hexadecimal().
Term class changes
Deleted raptor_term_as_counted_string() and
raptor_term_as_string(). Since 1.9.0 was an unstable
API, this is allowed.
Added convenience methods for constructing URI terms from strings:
raptor_new_term_from_counted_uri_string() and
raptor_new_term_from_uri_string().
Use string lengths in equals and comparisons for faster checking.
Use memcmp() instead of strncmp() when
lengths are known and the same.
WWW class changes
The CURL WWW module now looks for and uses the HTTP response
Content-Location: header to get the base URI for content
retrievals. This allows these base URIs to be used in parsing
content retrived from URIs.
Fixes Issue #0000402
1.9.0 is the first beta release of Raptor 2. There may be changes
and additional releases before version 2.0.0 with the final stable API.
This is a major update and cleanup to the Raptor API and ABI with
additions, removals and changes. There are also major restructurings
of the internal code and cleanups. There are also some new features
in the form of additional APIs, new serializers and parsers.
0000379: raptor libxslt security policy conflicts with apps that also use libxslt and set security policy
General changes
Renamed the library name and package tarball name to a new
separate names (libraptor2, raptor2-X.tar.gz) so they can be
distinguished and installed into the same system as raptor 1 without
file clashes. Note: This does not apply to the
rapper(1) utility and it's manual page which are in both
packages. Packagers should stop packaging the rapper(1)
binary and the rapper manual page from raptor 1, in preference to the
raptor 2 version.
Nicholas J Humfrey is a new committer.
A utility script docs/upgrade-script.pl is
automatically generated from the changes data to aid migrating from
Raptor 1 to Raptor 2 APIs. If it is not a simple rename, the script
annotates the change as a comment near the code.
Raptor's Statement, Term and URI classes can fully replace
librdf's librdf_statement, librdf_node and
librdf_uri classes. This has been tested with GIT
versions when both Rasqal and librdf are configured with
--with-raptor2. When raptor 2 is stable, Rasqal and
librdf will default to use these..
The tutorial examples were updated to the Raptor 2 APIs.
NOTE: At this time, the descriptive parts of the tutorial have NOT
been updated to use the Raptor 2 API.
World class changes
A log handler function for receiving warnings and errors (fatal or
other) are now all sent to a single log handler of type
raptor_log_handler registered to the world class with
raptor_world_set_log_handler(), rather than handlers set
for each parser, sax2, serializer or www instance. Several
constructors lose error handler and error data parameters
consequently.
The enumerating approach for listing the known parsers and
serializers and writing into variables passed in, was replaced with
methods that return pointers to static
raptor_syntax_description objects to allow more
parameters to be returned. This allowed the removal of multiple
older calls that kept having to gain new return arguments.
The description also returns a list of (mime type, qname) pairs
using a new typedef raptor_type_q. It includes a set
of bitflags for some simple information such as
RAPTOR_SYNTAX_NEED_BASE_URI to describe when
a syntax requires a base URI passed in, otherwise is not needed
or optional.
raptor_world_set_libxml_flags() is replaced with
raptor_world_set_flag() which are simple flags that
require no initialisation of the world since they are used before it
is opened. This means that it cannot use the Options module for
world flags. New flag
RAPTOR_WORLD_FLAGS_URI_INTERNING allows disabling of
the URI interning using an AVL-Tree which can use up memory.
raptor_world_set_libxslt_security_preferences() and
raptor_world_set_log_handler() gains an int return value
to report failure if world is already opened.
Moved the generation of blank node IDs from the parsers (many
objects) to the world class (1 object). Cannot think of good reasons
why the blank node ID generation policy needs to be different
per-parser. Enumeration raptor_genid_type was deleted
since only the blank node type was ever used.
AVL Tree changes
The internal memory-based AVL Tree implementation is exposed as a
public API.
Features changes
Replaced with raptor_options
Identifier class changes
Replaced with Term class.
raptor_identifier_type enum was removed and replaced
with enum raptor_term_type and a smaller set of 3
possible term types. The enum values match the int values used
in librdf_node_type.
I/O Stream class changes
Constructors all gain a world argument.
Some methods now return an int error status such as
raptor_iostream_write_end()
Many classes iostream writing methods and methods of the iostream
class itself were changed to follow the standard
raptor_CLASS_write naming
convention and to put the iostream argument at the end.
Deprecated typedef raptor_iostream_handler was removed
Deprecated functions were removed:
raptor_new_iostream_from_handler(),
raptor_iostream_get_bytes_written_count() and
raptor_iostream_write_string_turtle()
Locator changes
Renamed some methods to follow the
raptor_locator_method standard.
Namespaces and namespace stack classes changes
Constructors all gain a world argument and lose error handler,
error data arguments.
Options
A new name for what were called features in Raptor 1 and this was
expanded to allow use of values types string, integer and boolean.
Options can be set on multiple classes such as parser, serializer but
are centrally described using the new
raptor_option_description structure.
The option get / set operations were reduced from multiple methods
per class for getting / setting an int, int / string to just one get
and one set, with optional parameters. It can also handle adding new
types later, which will be passed in as strings and converted
internally.
The options code
introduces a new enum raptor_domain which essentially is
for describing a class such as parser.
For example options listed
for domain RAPTOR_DOMAIN_PARSER will be usable with the
parser option get and set methods
raptor_parser_get_option(parser, ...) and
raptor_parser_set_option(parser, ...).
Parser class changes
raptor_parser_set_strict() was removed and replaced
with a new parser option RAPTOR_OPTION_STRICT.
Parser object methods to return information about the parser class
were removed since they can be done instead via fields of the static
object returned from
raptor_world_get_parser_description(). Deleted
functions include raptor_parser_get_label(),
raptor_parser_get_mime_type(), and
raptor_parser_get_need_base_uri().
Parsing may generate start graph and end graph events for syntaxes
that return graph names such as TRiG. These are returned by the handler
of typedef raptor_graph_mark_handler
set by new function raptor_parser_set_graph_mark_handler()
which returns a start or end event of type enum
raptor_graph_mark_flags.
raptor_parser_get_accept_header() fixed length of
static string to ensure NUL is copied.
Many functions were renamed to match the
raptor_parser_method naming standard. Some of
these get a long longer, but are at least consistent. For example
raptor_parse_uri() becomes
raptor_parser_parse_uri().
Deprecated typedef raptor_ntriples_parser was removed.
Deprecated functions were removed:
raptor_ntriples_term_as_string(), and
raptor_ntriples_string_as_utf8_string()
The librdfa parser was updated with the latest updates to the RDFa
syntax (first, rel/rev, whitespace, xml:lang) and fixes issues with
non-terminated strings.
The GRDDL parser now saves and restores the libxslt global state
(handlers, security preferences) so that it does not affect other
applications in the same memory space. Part of this can be
overridden with
raptor_world_set_libxslt_security_preferences() which
allows user code to disable raptor touching the security preferences
entirely.
Fixes
Issue #0000379
The RDF/XML parser never generated special names for bag IDs
(bagidNNN), so all support for that has been removed.
The RDF/XML parser uses the new reference-counted URIs and raptor
terms to prevent a lot of malloc/free for temporary uses.
Removed RDF/XML parser feature
RAPTOR_FEATURE_ASSUME_IS_RDF since it did nothing since
at least 2003, maybe earlier.
Added a JSON parser (name 'json') that can read both the
resource-centric and triples JSON RDF formats. Requires the YAJL
JSON parser library. Contributed by Nicholas J Humfrey.
Moved the generation of blank node IDs from the parsers (many
objects) to the world class (1 object). Cannot think of good reasons
why the blank node ID generation policy needs to be different
per-parser.
QName class changes
Constructors all gain a world argument and lose error handler,
error data arguments.
Sequence changes
Use new generic raptor_data_free_handler,
raptor_data_print_handler,
raptor_data_context_free_handler,
raptor_data_context_print_handler
data-focused handlers which are shared with the AVL Tree.
Serializer class changes
Added raptor_serializer_flush() for user code to
indicate to a serializer to flush state since the application knows a
block has been ended, or it needs to save memory. No serializer
currently implements this, but it is expected the abbreviated
serializers that use a lot of state - Turtle, RDF/XML-Abbrev - would
benefit from this.
Added an HTML Table serializer with name 'table' contributed by
Nicholas J Humfrey.
Removed the obsolete 'simple' serializer from the source code.
N-Triples is an appropriate simple (and well-defined) replacement
syntax.
Statement class changes
This was made a more regular class that can be created, copied and
freed using reference counting. The structure changed to be an
array of 4 raptor terms rather than a complex union focused on
the allowed RDF Statements. This change allows representing
non-RDF triples as well as triples with named graphs (also known as
quads).
raptor_statement_part_as_counted_string() turns into
a method of the new Term class, as a "statement part" is now
represented as a Term.
Term class changes
This new class with an open structure replaces
raptor_identifier and was created to represent an RDF
Term: literal, URI or blank node and is reference counted and
dynamic. It is a union of fields for three types.
This class can fully replace librdf's librdf_node when both Rasqal
and librdf are built with --with-raptor2. The
semantics of comparison (ordering) and equality are the same.
Unicode changes
Several utility functions were renamed to match their
functionality more accurately and be associated with the Unicode
module set of functions. For example raptor_utf8_check()
was renamed to raptor_unicode_check_utf8_string()
URI class changes
The whole concept of URI handlers was removed, there is no longer
a way to replace the implementation of the URI class. The
implementation built in now interns URIs string so that a single URIs
for a string is only ever in memory once, but reference counted. This
is what Redland librdf has done for many years, and librdf can fully
use this.
Deprecated functions were removed:
raptor_uri_is_file_uri().
The raptor_uri_resolve_uri_reference() now returns the
length of the URI written into the buffer.
WWW class changes
Rename several of the functions to the standard constructor,
destructor and method naming format.
XML Writer class changes
Constructors all gain a world argument and lose error handler,
error data arguments.
Configuration changes
Added configure argument --with-yajl=DIR (or 'no') to
set the prefix where YAJL libraries and headers are installed.
Raptor headers are now installed in a sub-directory of
PREFIX/include.
raptor-config was removed. Building against raptor 2
should be done only using pkg-config with either
--cflags or --libs arguments like this:
cc -o prog prog.c `pkg-config raptor2 --cflags` `pkg-config raptor2 --libs`
Internal changes
Code style: lots of changes mostly adding lots more whitespace
such as to show control change (if, while) or early function exit
(return).
All strcpy() with known lengths and
strncpy() were replaced with memcpy() which
is quicker and compilers optimize better.
Code style:
use TYPE* var_name = RAPTOR_CALLOC(TYPE, 1, sizeof(*var_name))
rather than repeat the type name which can be error-prone.
Code style: put whitespace round assignment and operators i.e.
use c = a + b rather than c=a+b.
Code style: removed some strdup()s.
Code style: try to remove un-necessary strlen() by
tending to pass around a string with it's length, a counted string.
This meant adding a few new constructors such as for the URI and Term
classes.
Code style: methods called with a NULL object return failure
and destructors called with a NULL object return silently rather than
the former mix of crashing or abort()ing.
Code style: copy constructor is now called
raptor_class_copy() rather than
raptor_new_class_from_class()
for brevity.
Code style: print methods return an int return status indicating
success.
rapper Utility changes
Print out the option types next to the description in the -f
help usage message.
Removed unused -a flag from code.
Did NOT rename -f option to match the renaming of
features to options in the API. Not needed.
Removed long deprecated -n flag which was shortcut for
selecting the N-Triples parser and can be done with -i ntriples
Removed -s/--scan flag since it is an option of a
single parser (RDF/XML) which can be done with -f/--feature
scanForRDF.
Other changes
Removed support for building raptor with dmalloc debugging
(removing --with-dmalloc configure argument). Valgrind
wins.
The example 'grapper' GNOME GUI utility for raptor was updated
to the latest GTK APIs (2.5.0+ but still quite old) so that it
builds with all the GTK 'disable deprecated' flags set. The
UI is not quite correct though - the preferences menu is broken.
Switched to GIT version control, hosted by GitHub. The latest
raptor 1 code is available on branch 'raptor1' as well as from the
release tags for specific versions.
This is a bug fix only release with no new features. New
development has moved to raptor 2 where a planned ABI and API break
is underway.
Fixed Issues:
0000318: Cannot end a Turtle literal with \\ inside triple-quotes
0000319: ntriples parser does not register that it accepts ntriples mime type - text/plain
0000326: Turtle parser allows '.' in qnames which is not-to-spec
0000331: Turtle long literals with raw newlines do not count line numbers correctly
0000332: RDFXML parser finds duplicates and misbehaves (when it shouldn't)
0000337: raptor/turtle outputs invalid qnames which cause syntax errors on parsing
Parser changes
N-Triples parser: Declare acceptance of text/plain mime type with
q=0.1
RDFA parser (via librdfa): Updated to fix some buffer management
problems when it was passed large blocks (4096 bytes or more), a few
memory leaks and some other minor bugs.
RDF/XML parser: Properly reset the ID-checking set at the start of
each parse.
Turtle parser: Allow \\ at the end of triple-quoted literals.
Forbid '.'s in prefixes and qnames (follow specification).
Properly count newlines inside the literals for error reporting.
Serializer changes
Turtle serializer: Forbid '.'s in prefixes and qnames (follow
specification).
Other Changes
Updated configure and the build system to use silent
rules for the maintainer (by default), or when
--enable-silent-rules is passed to
configure. This feature requires building with automake
1.11 which requires autoconf 2.62 or newer when building from GIT.
autogen.sh script was updated to enforce the
autotools versions above.
This is a bug fix only release with no new features. New
development has moved to raptor 2 where a planned ABI and API break
will happen. There may be preview releases of raptor 2 with 1.9.x
numbering.
Fixed Issues:
0000306: rapper doesn't handle datatype=""and xml:lang="" properly with RDFa
0000307: configure fails at vnsprintf test when cross compiling
0000310: Raptor does not like single character namespaces with RDFa
0000312: Ununitialized pointer in example rdfserialize.c causes crash
Parser Changes
GRDDL parser: Fix XML parser context resource leak if
raptor_grddl_fetch_uri() fails. Save and restore error
handlers properly to prevent crashes when an error is reported during
parsing.
RDFA parser (via librdfa): Update to latest librdfa GIT sources with head
a438ce68a40e04b399ec2b2c613d0c867d9315c7
now moved to
https://github.com/msporny/librdfa
to fix handling single character namespaces
(Issue #0000310),
empty datatype attribute and empty xml:lang attributes
(Issue #0000306)
Added three unapproved RDFa tests 0172, 0173 and 0174 to cover the
fixes above.
Serializer Changes
Turtle serializer:
Applied scalability patch from Chris Cannam.
This switches the serializer to use a raptor_avltree
instead of a raptor_sequence for the subject and blanks
used with raptor_abbrev_node_lookup(). This fixes a
performance problem in the serializing and moves lookups from O(N) to
O(log N) - from list to balanced tree.
Other Changes
If cross compiling, check for vsnprintf() C99 compatible at
runtime by setting define CHECK_VSNPRINTF_RUNTIME during
configuration.
Fixes Issue #0000307
Use calloc() for allocating a raptor_statement in
rdfserializer.c example code to properly initialise state.
Fixes Issue #0000312
Use AC_SYS_LARGEFILE to get large file IO checks which
allows 32-bit systems to read multi-gigabyte files.
autogen.sh script fix for if test when uname is not in
standard OSX dir.
WARNING: FUTURE ABI and API CHANGES. The next
release of raptor 1.4.x will include bug fixes only and no new
features. New development will move to raptor 2 where a planned ABI
and API break will happen. There may be preview releases of raptor 2
with 1.9.x numbering.
Fixed Issues:
0000259: Fix NFC check for legal combiner sequence
0000262: Error when raptor_new_uri() fails in Turtle parser
0000263: Invalid turtle output syntax on empty integer/double/decimal literals
0000266: Default/atom namespace in atom serializer output
0000269: strstr is called in raptor_parse_chunk() on a buffer string, where it should be called on a null-terminating string.
0000299: Avoid calling xmlSetStructuredErrorFunc() and xmlSetGenericErrorFunc()
0000303: rdfa parser does not parse content as RDFa which librdfa+expat alone handles
Parser Changes
raptor_get_feature() now returns the integer value rather than
just 1 or 0. Issue #0000288
Guess parser: return name of guessed parser not 'guess'.
N-Triples parser:
Produce error messages when raptor_new_uri() fails. Issue #0000262
RDFa parser:
Fix problem when there is a subject and predicate specified on an
element, but no child nodes for the object literal using
latest librdfa GIT source with head
2ddcb3f9e010d0b3d9ee546e807539be5da1b14a Issue #0000289
RSS tag soup parser:
Huge internal changes:
Recording more atom core structures in triples (such as author, contributor -
person) rather than only channels and items
Introduced a new 'blocks' concept to record single element structured
items such as atom category, link and rss enclosure
Added itunes namespace and container.
RDF/XML Parser:
Adjust predicate_type when removing ordinal identifier type from predicate. Issue #0000293
Serializer Changes
Atom 1.0 serializer:
Now tested and takes more care to try to generate valid Atom 1.0
Turtle serializer:
Validate XSD integer, decimal and double literal
output. Emit special short forms only if the whole literal value is
consumed by strtol() (for integers) or
strtod() (for decimals and doubles). Otherwise produce a
warning and emit literal in the normal
"value"^^<datatype_uri> format. Issue #0000263
Fix broken collection abbreviation Issue #0000277
RSS serializer:
Fixes for g++ Issue #0000270
Added a new serializer feature
RAPTOR_FEATURE_PREFIX_ELEMENTS (short name
prefixElements) for atom and rss 1.0 serializers to decide whether
core elements in the default namespace are declared with the prefix
or without a prefix.
Removed generation of deprecated predicate ordinals of type
RAPTOR_IDENTIFIER_TYPE_ORDINAL and replace with resource type URIs
XML Support Changes
Removed generic calls to xmlSetStructuredErrorFunc()
and xmlSetGenericErrorFunc() which can be a problem when
libxml is shared with other code in memory. They may be called
optionally but will do a save/restore of the existing functions.
This protection is enabled by the new API call
raptor_set_libxml_flags() to set the flags from values
in enum raptor_libxml_flags. Issue #0000299
Use context-specific libslt security configuration to avoid
calling generic call xsltSetDefaultSecurityPrefs() which
can be a problem when libxslt is shared with other code in memory.
Allow the user to set the policy for raptor globally with new API
function raptor_set_libxslt_security_preferences(). Issue #0000296
Make libxml SAX2 structured errors register parser-specific
handler function raptor_libxml_xmlStructuredErrorFunc()
instead of libxml global structured error handler. The libxml flag
method above can still enable registerding the global error handlers.
In raptor_sax2_parse_chunk() fixed calls to
raptor_log_error_to_handlers() when built with expat. Issue #0000287
Other Changes
Win32 portability fixes from Lou Sakey:
Handle absence of gettimeofday()
Call xmlCleanupParser() libxml call last to avoid an access
violation on windows.
Windows vsnprintf() portability patch
raptor_sequence_set_at() fixed to maintain the design
contract: provide "size" consecutive items in "sequence" starting from
"start" even when setting items more than +1 offset beyond the end of
sequence. Issue #0000276
rapper(1) utility changes: if counting, do not use a
serializer at all.
Internal Changes
More internal changes to be more resiliant after allocation failure
(Lauri Aalto)
Reorganised tests in source tree to pull out specific directories
for RDF/XML, Turtle, etc.
Use a DJ Bernstein hash to replace a linked list for storing a
stack of namespaces. This makes turtle parsing with lots of
namespaces (100s) much faster. Based on the initial patch in the bug. Issue #0000290
Use new internal raptor_memstr() function to compare
a string against a buffer that may not be NUL terminated. Issue #0000269
raptor_error_handlers: API structure gains world
field. BINARY COMPATIBILITY BREAK: sizeof(raptor_error_handlers)
changed. Source compatibility not broken.
raptor_identifier: API structure gains world
field. BINARY COMPATIBILITY BREAK: sizeof(raptor_identifier)
changed. Source compatibility not broken.
More fixes for compiling with C++
Move some more static data as constant to enable more efficient
compilation - moves to data segment of object binary.
Use memmove for overlapping copy, not memcpy when doing relative
URI resolving.
Raptor V2 Preparation Changes
Lots of internal changes were made by Lauri Aalto preparing for
Raptor V2 to fully attach all static data and config to a new
raptor_world object. A new static instance of this
class is now used internally behind the existing V1 API and will be
required to be constructed by the library user for the V2 API with a
new constructor/destructor.
NOTE: The method names here are illustrative of the final
V2 names but are not confirmed - These functions are not
supported in the 1.4.x series. Some methods will still be
altered for fields and (raptor_world) parameters. All constructors
should have it as a parameter. All methods will not have them (so
for example, all the URI methods named _v2 will lose the world
parameter and just have the URI parameter - but that is also because
the URI handler/context part will go into raptor_world in V2)
To use the unsupported and experimental V2
functions, define -DRAPTOR_V2_EXPERIMENTAL=1 when
building with raptor.
Added raptor_world typedef.
Added raptor world class constructor
raptor_world* raptor_new_world(void) and initializer:
int raptor_world_open(raptor_world* world)
Added world class destructor:
void raptor_free_world(raptor_world* world)
0000255: rss-tag-soup serializer does not generate namespaces so re-serializing in rdf/xml looks wierd for atom
Parser Changes
A new
RDFa
parser was added (name rdfa) using
librdfa to
implement it. librdfa is linked as part of Raptor and
written by Manu Sporny of Digital Bazaar, licensed with the
same license as Raptor.
The RDFa
test suite
was added to the test and (via librdfa) Raptor passes all but 4 tests
which fail due to different output xmlns attribute ordering (which
does not matter to XML parsers).
Serializer Changes
Added new function
raptor_serialize_start_to_iostream() to have the new
semantics of not owning and destroying the passed-in iostream. This
allows the caller to serialize to an existing iostream and then
to continue to write to it. raptor_serialize_start()
owns and then closes the iostream that is passed in.
A new Atom Syndication Format 1.0 (RFC 4287) serializer was added (name atom)
using the RSS 1.0 RDF triple model with mapping to atom terms
and consideration of atom output format conditions.
RSS 1.0 serializer
Allow setting output namespaces for the serializer
Allow writing extra RDF triples as RDF/XML attached to RSS items.
Recognize predicates with XML Literal and emit as
parseType="Literal" or when content:encoded,
as a CDATA block, by RSS 1.0 convention.
Removed code assumptions about triples appearing in a certain order.
Free namespaces and stack in correct order
Turtle serializer now respects the writeBaseURI
feature to control generating the @base directive.
Abbreviated serializers (RDF/XML Abbrev and Turtle) now remove
duplicate triples.
Added feature RAPTOR_FEATURE_RSS_TRIPLES to add RDF
triples to RSS 1.0 or Atom serializer output with values 'rdfxml' or
'atom-triples'. Atom triples writes at:map sections for
the atom:entry elements and at:feedmap and
at:entrymap sections to the atom:feed
elements. at:contentType is used to provide a
type attribute value for an atom:content
that has a URI value.
Added RAPTOR_FEATURE_ATOM_ENTRY_URI for the Atom
serializer to set the URI of an atom entry. If the URI matches the
URI of an entry item in the RDF mode of the channel, then an Atom
Entry document is generated rather than an Atom Feed document.
QName Class Changes
Added raptor_qname_to_counted_name() to get
a formatted qname for a name.
raptor_new_qname_from_namespace_local_name() will
accept a NULL namespace to construct a namespace-less qname.
Sequence Class Changes
raptor_sequence_set_at() now handles
setting an item at an index in the sequence beyond capacity+1
to automatically extend.
Added raptor_sequence_delete_at() to delete an item
at a position in a sequence and return it.
URI Class Changes
raptor_uri_to_relative_counted_uri_string() now
has support for a base URI with scheme and authority but no path,
so the result can be a relative URI starting with '/'.
XML Writer Class Changes
XML Writer allows adding newlines via
raptor_xml_writer_newline() which
requires use of raptor_xml_writer_flush() to indicate
when XML writer output is finished.
Added raptor_xml_writer_get_depth() to get the current
XML writer element stack depth.
Other Changes
Many more resiliance checks were added.
Removed all calls to abort() in code on fatal errors. This
requires using setjmp and longjmp inside parsers built with
flex and bison.
The Turtle writer may optionally generate @base depending on
flags. (This is used by Turtle serializer to handle the writeBaseURI
feature)
Tidied error messages for rapper(1) when parsing stdin.
raptor_init() and raptor_finish() use a reference count to ensure
initialising and terminating happen at most once each.
Added two new JSON serializers: resource-centric 'json'
(Talis RDF/JSON)
and triple-centric 'json-triples'.
Made I/O Stream class raptor_iostream support
reading as well as writing with new constructors and
new methods.
Added a new public SAX2 API class raptor_sax2
exposing the existing internal API which has been around since the
first release of Raptor 8 years ago and runs on top of either expat
or libxml2.
Added new public error handlers structure
raptor_error_handlers containing a set of
(function, data pointers) pairs called raptor_handler_closure
for each error log level.
Added raptor_log_level enum for the error log level.
Added an initialization function for the structure,
raptor_error_handlers_init().
Several other API changes, fixes and improvements were made.
Fixed Issues:
0000252: Allow controlling of cache headers in Raptor
Made I/O Stream class raptor_iostream support
reading data in addition to writing. (Dave B):
Deprecated raptor_iostream_handler structure for new
raptor_iostream_handler2 structure which contains the
new factory functions for reading.
Added new read I/O stream factory handler typedefs
raptor_iostream_read_bytes_func and
raptor_iostream_read_eof_func.
Added new raptor_new_iostream_from_handler2() I/O
stream constructor to allow building of read and write iostreams
deprecating raptor_new_iostream_from_handler().
Added new raptor_iostream_tell() deprecating
raptor_iostream_get_bytes_written_count.
Added new read I/O Stream constructors:
raptor_new_iostream_from_sink(),
raptor_new_iostream_from_filename()raptor_new_iostream_from_file_handle() and
raptor_new_iostream_from_string()
Added new read I/O Stream methods
raptor_iostream_read_bytes() and
and raptor_iostream_read_eof().
Added new write I/O Stream method
raptor_iostream_write_string_python() to write an
encoded string to an I/O stream using python / JSON / Turtle /
N-Triples / SPARQL escaping rules. (Dave B)
Added raptor_statement_compare() to provide an
ordering between raptor_statement objects. (Dave B)
Parser Class Changes
Added new parser features to control HTTP headers in
web requests (Dave B, based on a patch in the bug):
Also never Pragma: header with libcurl ever.
Fixes Issue #0000252
RAPTOR_FEATURE_WWW_HTTP_CACHE_CONTROL to control
sending Cache-Control (default: none)
RAPTOR_FEATURE_WWW_HTTP_USER_AGENT to control
sending User-Agent (default: none)
Turtle parser:
Added tests to forbid ' and
'''-quoted strings and to forbid () in
triple predicate position following the updated Turtle spec. (Dave B)
Write ';' statement terminators with a leading
space for consistency with '.' terminator. (Dave R)
Remove canonicalisation of integer and double
to match Turtle latest spec. (Dave B)
QName Class Changes
Added new methods raptor_qname_get_local_name(),
raptor_qname_get_value() and
raptor_qname_get_counted_value(). (Dave B)
SAX2 Class Changes
Added new public SAX2 API class raptor_sax2 exposind
th existing internal one which has been around since the first
release of Raptor 8 years ago and runs on top of either expat or
libxml2. (Dave B)
Constructor: raptor_new_sax2()
Destructor: raptor_free_sax2()
XML handler methods:
raptor_sax2_set_start_element_handler(),
raptor_sax2_set_end_element_handler(),
raptor_sax2_set_characters_handler(),
raptor_sax2_set_cdata_handler(),
raptor_sax2_set_comment_handler(),
raptor_sax2_set_unparsed_entity_decl_handler() and
raptor_sax2_set_external_entity_ref_handler().
XML handler factory typedefs:
raptor_sax2_start_element_handler,
raptor_sax2_end_element_handler,
raptor_sax2_characters_handler,
raptor_sax2_cdata_handler,
raptor_sax2_comment_handler,
raptor_sax2_unparsed_entity_decl_handler and
raptor_sax2_external_entity_ref_handler.
Set XML Namespace handler method:
raptor_sax2_set_namespace_handler()
Parsing methods:
raptor_sax2_parse_start() and
raptor_sax2_parse_chunk()
Other methods:
raptor_sax2_inscope_xml_language() and
raptor_sax2_inscope_base_uri()
Serializer Class Changes
Abbreviated serializers (RDF/XML-Abbrev and Turtle):
Switched from using a sequence to using an AVL Tree with a cursor
to more efficiently (faster) group/sort triples by subject. This
changes the previous syntax output order but has no semantic
difference. (Dave B)
Use the AVL Tree to remove duplicate triples. (Dave B)
Fixes Issue #0000245
Turtle serializer:
Feature RAPTOR_FEATURE_WRITE_BASE_URI
added to control writing @base directive to Turtle. (Dave R)
Remove canonicalisation of integer and double
to match Turtle latest spec. (Dave B)
URI Class Changes
Update URI resolving for RFC3986 changes (Dave B)
WWW Class Changes
Added new method raptor_www_set_http_cache_control()
to set the HTTP Cache-Control: header in requests.
(Dave B, based on a patch in the bug)
Fixes Issue #0000252
XML Class Changes
Added new method raptor_xml_element_get_language()
to get the language associated with an element. (Dave B)
Portability and Resilience Changes
Pass on error failures in parser and serializer factory
construction. (Lauri)
Abbreviated serializers (RDF/XML-abbrev and Turtle): low memory
and allocation failure fixes. (Lauri)
Altered API function signatures of
raptor_uri_set_handler(),
raptor_uri_get_handler(),
raptor_new_namespaces(),raptor_namespaces_init() and
raptor_new_xml_writer() to add appropriate
consts. (Lauri)
Portability fixes for RAPTOR_API and other macros. (Lauri)
Removal of many sets of writable static data in N-Triples parser, URI
class, Unicode NFC code, libxml support, Turtle writer and XML
writer. (Lauri)
Portability fixes for round() and
trunc() that are not always available in libc but might
be in libm. (Dave B)
Turtle/N3 parsers and serializers, RDF/XML_Abbrev serializer: many
low memory fixes and better out of memory errors. (Lauri)
Other Changes
Rewrote internal error log functions to use new error handlers
structures and simplify the calls. (Dave B)
Expanded internal raptor_avltree datatype support to
add a cursor, allowing it to be used for creating large ordered
sequences that need to be walked. (Dave B)
Updated rdfdiff utility to handle duplicate triples
in inputs. (Dave B)
raptor_sequence_shift() and
raptor_sequence_unshift() are now as efficient as the
sequence push and pop operations: O(1). (Lauri)
autogen.sh was updated.
rapper utility can now accept multiple
-f / --feature options; previously
only one parser and one serializer feature was possible.
0000194: parser and serializer don't recognize the same mime types
0000195: Compile error in raptor_serialize.c debug code
0000207: RDF file can be parsed, but not then serialised.
0000210: RAPTOR_FEATURE_WRITER_XML_DECLARATION broken in Ruby
0000214: Empty rdf:about, plus base-uri, produces incorrect turtle output
0000216: flickrdf segfaults at raptor_serialize_end!
0000217: flickrdf segfaults at raptor_serialize_end!
0000232: libraptor does not correctly free up libxml error handler, causing crashes in subsequent calls to libxml error handlers
0000237: raptor_sequence robustness: item ownership on insert error
0000238: GRDDL parser in SVN overwrites blank nodes when merging graphs
0000239: GRDDL parser in SVN returns 60 less triples with https://www.w3.org/
Namespaces Class Changes
raptor_namespaces_init() now returns an integer
status.
Parser Class Changes
Added raptor_graph_handler typedef and
raptor_set_graph_handler() to return named graph
identifiers during parsing, initially for the TRiG parser.
These were added the GRDDL parser:
RAPTOR_FEATURE_MICROFORMATS (microformats) to enable
hCard and hCal microformats
RAPTOR_FEATURE_HTML_TAG_SOUP (htmlTagSoup) to use
the HTML tag soup parser if the XML parsing fails
RAPTOR_FEATURE_HTML_LINK (htmlLink) to enable html
<link>
RAPTOR_FEATURE_WWW_TIMEOUT (wwwTimeout) for setting
URI retrieval timeouts during processing
XML Element Class Changes
Added
raptor_new_xml_element_from_namespace_local_name()
constructor to make an XML element from a local name relative
to a raptor_namespace.
Unicode Class Changes
Defined a new raptor_unichar typedef for a Unicode
codepoint defined as unsigned long which was the
previous type used. Altered the Unicode function to take it as a
parameter. raptor_unicode_char_to_utf8(),
raptor_utf8_to_unicode_char(),
raptor_unicode_is_xml11_namestartchar(),
raptor_unicode_is_xml10_namestartchar(),
raptor_unicode_is_xml11_namechar() and
raptor_unicode_is_xml10_namechar().
URI Class Changes
Added raptor_uri_compare() and
raptor_uri_compare_func function pointer for
implementing it in the raptor_uri_handler. The handler
now has a version field initialised to trigger the new
factory method for uri compare when the version is 2 or more.
WWW Class Changes
Added raptor_www_set_connection_timeout()
to set the WWW retrieval connection timeout in seconds.
Added raptor_www_final_uri_handler typedef and
raptor_www_set_final_uri_handler() to return
the final URI seen during WWW retrieval such as after
redirects.
Added raptor_www_get_final_uri() to return the final URI
after a WWW retrieval which might include redirects.
Parsing as RDF/XML when it is recognised after a transform.
it also:
Handles hCard and hCal microformats when feature
RAPTOR_FEATURE_MICROFORMATS is enabled (default
enabled).
Handles <link type="application/rdf+xml" href="URI" /> to
RDF/XML content when feature RAPTOR_FEATURE_HTML_LINK is
enabled (default enabled).
Attempts parsing with libxml's HTML parser if XML parsing fails,
when feature RAPTOR_FEATURE_HTML_TAG_SOUP is enabled
(default enabled).
Discards errors during recursive processing such as 404s,
failure to parse, failure of XSLT processing.
Uses XSLT security - denies reading, writing to files,
directories or writing to network.
Accepts the RAPTOR_FEATURE_NO_NET feature to prevent
all networking.
Allows fine-grained URI filtering with
raptor_parser_set_uri_filter().
RDF/XML parser recognising was updated to just the start of the
document for guessing if it should handle content and to try
to avoid html URLs.
RSS Tag soup parser recognising was updated to accept with the
string 'feed' in the identifier.
TRiG Parser was added based on the Turtle parser, adding named
graphs. It returns name graph URis via a callback set with new API
call raptor_set_graph_handler()
Turtle parser added @base support, fixed turtle
escapes to URIs. Recognising was updated to look for
@prefix early in the document.
Serializer Changes
Turtle serialiser changes:
Generate @base when an output base URI is given.
Properly format Turtle XSD doubles using new snprintf code.
Fix unwanted blank line at end of Turtle list abbreviation.
Use AVL Tree rather than sequence for significant performance
improvement for large serialisations.
RDF/XML serialiser was changed to emit a legal empty RDF/XML
document when no triples are serialised and to skip emitting
statements with bad predicate uris rather than returning an error.
RDF/XML Abbrev serialiser was changed to use an AVL tree rather
than sequence for significant performance improvement for large
serialisations.
rapper Utility Changes
Added an --show-graphs option to print named graph
URIs as seen (such as with TRiG).
Added -I / --input-uri and
-O / --output-uri options to set the
input / parsing and output / serializing base URIs
separately. Defaults remain the same - the serializer base URI
defaults to the input base URI, however it was set.
Portability Changes
Fixes for when building from Subversion on cygwin (EOL issues,
Makefiles).
Remove unused semicolons for prevention of compiler warnings.
Fix some uninitialized variables that some compilers complain about.
Allow RAPTOR_ASSERT_DIE to be externally defined.
Allow RAPTOR_WWW_BUFFER_SIZE to be externally defined.
Other Changes
autogen.sh was updated to handle program versions
better using an inline perl helper.
Start to add resiliance to memory allocation failures
and errors inside the library.
Added AVL Tree code to make much faster key:value lookups. This
is used for RDF/XML parser XML ID checks and in the 'abbrev'
serializers - Turtle and RDF/XML-Abbrev for looking up nodes.
Better libxml error messages are now returned, mentioning
some of the names and values that caused the error.
GRDDL parser now passes the (unapproved) test suite for the
GRDDL W3C Working Draft 2 March 2007
except for two tests that have been reported as having errors.
When using libcurl as the WWW retrieval library, errors in
resolving a URI such as not found (404) are now reported as proper
errors and cause parsing to fail rather than just return no triples.
Some improvments where made to guessing for a parser to match some
content. Firstly, any mime type with Q <10 is added to the score,
don't lose the influence of the mime type entirely. The consequence of
this is that Turtle can pretend to be a partial N3 parser. Secondly,
the XHTML mime type is now correctly recognised by the GRDDL parser
rather than the RSS Tag Soup parser.
Fixed Issues:
#0000174: Serializing to rdfxml* with a base_uri doesn't set the xml:base attribute, but does truncate rdf:about and rdf:resource values
When a namespace URI is seen that was RDF/XML Mime type, run
the RDF/XML parser on the content.
Look for substrings inside rel attributes when looking for profiles.
Return a warning and do not fail if XSLT sheet is not found
Use libxml structured errors for better reporting
Removed old hard-coded xslt scripts
Turtle parser was changed to accept the N3 mime
type text/rdf+n3 at low Q(quality)
so it might work for N3 that is the RDF subset - quite common.
Changed the RSS Tag Soup parser and RSS 1.0 serializer to stop
sharing use of the declared namespaces so that when using both at the
same time, there is no double-free of the same objects.
Correct the content: namespace URI in the RSS parser and
serializers.
Other Changes
rapper gains a -t/--trace option to show
URIs traversed. Handy for GRDDL.
raptor_uri_resolve_uri_reference() no longer goes
past the end of buffer when the relative URI is ,/
Added an internal API for capturing parsed data as it is seen.
Use by GRDDL parser but with no public API.
Added an internal API for structured error reporting. Updates
made throughout the library but with no public API.
Internal API raptor_new_sax2() signature changed to
just have an error_handlers pointer argument rather than
multiple function / user_data pairs.
#0000141: Crash when GRDDL parser is used with a used-generated blank node ID prefix.
#0000143: Crash when GRDDL parser fails to retrieve URI.
#0000148: A public function to generate a blank ID would be nice though.
#0000155: entity processing in literal property elements (with libxml)
#0000157: Crash when RDF/XML Abbrev serializer sees a rdf:type predicate with a literal object.
Configuration Changes
raptor-config gains a --private-libs
for the internal libraries used in building raptor, with the public
ones only emitted with --libs.
raptor.pc now uses Libs.private for
internal dynamically linked libraries.
The libxml minimum version is now 2.6.8 since 2.6.7 crashes on
PPC64 Linux. 2.6.8 was released March 2004 so this should be no
burden.
Do not use PATH_MAX so raptor can build on Hurd.
Parser Changes
RDF/XML parser now looks for the RDF/XML root element and
namespace declaration in the initial bytes of content when guessing.
This allows content that is in other mime types such as
application/xml to be more likely guessed as RDF/XML.
When guessing a parser to use, if an an exact match is found for
the mime type (q=10), then that parser is used.
The GRDDL parser has several changes:
Recurses through the root element's namespace URI and the profile
URIs. It excludes several common namespace URIs from processing
(XHTML, RDF/XML, XML Schema) and does not traverse the GRDDL profile
URI itself.
Tries to guess which of the RDF/XML or Turtle parser is wanted
from an XSLT result. Guessing is performed because not all the XSLT
sheets used in the demonstrations set the mime type to match Turtle's
unregistered type, or because the return no mime type, or return an
XML one, when it was expected RDF/XML would be received.
Watches the processed URIs and never visits the same URI more
than once in a session.
Passes on general XSLT errors to raptor rather than letting the
default (printing to stderr) work.
Declares XSLT 'base' and 'Base' parameters to allow some XSLT
sheets to work - pragmatism.
turtle_writer for serializing triples to Turtle This
may be moved to the public API in a future release.
raptor_abbrev for the common 'abbreviated
serializer' core that is shared between the RDF/XML-Abbrev and Turtle
serializer.
Added a new GraphViz
DOT format serialiser
writen by Evan Nemerson.
Note that testing the turtle serializing (make test)
requires the rdfdiff -u and a few of the tests take some
time to run.
Other Changes
Added raptor_home_url_string
and raptor_license_string exported strings.
Added raptor_parser_generate_id() as a public function
to generate an identifier for a parser.
rdfdiff gains the -u/--base-uri option to specify the
from file base URI so that if the from file is a local file or
relative URI, it can be given an absolute base.
Failures to retrieve content from a URI using
the raptor_www class implementations now return a
failure as well as setting the HTTP status code to 403 or 404 as
appropriate. Previously success may have been returned with no
bytes.
Restored the order of serialized syntaxes back to the same as in
Raptor 1.4.10 which Redland was relying on - asking to serialize to
mime type 'application/rdf+xml' without specifying a parser name in
Redland with Raptor 1.4.11 wrote it in XMP instead of RDF/XML as
it used to. This happened more often with language bindings.
That problem will be fixed in a future release of Redland but for now,
this stops wierd things like that happening.
Added raptor_get_feature_count() to return
the count of features, in preference to using the
macro value RAPTOR_FEATURE_LAST.
Added raptor_www_set_uri_filter() method of the
WWW class (raptor_www) objects to have an
optional URI filter function that checks if the URL given is
allowed to be retrieved, or denied entirely.
#0000112: raptor_namespaces_qname_from_uri not public API?
#0000110: strcasecmp problem under windows (raptor_rss.c does not compile)
#0000091: guess parser should guess the syntax each time it is run, not be fixed
#0000089: Add a NONET feature to prevent network fetches
#0000041: Allow multiple transformation URLs in data-view:transformation property
#0000014: bNode content written twice in rdfxml-abbrev output mode
Documentation Changes
The
Raptor Reference Manual
now includes descriptions of all the parsers and serializers and the
tutorial has a new section describing how to filter URIs and deny
network requests.
Parser Changes
Added functionality to prevent network requests either via setting
a new feature RAPTOR_FEATURE_NO_NET that denies network
requests during a parser operation or with a URI filter function
raptor_parser_set_uri_filter(). This function uses
raptor_www_set_uri_filter() internally.
Added raptor_get_need_base_uri() to tell if a parser
requires a base URI argument. Presently the N-Triples parser
is the only parser that does not require a base URI.
raptor_start_parse() will now throw an error if no base
URI is given and it is needed.
The GRDDL parser was changed to
handle a list of URIs in the profile so it now
can support dataview:transformation in XML taking a list
of transformations as defined in
The GRDDL profile for XHTML part of the GRDDL specification.
It now also recognises
Embedded RDF and
HCalendar
using well known XPaths and transforms them to RDF triples using well
known XSLT sheet URIs.
The Guess parser now resets after each parse and does a
fresh guess on the syntax based on the incoming information.
Fixes Issue #0000091
The Turtle parser (and experimental N3 parser) were
changed to now require base URIs as they always should have. The
error messages when reporting problems with grammar tokens now return
better responses. Added better memory cleanup during parser error
recovery.
Serializer Changes
The RSS 1.0 Serializer now works again.
Updated the RDF/XML Abbreviated serializer to do proper
reference counting on the blank/resource nodes used as subjects and
objects to prevent dual-triple generation. Fixes the reported
Issue #0000014
Other Changes
The internal SAX2 API can also prevent network fetches with the
feature RAPTOR_FEATURE_NO_NET.
Fixed a SAX2 problem that caused parsers that use it to leak
memory for 1 URI, affected RDF/XML and RSS Tag Soup.
rapper help and verbose message formats were tidied.
No parser will now generate a triple with an identifier type
RAPTOR_IDENTIFIER_TYPE_ORDINAL. Only identifier type
resource, anonymous (blank node) and literal will be generated.
All serializers will convert any
RAPTOR_IDENTIFIER_TYPE_ORDINAL type on input to type
resource.
Configuration Changes
No longer adds LDFLAGS to pkgconfig file raptor.pc
and raptor-config fixing
Issue #0000097.
Parser Changes
All parsers no longer generate a triple with an identifier type
RAPTOR_IDENTIFIER_TYPE_ORDINAL, as deprecated in 1.4.8.
The replacement type generated is RAPTOR_IDENTIFIER_TYPE_RESOURCE.
The RSS Tag Soup (rss-tag-soup) parser now makes the
triples appear before parser destruction. This caused odd symptoms
like parsing in python returning no triples and the parser then
crashing during object destruction.
The RDF/XML (rdfxml) parser no longer crashes if a
comment is seen outside an element, such as before or after the root
element.
Serializer Changes
The RDF/XML (rdfxml) serializer no longer crashes if
the serializer is used more than once.
configure now allows --enable-parsers=node and
--enable-serializers=none. Using both is possible!
No longer require libxml2 for the RSS Tag Soup parser
Various Win32 fixes and VC build files updates from John Barstow.
Documentation Changes
A new
Raptor Tutorial
was written covering using all parsing and serializing functions along with
example code.
The
Raptor Reference Manual
now covers 100% of all functions, structs and defines with gtkdoc generated
documentation.
rapper utility Changes
rapper now uses namespaces found in parsing to give
hints to the serializer as to how to format the output. The result
of this is that rapper can be used as an RDF
pretty-printer and is especially good at such things as turning flat
N-Triples to RDF/XML or RDF/XML-Abbrev. such as:
rapper -q -i ntriples -o rdfxml-abbrev example.nt
Parser Changes
All parsers no longer generate
RAPTOR_IDENTIFIER_TYPE_PREDICATE as the statement
predicate type, as deprecated in 1.4.8. The replacement
type generated is RAPTOR_IDENTIFIER_TYPE_RESOURCE.
The Turtle parser now has true and false
boolean literals, which were accidently omiited from the parser in
the 1.4.8 update.
Parsers can register capabilities for handling multiple mime types
with Q values. These are then used in WWW requests for content
in the Accept: header for HTTP. Added
raptor_parser_factory_add_mime_type for registering,
raptor_parser_get_accept_header to get the accept header
values for the types supported by one parser.
From the previous change, the RSS parser now accepts several
unregistered RSS mime types as well as the registered Atom one; the
RDF/XML parser accepts unregistered mime type text/rdf
seen occasionally; the Turtle parser accepts several experimental
mime types. All unregistered or experimental types are accepted with
lower Q than any registered type.
The RSS Tag Soup parser for RSS* and Atom no longer requires
libxml2 (for it's XML Reader API). Internal changes mean that it
will fully work on top of expat.
Serializer Changes
The RSS/Atom serializer now uses input namespace declarations to
choose namespaces on output.
Added raptor_serialize_set_namespace_from_namespace
to set a namespace for serializing from an existing
raptor_namespace.
Serializing to RDF/XML (or RDF/XML Abbrev) now does not
double-free URI strings.
Fixes Issue #0000065
RSS serializer no longer writes the XML header twice.
IOStream Class Changes
Added raptor_iostream_write_uri to directly write a URI
to an iostream without the need to go via a string.
Fixed bug in raptor_iostream_write_xml_any_escaped_string
failing to write ';' after escaping U+0009 and U+000A
Namespaces Class Changes
Added raptor_namespaces_qname_from_uri to do URI
splitting into qname prefering to use the current in-scope namespaces
before having to search.
raptor_namespaces_format now NULL-terminates the namespace string.
Fixes Issue #0000062
Added raptor_namespace_get_counted_prefix to return a
namespace prefix and it's length.
QName Class Changes
Added raptor_qname_get_namespace to get the namespace
associated with a QName.
StringBuffer Class Changes
raptor_stringbuffer_append_counted_string and
raptor_stringbuffer_append_string now Do nothing on
appending a NULL string or a string of length 0.
Fixes Issue #0000073
Unicode Class Changes
raptor_utf8_to_unicode_char now also checks for
overlong UTF-8 sequences, illegal code positions or out of range
codes.
URI Class Changes
Deprecated raptor_uri_is_file_uri which takes a
URI string argument for new function raptor_uri_string_is_file_uri
which more clearly says that.
Changed all URI string calloc/mallocs to add enough room for a
full pointer at the string end to stop valgrind moaning on 64bit
systems when looking for the end of string NUL.
raptor_uri_set_handler and
raptor_new_iostream_from_handler now take const
handler arguments.
WWW Class Changes
Get the curl success status into a long, not an int which causes
failure on 64 bit.
Fixes Issue #0000075
WWW requests for content to parse now always send an appropriate
Accept: header with Q values for the parser, or for the
guess parser, all supported mime types.
Internal Changes
Added XML element methods
raptor_xml_element_get_attributes and
raptor_xml_element_get_attributes_count,
raptor_xml_element_is_empty
to the SAX2 API.
Many internal changes were made to the SAX2 API to finally
separate XML and RDF/XML parts. The SAX2 API is now fully usable on
either libxml2 or expat. That last sentence implies a lot of work,
by the way.
A large source re-arrangement was performed. All C sources and
headers that build the library are now in the src dir, general
documentation in the doc dir and utilities in the utils dir. This
both tidied up the mixture of files at the top level and also enabled
better use with gtk-doc.
Future API change: From the next release of
Raptor, raptor_statement predicates will return
identifiers of type RAPTOR_IDENTIFIER_TYPE_RESOURCE
instead of RAPTOR_IDENTIFIER_TYPE_PREDICATE.
Identifiers of type RAPTOR_IDENTIFIER_TYPE_ORDINAL may
no longer be returned in any statement position (to be confirmed).
Version Control change: Raptor will be switching to use
Subversion
for version control after the 1.4.8 release. Please check the
Redland Subversion site
for the latest status or the online
Raptor installation notes
for the raptor specific subversion installation information.
Configuration Changes
The autogen.sh script for building from CVS was revamped to be
more modular.
configure now takes an --enable-gtk-doc
option to enable building of the documentation using the
gtk-doc utility. It is by default enabled only if the
utility is available.
Added a new configure option --enable-serializers (in
1.4.7) to allow the selection of the required RDF serializers from
any of those supported.
raptor-config now has a --options
argument to list the configured or discovered options of the library
such as parsers, serializers and other choices.
Documentation Changes
The GNOME gtk-doc program is now used to
automatically extract documentation from source comments into
reference documentation. This is then merged with templates and
additional documentation to provide a reference manual for raptor
as XML document which is turned into HTML along with GNOME devhelp
support.
This new documentation intended to replace the libraptor manual
page/web page as easier to read document with scope for better
expanding with more detail of raptor including examples and tutorial
information. The manual page will continue to contain the summary
information for the present.
Portability Changes
Fixed a long-standing URI resolution bug on win32 - only remove
leading / if there is one present (patch from John C. Barstow)
rapper utility Changes
Altered the -g argument to invoke the guessing parser
rather than guess on file/URI name alone. This is now equivalent to
choosing an input syntax of guess with -i guess.
Added a --show-namespaces long option (no short version)
to show namespaces that are declared in the parsed content.
Parser Changes
A new guessing parser was added, picking the actual parser to use
at run-time based on protocol or other information.
Allow a content type returned by a protocol (such as HTTP) to
enable choosing of parser at run-time. Added a new optional
parser factory method content_type_handler to return this.
Allow parsers to handle several syntaxes rather than only 1 or 2.
Parsers can now return namespace prefix/URI declarations as
they are given in the content by the means of a new handler type
raptor_namespace_handler and parser method
raptor_set_namespace_handler. Duplicate namespace
prefix/URIs can be returned.
A new parser that guesses the actual parser to use at run-time
based on a combination of MIME Content-Type, file or URI name and in
future, iniital bytes of the content. If the Content-Type is an
exact match to a known parser, it is always chosen before trying
heuristics.
RDF/XML Parser Changes
When emitting literals, handle a datatyped empty literal. This
is a post-REC errata for the revised RDF/XML recommendation.
See
archived example
for further information.
RSS Tag Soup Parser Changes
Added atom 1.0 support including use of the new namespace. Atom
0.3 namespace terms are turned into new properties. Replace atom
copies of Dublin Core or RSS properties with the original terms:
Atom 1.0 term
Original term
atom:content
rss:description
atom:id
rss:link
atom:published
dc:date
atom:rights
dc:rights
atom:title
rss:title
Apply the in-scope base URI (such as from xml:base)
to atom 1.0 fields that take URI values:
atom:id, atom:icon and atom:logo.
Added optional date parsing code to turn XML RSS date fields into
ISO format ones, suitable for Atom and XML schema datatypes format.
Will use library parsedate code from curl or INN if available.
XML RSS field pubDate is now turned into Dublin Core
dc:date field in the ISO format.
XML RSS field content is turned into
content:encoded in RDF triples on output with
escaping.
Turtle Parser Changes
Updated to support Turtle version 2006-01-02
(announcement).
Switch qname, blank node and prefix definitions to SPARQL ones.
Check for illegal not-hexadecimal \u and \U escape values.
Fix greedy matching of long literals ("""....""") that ended on
the last """ found rather than the first.
Added double and decimal constants.
Added optional +- sign to all numeric constants.
Allow \" escape inside long strings.
Take care to reset the generated raptor_statement
language and datatype fields when not used.
Serializer Changes
Added a new Atom 1.0 serializer (name atom)
by parameterising the RSS 1.0 serializer.
Added a new Adobe XMP compatible serializer (name rdfxml-xmp)
by parameterising the RDF/XML Abbreviated serializer. Patch provided by
Sid Steward.
All serializers can be chosen at configure time from
those available using configure option --enable-serializers.
The RSS parser and serializer can now be independently enabled or
disabled. The RSS serializer no longer requires an XML parser.
RDF/XML Serializer / XML Writer Changes
A new XML Writer feature
RAPTOR_FEATURE_WRITER_XML_VERSION was added to allow
chosing XML 1.0 (value 10) or XML 1.1 output (value 11). This
feature is also accepted by serializers as an option and used by the
RDF/XML and RDF/XML-Abbrev serializers.
A new XML Writer feature
RAPTOR_FEATURE_WRITER_XML_DECLARATION was added to allow
omitting the XML declaration (default true).
Added functions raptor_xml_any_escape_string()
and raptor_iostream_write_xml_any_escaped_string()
which take an XML version. The XML 1.0 functions give errors
when attempting to write #x1-#x1f (excluding #x9, #xA, #xD) or #x7F.
Atom 1.0 Serializer Changes
Added a new serializer using the Atom 1.0 format and namespace.
This reads RDF triples in the RSS 1.0 model, along with any
additional atom 1.0 properties and serializes an Atom 1.0 feed
file.
Adobe XMP Serializer Changes
Added a new serializer writing RDF/XML in the profile used by
Adobe XMP. Note that this does require RDF triples to be used in a
certain style; for example all triple subjects are the "current
documment" giving rdf:about="".
URI Class Changes
Fix a bug when adding a default path of / to a URI
in functions raptor_new_uri_for_xmlbase()
and raptor_new_uri_for_retrieval().
(Bug #0000045)
raptor_uri_equals was altered to accept NULL pointers,
which do not compare equal to a non-NULL URI. NULL does equal NULL.
Internal Changes
The internal SAX2 class was extensively changed so that remaining
interdependencies with the RDF/XML parser were removed and it can now
be re-used for other syntaxes cleanly. Several functions
were modified or added.
Removed old and hardly-tested internal support for XML entity
resolution (libxml only).
Fix a couple of crashes in the RSS tag soup parser / serializer
(Dave Beckett, Suzan Foster).
configure now looks for the
libxslt/xslt.h header as well as the
libxslt library and disables XSLT and GRDDL support it
if is missing. This catches systems with the libraries without
headers as has happened on some OSX versions.
In serializers rdfxml and rdfxml-abbrev, report failure to
serialize to RDF/XML if the predicate URI is not absolute.
Added a new parser for
Gleaning Resource Descriptions from Dialects of Languages (GRDDL)
which allows reading XHTML and XML as RDF triples by using profiles
in the document that declare XSLT transforms from the XHTML/XML
content into RDF/XML which is the RDF content. It does not
support all the GRDDL styles, for example
dataview:namespaceTransformation,
or perform recursive transformations.
The turtle parser now accepts """long literals"""
XML writer feature support were added in 1.4.5 and not documented.
The new functions are:
raptor_xml_writer_features_enumerate,
raptor_xml_writer_set_feature,
raptor_xml_writer_set_feature_string,
raptor_xml_writer_get_feature and
raptor_xml_writer_get_feature_string.
The three XML writer features added are
\fBRAPTOR_FEATURE_WRITER_AUTO_INDENT\fR with boolean value (default true)
to auto-indent the XML,
\fBRAPTOR_FEATURE_WRITER_AUTO_EMPTY\fR with boolean value (default true)
to automatically generate empty elements if a start/end element sequence
has no content and
\fBRAPTOR_FEATURE_WRITER_INDENT_WIDTH\fR with an integer value (default 2)
to set the indenting level for the XML.
New build configuration and portability fixes for win32 (John Barstow)
Portability fixes for win32 - added
SIZEOF_UNSIGNED_SHORT (Dave Viner, others)
Added a signing memory debugging system to aid checking when
raptor-allocated memory is freed in another library or vice-versa
enabled by --with-memory-signing configure option
(defaults to on in maintainer mode).
Fixed a few internal malloc/frees to use RAPTOR_MALLOC / RAPTOR_FREE
so that the above signed memory system worked.
RDF/XML serializer:
Use the maximal name when splitting a predicate.
Turn datatyped literals that are rdf:XMLLiteral into inline XML with
rdf:parseType="Literal" rather than XML-escaped.
RDF/XML abbreviated serializer:
Fix a crash when there is a NULL base URI.
Use the maximal name when splitting a predicate.
Turn datatyped literals that are rdf:XMLLiteral into inline XML with
rdf:parseType="Literal" rather than XML-escaped.
RSS tag soup parser:
Fix crash with unexpected use of alternate attribute.
Update from Suzan Foster to reflect the latest status of the
enclosure vocabulary and allow multiple common items and fields.
Added a new RDF/XML with abbreviations serializer
rdfxml-abbrev written by Steve Shepard which handles
several of the abbreviations specified by the
RDF/XML Syntax Specification (Revised)
W3C Recommendation. It is suitable for writing small documents as
there are known scaling issues.
The RSS tag soup parser was updated to work better when there is
no base URI given. It also now supports reading the
RSS 1.1 format and
turning it into RSS 1.0 model triples.
Deprecated raptor_ntriples_string_as_utf8_string as
rather too internal to be useful, since it only works with a parser.
More fixes to work around the broken libxml2 on Apple OSX 10.3.x
with inconsistent shared libraries / headers.
Experimental and incomplete Notation 3 parser - updated to match
changes to Turtle. CVS changes only, not enabled in standard builds.
Make the RSS tag soup parser handle RSS 0.9 namespace elements by
turning them into RSS 1.0.
Fix a couple of crashes in the RSS 1.0 serialiser when
no base URI is used.
Make raptor_uri_to_relative_counted_uri_string
work when the base or reference URI have no paths such as like
http://example.org
Added portability fixes for Win32 to get Raptor 1.4.3 building
with MS Visual Studio using expat and libcurl. The RAPTOR_INTERNAL
define was moved to the build configuration and defines added for
integral type sizes. Patch from Dave Viner (dviner at apache dot
org).
A release with the major new feature of an XML writer API.
This is now used along with a new supporting XML element class to
improve the existing RDF/XML serializer and to provide a new
RSS 1.0 serializer.
This API it is also used by the next release of
Rasqal to provide serializing
of query results to XML.
The new raptor_xml_writer class functions added are:
raptor_new_xml_writer (constructor),
raptor_free_xml_writer (destructor),
raptor_xml_writer_empty_element,
raptor_xml_writer_start_element,
raptor_xml_writer_end_element,
raptor_xml_writer_cdata,
raptor_xml_writer_cdata_counted,
raptor_xml_writer_raw,
raptor_xml_writer_raw_counted,
raptor_xml_writer_comment and
raptor_xml_writer_comment_counted.
The new raptor_xml_element class functions added are:
raptor_new_xml_element (constructor),
raptor_free_xml_element (destructor),
raptor_xml_element_get_name,
raptor_xml_element_set_attributes,
raptor_xml_element_declare_namespace and
raptor_iostream_write_xml_element.
Parser Changes
RSS tag soup parser now works with older libxml2s (2.5.10+),
including the one shipped with some Apple OSX versions that has an
inconsistent header file and library.
RSS tag soup parser recognises/scores more common XML RSS file names.
RSS tag soup parser turns XML RSS
<guid isPermaLink="true">val</guid>
into RDF/XML form <guid rdf:resource="val"/>, leaving
the non isPermaLink form to be a literal value.
A bug was found in libxml2 that causes double expanding of XML
entities in RDF/XML. This has been reported but cannot be worked
around from raptor. The expat XML parser can be used as an
alternative, as it does not have this problem. A test was added for
this bug but it will not cause the test suite ('make check') to
fail.
Added additional
Turtle
parser tests that cover Notation 3 syntax that is not part of the
Turtle language.
Added
raptor_parser_set_feature_string and
raptor_parser_get_feature_string
methods to set/get string feature values.
Serializer Changes
Added feature relative_uris for serializers. This
is used by the RDF/XML serializer and enabled by default.
Added feature start_uri for serializers with a string
value to set the start URI for serializing. Not used at present.
Added new methods raptor_serializer_features_enumerate
to list serializer features and functions to set/get serializer
feature integer or strings values:
raptor_serializer_set_feature,
raptor_serializer_get_feature,
raptor_serializer_set_feature_string and
raptor_serializer_get_feature_string.
Added raptor_serialize_set_namespace to allow user
declaration of prefix/URI namespaces pairs as serializing hints.
Added raptor_uri_print to print a URI to a file handle.
Added methods raptor_uri_to_string and
raptor_uri_to_counted_string to return a URI as newly
allocated strings.
I/O Stream Changes
Many classes gained methods to write to iostreams, supporting the
new XML Writer class functionality. The added methods are:
raptor_iostream_write_namespace,
raptor_iostream_write_ntriples_string,
raptor_iostream_write_qname,
raptor_iostream_write_statement_ntriples,
raptor_iostream_write_stringbuffer,
raptor_iostream_write_xml_element and
raptor_iostream_write_xml_escaped_string.
Namespace Class Changes
Added raptor_namespace_copy copy
constructor and raptor_new_namespace_from_uri
constructor to build a namespace from a raptor_uri object.
Added utility function raptor_new_namespace_parts_from_string
to decode syntax of the form
xmlns:prefix="uri"
into prefix and uri string pairs.
Added raptor_namespaces_find_namespace_by_uri method
for namespace stack to find a declared namespace by URI. This
complements raptor_namespaces_find_namespace which
already provides searching by prefix.
Unicode and UTF-8 Changes
Added several methods for checking characters forming
parts of XML 1.0 or XML 1.1 names:
raptor_unicode_is_xml10_namestartchar,
raptor_unicode_is_xml11_namestartchar,
raptor_unicode_is_xml10_namechar and
raptor_unicode_is_xml11_namechar.
Added a function raptor_utf8_check to check that a
string is legal UTF-8 and all the encoded Unicode characters are in
the range U+0 <= character <= U+10FFFF
Added a function raptor_xml_name_check to check that
a string is a legal XML name (1.0 or 1.1) as well as legal UTF-8.
Other Changes
Feature support: Added raptor_feature_value_type to
determine value of a feature - either integer (most) or string.
XML QName class: Added raptor_qname_copy copy
constructor.
Sequence class: Added raptor_sequence_join
to join two sequences of items, leaving one empty.
Statement class: Added raptor_statement_copy copy
constructor and raptor_free_statement destructor.
Previously these were internal to raptor.
The rapper utility was modified to add a feature form:
-f xmlns:PREFIX="URI"
allowing the setting of output serializer namespaces.
The namespace URI string constants exported by raptor are now of
type unsigned char*.
Fixed a buffer overrun in decoding a URI scheme in
raptor_uri constructors such as
raptor_new_uri.
Fixed a crash in RSS enclosures crash when the url
attribute seen on a non-<enclosure> element
raptor_xml_escape_string return value has changed to
be an int, returning <0 on failure. This allows the empty string
encoding an empty string case to work and be distinguished from an
error.
A release with the major new feature of providing serializing of
RDF triples to syntaxes. It also added a new support class for I/O
streams and had other minor fixes.
Added a Raptor Serializer class (raptor_serializer)
with similar style to Parser (raptor_parser). Two
serializers are provided, for RDF/XML and N-Triples. The serializing
can be done to files, C FILE* or to strings. The
raptor_iostream class that provides this also allows writing
to any other form by creating a custom iostream.
The new raptor_serializer class functions added are:
raptor_serializers_enumerate,
raptor_serializer_syntax_name_check,
raptor_new_serializer,
raptor_free_serializer,
raptor_serialize_start,
raptor_serialize_start_to_filename,
raptor_serialize_start_to_string,
raptor_serialize_start_to_file_handle,
raptor_serialize_statement,
raptor_serialize_end,
raptor_serializer_get_iostream,
raptor_serializer_set_error_handler,
raptor_serializer_set_warning_handler and
raptor_serializer_get_locator
Added a Raptor I/O stream abstraction in
raptor_iostream class to support serializing of RDF to
multiple output streams such as to filenames, to C standard I/O
FILE* handles and to strings especially for
cross-language use. A raptor_iostream_handler can
be used to construct a user-defined iostream.
The new raptor_iostream class functions added are:
raptor_new_iostream_from_handler,
raptor_new_iostream_to_sink,
raptor_new_iostream_to_filename,
raptor_new_iostream_to_file_handle,
raptor_new_iostream_to_string,
raptor_free_iostream,
raptor_iostream_write_bytes,
raptor_iostream_write_byte,
raptor_iostream_write_end,
raptor_iostream_write_string,
raptor_iostream_write_counted_string,
raptor_iostream_get_bytes_written_count,
raptor_iostream_write_decimal and
raptor_iostream_format_hexadecimal.
The rapper utility was modified to use serializer
class so that the output formats supported are now N-Triples
(-o ntriples) - the default, and RDF/XML (-o
rdfxml).
Raptor now exports more static namespace URI strings for
general application use:
raptor_xml_namespace_uri,
raptor_rdf_namespace_uri,
raptor_rdf_schema_namespace_uri,
raptor_xmlschema_datatypes_namespace_uri,
raptor_owl_namespace_uri,
and the length
raptor_rdf_namespace_uri_len.
The raptor_stringbuffer class gained a new method
raptor_stringbuffer_copy_to_string
which allows efficient copy-out of a constructed string.
The raptor_www class gained a new method
raptor_www_fetch_to_string to allow retrieving of
web content as a single string.
RSS tag soup parser gained support for generating triples for
enclosures, after a patch from Suzan Foster. Changes made include
correcting the enclosures namespace and tidying some memory leaks.
A release with major improvements along with several minor fixes.
Raptor's License was changed from LGPL 2.1/MPL 1.1 to
LGPL 2.1/Apache 2
Thanks to Chris Pointon for several patches to make Raptor
easier to build under Win32 which were applied, with some slight
modifications.
Increased WWW content retrieval buffer size from 256 bytes to 4K
since this was causing problems for even moderate size documents.
After testing raptor on a very large RDF/XML file with many
rdf:ID values, the check for duplicate values was found
to be inefficient in memory and slow. The implementation was
improved to be more memory efficient and a new parser feature
check_rdf_id was added to disable checking (default is
enabled).
Added a new Unicode NFC checker to replace the functionality
formally available by calling the GNOME glib function
g_utf8_normalize. This new checker is done via several tables and
adds approximately 50K to the object size of the library when
compiled on x86. This code and tables can be disabled with configure
option --disable-nfc-check causing all checks to
succeed.
Fix the exporting of
raptor_xml_literal_datatype_uri_string and
raptor_xml_literal_datatype_uri_string_len as constants
for use by applications. Previously raptor.h wasn't doing this
correctly.
Added raptor_calloc_memory for allocating zeroed
memory inside raptor, for use by applications passing memory in/out
of raptor.
Added a new configure option --enable-parsers to
allow the selection of the required RDF parsers from any of those
supported (RDF/XML, Turtle, N-Triples, RSS tag soup).
Reorganised the sources to split parsing support from RDF/XML
to support compiling without this parser.
Altered the Turtle parser to work with large source documents that
exceeded bison limits. Thanks to Geoff Chappell for providing a fix for
this.
Rewrote the URI parsing to create an internal structure and
improved the relative URI resolving in preparation for future work
such as potentially supporting URI canonicalisation such as proposed
to be used by Atom.
Added a new configure option
--with-expat-source=DIR
to allow the use of external expat source trees in either the old or
newer directory structure style. (Patch from Mark Smith).
Added raptor_alloc_memory for handlers that need to
allocate memory in the same heap as raptor uses for
raptor_free_memory. This is mostly useful for allocating
memory that is freed by raptor in error, ID and statement handlers
on win32 which has separate heaps for different DLLs.
A bug was fixed where errors which happened when fetching WWW
content were always printed to stderr. They are now passed to the
main error routines which allows applications to retrieve them.
Accessor functions were added for parts of the public
raptor_locator structure which makes it possible to get
structured error information from language bindings via Redland
(Patch from Edd Dumbill). The new functions are:
int raptor_locator_line(raptor_locator *locator);
int raptor_locator_column(raptor_locator *locator);
The Unicode Normal Form C (NFC) checking via the GNOME glib
library function g_utf8_normalize is broken, comparing
the data it says is failed against other NFC checkers. It is also
slower than need be since it is doing full normalizing rather than
just checking for NFC, and adds a rather large dependency for just
one function. A new portable checker will be added in a later
release.
A release primarily to fix some win32 and portability issues.
raptor.h now includes stdarg.h
Corrected the raptor_print_statement declaration in
raptor.h for the argument statement to have one less 'const' which
matches the actual code.
Made several portability fixes for compiling natively on win32
which doesn't quite do POSIX or C99.
Changed the support for file: URIs and converting to and from
filenames. It now %-escapes spaces and % characters on conversion
to and from filenames with
raptor_uri_uri_string_to_filename,
raptor_uri_uri_string_to_filename_fragment
and
raptor_uri_filename_to_uri_string.
For Win32, more tests were added and the
format of URIs supported corrected to use the file:///c:
form rather than file://c|/
URIs that resolve to directories now return an error when lstat is
available to check.
Parser Changes
The
Turtle
parser was updated to only allow language with non-datatyped literals,
allow a '_' immediately after a ':' in qnames and to make a bare ':'
qname work correctly.
The Turtle parser was fixed to re-initialise correctly when
performing multiple parsings. The other parsers already did this
correctly.
Added a warning to the RDF/XML parser for unknown
rdf:parseType values, when parsing in lax mode - which
is the default. It now tells the user when the parsing is working as
'Literal' mode by finding an unknown value. This is controlled by a
new parser feature warn_other_parsetypes which is default set true
in lax mode. Parser modes are controlled by the
raptor_set_parser_strict method.
A release primarily to provide support for
the new Rasqal
RDF query library but with some new features and fixes.
Parser Changes
Added a new constructor
raptor_new_parser_for_content to guess the parser to use
from hints in URIs or content, using a new utility function
raptor_guess_parser_name.
Additional checks were added to the RDF/XML parser for
RDF-namespaced names in element and attributes and if they are
forbidden giving an error otherwise if unknown, giving a warning.
The
Turtle
parser was updated to correct the collections syntax, allow '-' in
names and QNames and to add integer literals. This parser now correctly
uses raptor_generate_id when a blank identifier name is
needed.
Completed parser feature support by adding raptor_get_feature,
raptor_feature_from_uri, and
raptor_features_enumerate to get values and enable
discovery of supported features at run time.
raptor_set_feature was changed to give return a success
value
Added a new method raptor_get_mime_type to get the
MIME type of the syntax for a parser
raptor_parse_uri_with_connection (which is called by
raptor_parse_uri) now sets the HTTP Accept:
header to the MIME type of the parser in WWW requests using the new
raptor_www_set_http_accept().
rapper changes
Added options -f/--feature for setting
features and -g/--guess for guessing syntax
from some content or identifiers. See rapper(1)
for all rapper options.
Utility function changes
Added raptor_syntax_name_check to check for valid
syntax language names.
Added raptor_free_memory to free memory returned by
raptor functions.
Added Unicode utility functions raptor_unicode_char_to_utf8 and
raptor_utf8_to_unicode_char.
Exported URI string raptor_xml_literal_datatype_uri_string.
Deprecated raptor_print_statement_detailed always
intended to be internal.
WWW Class changes
Added support to set the HTTP Accept: header for curl
and libxml2 when retrieving HTTP content by the new
raptor_www_set_http_accept method.
New classes - Sequence and Stringbuffer
Added a utility class raptor_sequence providing
simple sequences that can handle stacks and queues
Added a utility class raptor_stringbuffer
for constructing strings from substrings appended or prepended.
raptor2-2.0.16/raptor2.spec.in 0000644 0001750 0001750 00000007171 12457550461 013003 0000000 0000000 # -*- RPM-SPEC -*-
%define name @PACKAGE@
%define version @VERSION@
%define release @RPM_RELEASE@
Summary: Raptor RDF Parser Toolkit for Redland
Name: %{name}
Version: %{version}
Release: %{release}
Prefix: %{_prefix}
License: LGPLv2+ or ASL 2.0
Group: Development/Libraries
Source: http://download.librdf.org/source/%{name}-%{version}.tar.gz
URL: http://librdf.org/raptor/
BuildRoot: /tmp/%{name}-%{version}
BuildRequires: libxml2 libxml2-devel >= 2.6.8
BuildRequires: curl curl-devel
BuildRequires: libxslt libxslt-devel
Packager: Dave Beckett
Docdir: %{_docdir}
%description
Raptor is the RDF Parser Toolkit for Redland that provides a set of
Resource Description Framework (RDF) parsers and serializers,
generating RDF triples from the following syntaxes: RDF/XML,
N-Triples, TRiG, Turtle, RSS tag soup including all versions of RSS,
Atom 1.0 and 0.3, GRDDL and microformats for HTML, XHTML and XML. The
serializing RDF triples to syntaxes are: RDF/XML, RSS 1.0, Atom 1.0,
N-Triples, XMP, Turtle, GraphViz DOT and JSON.
%package devel
Summary: Libraries, includes etc to develop with Raptor RDF parser library
Group: Development/Libraries
Requires: raptor = %{version}
Requires: libxml2-devel
%description devel
Libraries, includes etc to develop with Raptor RDF parser and
serializer library.
%prep
%setup -q
%build
%configure --enable-release
%{__make} OPTIMIZE="$RPM_OPT_FLAGS"
%install
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_mandir}/man1
install -d $RPM_BUILD_ROOT%{_mandir}/man3
%makeinstall
%clean
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-, root, root)
%doc AUTHORS COPYING COPYING.LIB ChangeLog LICENSE.txt NEWS README
%doc LICENSE-2.0.txt NOTICE
%doc *.html
%doc %{_mandir}/man1/rapper.1*
%doc %{_mandir}/man3/libraptor2.3*
%doc %{_datadir}/gtk-doc/html/raptor2/*
%{_libdir}/libraptor*.so.*
%{prefix}/bin/rapper
%files devel
%defattr(-, root, root)
%doc AUTHORS COPYING COPYING.LIB ChangeLog LICENSE.txt NEWS README
%doc LICENSE-2.0.txt NOTICE
%{_libdir}/libraptor2*.*
%{_libdir}/pkgconfig/raptor2.pc
%{prefix}/include/raptor2/*
%changelog
* Wed Jan 14 2015 Phil John
- Fix for wrong libdir causing errors when running rpmbuild
* Fri Jan 5 2007 Dave Beckett
- rename files for raptor 2.0.0
- no more raptor-config
- do not package libraptor*.la or libraptor*.a files
- includes are in a subdir
* Fri Jan 5 2007 Dave Beckett
- Document Turtle and DOT serializers
* Wed Feb 15 2006 Dave Beckett
- Add libxslt and libxslt-devel for GRDDL
* Wed Dec 20 2005 Dave Beckett
- Update description of parsers and serializers.
* Wed Nov 9 2005 Dave Beckett
- Add gtk-doc documentation
* Wed Aug 11 2005 Dave Beckett
- Update Source:
- Use %makeinstall
* Wed Aug 10 2005 Dave Beckett
- Use %configure and %{_make}
* Thu Sep 9 2004 Dave Beckett
- License now LGPL/Apache 2
- Added LICENSE-2.0.txt and NOTICE
* Tue May 11 2004 Dave Beckett
- Added RELEASE.html
* Thu Apr 17 2003 Dave Beckett
- Added pkgconfig raptor.pc, raptor-config
- Requires curl
* Mon Jan 13 2003 Dave Beckett
- rdfdump now rapper
* Fri Dec 20 2002 Dave Beckett
- Updated to have two RPMs for raptor and raptor-devel. Depend on
libxml2 as XML parser.
raptor2-2.0.16/aclocal.m4 0000644 0001750 0001750 00000132146 14377711061 011770 0000000 0000000 # generated automatically by aclocal 1.16.5 -*- Autoconf -*-
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
[m4_warning([this file was generated for autoconf 2.71.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# Copyright (C) 2002-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.16'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.16.5], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
# _AM_AUTOCONF_VERSION(VERSION)
# -----------------------------
# aclocal traces this macro to find the Autoconf version.
# This is a private macro too. Using m4_define simplifies
# the logic in aclocal, which can simply ignore this definition.
m4_define([_AM_AUTOCONF_VERSION], [])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.16.5])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# Copyright (C) 2011-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_AR([ACT-IF-FAIL])
# -------------------------
# Try to determine the archiver interface, and trigger the ar-lib wrapper
# if it is needed. If the detection of archiver interface fails, run
# ACT-IF-FAIL (default is to abort configure with a proper error message).
AC_DEFUN([AM_PROG_AR],
[AC_BEFORE([$0], [LT_INIT])dnl
AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl
AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([ar-lib])dnl
AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false])
: ${AR=ar}
AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],
[AC_LANG_PUSH([C])
am_cv_ar_interface=ar
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])],
[am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
AC_TRY_EVAL([am_ar_try])
if test "$ac_status" -eq 0; then
am_cv_ar_interface=ar
else
am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
AC_TRY_EVAL([am_ar_try])
if test "$ac_status" -eq 0; then
am_cv_ar_interface=lib
else
am_cv_ar_interface=unknown
fi
fi
rm -f conftest.lib libconftest.a
])
AC_LANG_POP([C])])
case $am_cv_ar_interface in
ar)
;;
lib)
# Microsoft lib, so override with the ar-lib wrapper script.
# FIXME: It is wrong to rewrite AR.
# But if we don't then we get into trouble of one sort or another.
# A longer-term fix would be to have automake use am__AR in this case,
# and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
# similar.
AR="$am_aux_dir/ar-lib $AR"
;;
unknown)
m4_default([$1],
[AC_MSG_ERROR([could not determine $AR interface])])
;;
esac
AC_SUBST([AR])dnl
])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
# therefore $ac_aux_dir as well) can be either absolute or relative,
# depending on how configure is run. This is pretty annoying, since
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
# source directory, any form will work fine, but in subdirectories a
# relative path needs to be adjusted first.
#
# $ac_aux_dir/missing
# fails when called from a subdirectory if $ac_aux_dir is relative
# $top_srcdir/$ac_aux_dir/missing
# fails if $ac_aux_dir is absolute,
# fails when called from a subdirectory in a VPATH build with
# a relative $ac_aux_dir
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
# harmless because $srcdir is '.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
# This will work as long as MISSING is not called from configure, because
# unfortunately $(top_srcdir) has no meaning in configure.
# However there are other variables, like CC, which are often used in
# configure, and could therefore not use this "fixed" $ac_aux_dir.
#
# Another solution, used here, is to always expand $ac_aux_dir to an
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
# Expand $ac_aux_dir to an absolute path.
am_aux_dir=`cd "$ac_aux_dir" && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ([2.52])dnl
m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
m4_define([_AM_COND_VALUE_$1], [$2])dnl
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
# dependency, and given that the user is not expected to run this macro,
# just rely on AC_PROG_CC.
AC_DEFUN([_AM_DEPENDENCIES],
[AC_REQUIRE([AM_SET_DEPDIR])dnl
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
[$1], [CXX], [depcc="$CXX" am_compiler_list=],
[$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
[$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
[$1], [UPC], [depcc="$UPC" am_compiler_list=],
[$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named 'D' -- because '-MD' means "put the output
# in D".
rm -rf conftest.dir
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
am__universal=false
m4_case([$1], [CC],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac],
[CXX],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac])
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
# Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
# Solaris 10 /bin/sh.
echo '/* dummy */' > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
# We check with '-c' and '-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle '-M -o', and we need to detect this. Also, some Intel
# versions had trouble with output in subdirs.
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
gcc)
# This depmode causes a compiler race in universal mode.
test "$am__universal" = false || continue
;;
nosideeffect)
# After this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested.
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
msvc7 | msvc7msys | msvisualcpp | msvcmsys)
# This compiler won't grok '-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
am__minus_obj=
;;
none) break ;;
esac
if depmode=$depmode \
source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
# When given -MP, icc 7.0 and 7.1 complain thusly:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
if (grep 'ignoring option' conftest.err ||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_$1_dependencies_compiler_type=none
fi
])
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
AM_CONDITIONAL([am__fastdep$1], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
])
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
AC_DEFUN([AM_SET_DEPDIR],
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
])
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE([dependency-tracking], [dnl
AS_HELP_STRING(
[--enable-dependency-tracking],
[do not reject slow dependency extractors])
AS_HELP_STRING(
[--disable-dependency-tracking],
[speeds up one-time build])])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
am__nodep='_no'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])dnl
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
AC_SUBST([am__nodep])dnl
_AM_SUBST_NOTMAKE([am__nodep])dnl
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[{
# Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
# TODO: see whether this extra hack can be removed once we start
# requiring Autoconf 2.70 or later.
AS_CASE([$CONFIG_FILES],
[*\'*], [eval set x "$CONFIG_FILES"],
[*], [set x $CONFIG_FILES])
shift
# Used to flag and report bootstrapping failures.
am_rc=0
for am_mf
do
# Strip MF so we end up with the name of the file.
am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile which includes
# dependency-tracking related rules and includes.
# Grep'ing the whole file directly is not great: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
|| continue
am_dirpart=`AS_DIRNAME(["$am_mf"])`
am_filepart=`AS_BASENAME(["$am_mf"])`
AM_RUN_LOG([cd "$am_dirpart" \
&& sed -e '/# am--include-marker/d' "$am_filepart" \
| $MAKE -f - am--depfiles]) || am_rc=$?
done
if test $am_rc -ne 0; then
AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
for automatic dependency tracking. If GNU make was not used, consider
re-running the configure script with MAKE="gmake" (or whatever is
necessary). You can also try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).])
fi
AS_UNSET([am_dirpart])
AS_UNSET([am_filepart])
AS_UNSET([am_mf])
AS_UNSET([am_rc])
rm -f conftest-deps.mk
}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
# AM_OUTPUT_DEPENDENCY_COMMANDS
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking is enabled.
# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
# order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
m4_define([AC_PROG_CC],
m4_defn([AC_PROG_CC])
[_AM_PROG_CC_C_O
])
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
# The call with PACKAGE and VERSION arguments is the old style
# call (pre autoconf-2.50), which is being phased out. PACKAGE
# and VERSION should now be passed to AC_INIT and removed from
# the call to AM_INIT_AUTOMAKE.
# We support both call styles for the transition. After
# the next Automake release, Autoconf can make the AC_INIT
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.65])dnl
m4_ifdef([_$0_ALREADY_INIT],
[m4_fatal([$0 expanded multiple times
]m4_defn([_$0_ALREADY_INIT]))],
[m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
# test to see if srcdir already configured
if test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
AC_SUBST([CYGPATH_W])
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
[AC_DIAGNOSE([obsolete],
[$0: two- and three-arguments forms are deprecated.])
m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
m4_if(
m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
[ok:ok],,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
AM_MISSING_PROG([AUTOCONF], [autoconf])
AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
AM_MISSING_PROG([AUTOHEADER], [autoheader])
AM_MISSING_PROG([MAKEINFO], [makeinfo])
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
#
#
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES([CC])],
[m4_define([AC_PROG_CC],
m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES([CXX])],
[m4_define([AC_PROG_CXX],
m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
[_AM_DEPENDENCIES([OBJC])],
[m4_define([AC_PROG_OBJC],
m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
[_AM_DEPENDENCIES([OBJCXX])],
[m4_define([AC_PROG_OBJCXX],
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
])
# Variables for tags utilities; see am/tags.am
if test -z "$CTAGS"; then
CTAGS=ctags
fi
AC_SUBST([CTAGS])
if test -z "$ETAGS"; then
ETAGS=etags
fi
AC_SUBST([ETAGS])
if test -z "$CSCOPE"; then
CSCOPE=cscope
fi
AC_SUBST([CSCOPE])
AC_REQUIRE([AM_SILENT_RULES])dnl
dnl The testsuite driver may need to know about EXEEXT, so add the
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
AC_CONFIG_COMMANDS_PRE(dnl
[m4_provide_if([_AM_COMPILER_EXEEXT],
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
# POSIX will say in a future version that running "rm -f" with no argument
# is OK; and we want to be able to make that assumption in our Makefile
# recipes. So use an aggressive probe to check that the usage we want is
# actually supported "in the wild" to an acceptable degree.
# See automake bug#10828.
# To make any issue more visible, cause the running configure to be aborted
# by default if the 'rm' program in use doesn't match our expectations; the
# user can still override this though.
if rm -f && rm -fr && rm -rf; then : OK; else
cat >&2 <<'END'
Oops!
Your 'rm' program seems unable to run without file operands specified
on the command line, even when the '-f' option is present. This is contrary
to the behaviour of most rm programs out there, and not conforming with
the upcoming POSIX standard:
Please tell bug-automake@gnu.org about your system, including the value
of your $PATH and any error possibly output before this message. This
can help us improve future automake versions.
END
if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
echo 'Configuration will proceed anyway, since you have set the' >&2
echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
echo >&2
else
cat >&2 <<'END'
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
that behaves properly: .
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
to "yes", and re-run configure.
END
AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
fi
fi
dnl The trailing newline in this macro's definition is deliberate, for
dnl backward compatibility and to allow trailing 'dnl'-style comments
dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
])
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
dnl mangled by Autoconf and run in a shell conditional statement.
m4_define([_AC_COMPILER_EXEEXT],
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
# loop where config.status creates the headers, so we can generate
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
_am_arg=$1
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
$_am_arg | $_am_arg:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
*)
install_sh="\${SHELL} $am_aux_dir/install-sh"
esac
fi
AC_SUBST([install_sh])])
# Copyright (C) 2003-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_MAINTAINER_MODE([DEFAULT-MODE])
# ----------------------------------
# Control maintainer-specific portions of Makefiles.
# Default is to disable them, unless 'enable' is passed literally.
# For symmetry, 'disable' may be passed as well. Anyway, the user
# can override the default with the --enable/--disable switch.
AC_DEFUN([AM_MAINTAINER_MODE],
[m4_case(m4_default([$1], [disable]),
[enable], [m4_define([am_maintainer_other], [disable])],
[disable], [m4_define([am_maintainer_other], [enable])],
[m4_define([am_maintainer_other], [enable])
m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode's default is 'disable' unless 'enable' is passed
AC_ARG_ENABLE([maintainer-mode],
[AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
am_maintainer_other[ make rules and dependencies not useful
(and sometimes confusing) to the casual installer])],
[USE_MAINTAINER_MODE=$enableval],
[USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
MAINT=$MAINTAINER_MODE_TRUE
AC_SUBST([MAINT])dnl
]
)
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_MAKE_INCLUDE()
# -----------------
# Check whether make has an 'include' directive that can support all
# the idioms we need for our automatic dependency tracking code.
AC_DEFUN([AM_MAKE_INCLUDE],
[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
cat > confinc.mk << 'END'
am__doit:
@echo this is the am__doit target >confinc.out
.PHONY: am__doit
END
am__include="#"
am__quote=
# BSD make does it like this.
echo '.include "confinc.mk" # ignored' > confmf.BSD
# Other make implementations (GNU, Solaris 10, AIX) do it like this.
echo 'include confinc.mk # ignored' > confmf.GNU
_am_result=no
for s in GNU BSD; do
AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
AS_CASE([$?:`cat confinc.out 2>/dev/null`],
['0:this is the am__doit target'],
[AS_CASE([$s],
[BSD], [am__include='.include' am__quote='"'],
[am__include='include' am__quote=''])])
if test "$am__include" != "#"; then
_am_result="yes ($s style)"
break
fi
done
rm -f confinc.* confmf.*
AC_MSG_RESULT([${_am_result}])
AC_SUBST([am__include])])
AC_SUBST([am__quote])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it is modern enough.
# If it is, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
if test x"${MISSING+set}" != xset; then
MISSING="\${SHELL} '$am_aux_dir/missing'"
fi
# Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then
am_missing_run="$MISSING "
else
am_missing_run=
AC_MSG_WARN(['missing' script is too old or missing])
fi
])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
# --------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
# _AM_SET_OPTIONS(OPTIONS)
# ------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_PROG_CC_C_O
# ---------------
# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
# to automatically call this.
AC_DEFUN([_AM_PROG_CC_C_O],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([compile])dnl
AC_LANG_PUSH([C])dnl
AC_CACHE_CHECK(
[whether $CC understands -c and -o together],
[am_cv_prog_cc_c_o],
[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
# Make sure it works both with $CC and with simple cc.
# Following AC_PROG_CC_C_O, we do the test twice because some
# compilers refuse to overwrite an existing .o file with -o,
# though they will create one.
am_cv_prog_cc_c_o=yes
for am_i in 1 2; do
if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
&& test -f conftest2.$ac_objext; then
: OK
else
am_cv_prog_cc_c_o=no
break
fi
done
rm -f core conftest*
unset am_i])
if test "$am_cv_prog_cc_c_o" != yes; then
# Losing compiler, so override with the script.
# FIXME: It is wrong to rewrite CC.
# But if we don't then we get into trouble of one sort or another.
# A longer-term fix would be to have automake use am__CC in this case,
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
CC="$am_aux_dir/compile $CC"
fi
AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_RUN_LOG(COMMAND)
# -------------------
# Run COMMAND, save the exit status in ac_status, and log it.
# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
AC_DEFUN([AM_RUN_LOG],
[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
(exit $ac_status); }])
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
'
case `pwd` in
*[[\\\"\#\$\&\'\`$am_lf]]*)
AC_MSG_ERROR([unsafe absolute working directory name]);;
esac
case $srcdir in
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
esac
# Do 'set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
am_has_slept=no
for am_try in 1 2; do
echo "timestamp, slept: $am_has_slept" > conftest.file
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t "$srcdir/configure" conftest.file`
fi
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
if test "$[2]" = conftest.file || test $am_try -eq 2; then
break
fi
# Just in case.
sleep 1
am_has_slept=yes
done
test "$[2]" = conftest.file
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
AC_MSG_RESULT([yes])
# If we didn't sleep, we still need to ensure time stamps of config.status and
# generated files are strictly newer.
am_sleep_pid=
if grep 'slept: no' conftest.file >/dev/null 2>&1; then
( sleep 1 ) &
am_sleep_pid=$!
fi
AC_CONFIG_COMMANDS_PRE(
[AC_MSG_CHECKING([that generated files are newer than configure])
if test -n "$am_sleep_pid"; then
# Hide warnings about reused PIDs.
wait $am_sleep_pid 2>/dev/null
fi
AC_MSG_RESULT([done])])
rm -f conftest.file
])
# Copyright (C) 2009-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_SILENT_RULES([DEFAULT])
# --------------------------
# Enable less verbose build rules; with the default set to DEFAULT
# ("yes" being less verbose, "no" or empty being verbose).
AC_DEFUN([AM_SILENT_RULES],
[AC_ARG_ENABLE([silent-rules], [dnl
AS_HELP_STRING(
[--enable-silent-rules],
[less verbose build output (undo: "make V=1")])
AS_HELP_STRING(
[--disable-silent-rules],
[verbose build output (undo: "make V=0")])dnl
])
case $enable_silent_rules in @%:@ (((
yes) AM_DEFAULT_VERBOSITY=0;;
no) AM_DEFAULT_VERBOSITY=1;;
*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
esac
dnl
dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
dnl do not support nested variable expansions.
dnl See automake bug#9928 and bug#10237.
am_make=${MAKE-make}
AC_CACHE_CHECK([whether $am_make supports nested variables],
[am_cv_make_support_nested_variables],
[if AS_ECHO([['TRUE=$(BAR$(V))
BAR0=false
BAR1=true
V=1
am__doit:
@$(TRUE)
.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
am_cv_make_support_nested_variables=yes
else
am_cv_make_support_nested_variables=no
fi])
if test $am_cv_make_support_nested_variables = yes; then
dnl Using '$V' instead of '$(V)' breaks IRIX make.
AM_V='$(V)'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
else
AM_V=$AM_DEFAULT_VERBOSITY
AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
fi
AC_SUBST([AM_V])dnl
AM_SUBST_NOTMAKE([AM_V])dnl
AC_SUBST([AM_DEFAULT_V])dnl
AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
AM_BACKSLASH='\'
AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_STRIP
# ---------------------
# One issue with vendor 'install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
# always use install-sh in "make install-strip", and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
# Installed binaries are usually stripped using 'strip' when the user
# run "make install-strip". However 'strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the 'STRIP' environment variable to overrule this program.
dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])
# AM_SUBST_NOTMAKE(VARIABLE)
# --------------------------
# Public sister of _AM_SUBST_NOTMAKE.
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
# FORMAT should be one of 'v7', 'ustar', or 'pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
# $tardir.
# tardir=directory && $(am__tar) > result.tar
#
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
#
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AC_SUBST([AMTAR], ['$${TAR-tar}'])
# We'll loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
m4_if([$1], [v7],
[am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
[m4_case([$1],
[ustar],
[# The POSIX 1988 'ustar' format is defined with fixed-size fields.
# There is notably a 21 bits limit for the UID and the GID. In fact,
# the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
# and bug#13588).
am_max_uid=2097151 # 2^21 - 1
am_max_gid=$am_max_uid
# The $UID and $GID variables are not portable, so we need to resort
# to the POSIX-mandated id(1) utility. Errors in the 'id' calls
# below are definitely unexpected, so allow the users to see them
# (that is, avoid stderr redirection).
am_uid=`id -u || echo unknown`
am_gid=`id -g || echo unknown`
AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
if test $am_uid -le $am_max_uid; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
_am_tools=none
fi
AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
if test $am_gid -le $am_max_gid; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
_am_tools=none
fi],
[pax],
[],
[m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
# Go ahead even if we have the value already cached. We do so because we
# need to set the values for the 'am__tar' and 'am__untar' variables.
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
for _am_tool in $_am_tools; do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar; do
AM_RUN_LOG([$_am_tar --version]) && break
done
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x $1 -w "$$tardir"'
am__tar_='pax -L -x $1 -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
am__untar='cpio -i -H $1 -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_$1}" && break
# tar/untar a dummy directory, and stop if the command works.
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
rm -rf conftest.dir
if test -s conftest.tar; then
AM_RUN_LOG([$am__untar /dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
m4_include([build/gtk-doc.m4])
m4_include([build/libtool.m4])
m4_include([build/ltoptions.m4])
m4_include([build/ltsugar.m4])
m4_include([build/ltversion.m4])
m4_include([build/lt~obsolete.m4])
m4_include([build/pkg.m4])
raptor2-2.0.16/COPYING 0000644 0001750 0001750 00000043103 10444336174 011154 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
raptor2-2.0.16/utils/ 0000755 0001750 0001750 00000000000 14377724264 011352 5 0000000 0000000 raptor2-2.0.16/utils/CMakeLists.txt 0000644 0001750 0001750 00000001341 14247005517 014016 0000000 0000000 # raptor/utils/CMakeLists.txt
#
# Original listfile by Daniel Richard G.
# This file is in the public domain.
#
INCLUDE_DIRECTORIES(BEFORE
${CMAKE_CURRENT_SOURCE_DIR}/../src
${CMAKE_BINARY_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}
)
IF(NOT HAVE_GETOPT AND NOT HAVE_GETOPT_LONG)
SET(getopt_sources getopt.c raptor_getopt.h)
ENDIF(NOT HAVE_GETOPT AND NOT HAVE_GETOPT_LONG)
ADD_EXECUTABLE(rapper rapper.c ${getopt_sources})
TARGET_LINK_LIBRARIES(rapper raptor2)
ADD_EXECUTABLE(rdfdiff rdfdiff.c ${getopt_sources})
TARGET_LINK_LIBRARIES(rdfdiff raptor2)
INSTALL(FILES rapper.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
INSTALL(TARGETS rapper DESTINATION ${CMAKE_INSTALL_BINDIR})
# end raptor/utils/CMakeLists.txt
raptor2-2.0.16/utils/getopt.c 0000644 0001750 0001750 00000007106 11472513121 012721 0000000 0000000 /*
* Public Domain getopt - history below
*
*/
/*
* From: gwyn@brl-tgr.ARPA (Doug Gwyn ) Newsgroups: net.sources
* Subject: getopt library routine Date: 30 Mar 85 04:45:33 GMT
*/
/*
* getopt -- public domain version of standard System V routine
*
* Strictly enforces the System V Command Syntax Standard; provided by D A
* Gwyn of BRL for generic ANSI C implementations
*
* #define STRICT to prevent acceptance of clustered options with arguments
* and ommision of whitespace between option and arg.
*/
/*
* Modified by Manuel Novoa III on 1/5/01 to use weak symbols.
* Programs needing long options will link gnu_getopt instead.
*/
/*
* Last public domain version 1.5 downloaded from uclibc CVS:
* http://www.uclibc.org/cgi-bin/cvsweb/uClibc/libc/unistd/getopt.c
* on 2003-02-18 by Dave Beckett and tidied:
* Ran through "indent getopt.c -gnu" then fixed up the mess
* Removed register - compilers are smart these days
* ANSI-fied the declarations
* Prefixed with raptor_ so that it doesn't clash with any getopt
* linked in later.
*/
#include
#include
#include
int opterr; /* error => print message */
int optind; /* next argv[] index */
int optopt; /* Set for unknown arguments */
char *optarg; /* option parameter if any */
/*
* Err:
* program name argv[0]
* specific message
* defective option letter
*/
static int
Err (char *name, char *mess, int c) /* returns '?' */
{
optopt = c;
if(opterr)
{
(void) fprintf (stderr, "%s: %s -- %c\n", name, mess, c);
}
return '?'; /* erroneous-option marker */
}
int
getopt (int argc, char * const argv[], const char *optstring)
{
static int sp = 1; /* position within argument */
int osp; /* saved `sp' for param test */
#ifndef STRICT
int oind; /* saved `optind' for param test */
#endif
int c; /* option letter */
char *cp; /* -> option in `optstring' */
optarg = NULL;
/* initialise getopt vars */
if(optind == 0)
{
optind = 1;
opterr = 1;
optopt = 1;
optarg = NULL;
}
if(sp == 1)
{ /* fresh argument */
if(optind >= argc /* no more arguments */
|| argv[optind][0] != '-' /* no more options */
|| argv[optind][1] == '\0' /* not option; stdin */
)
return EOF;
else if(strcmp (argv[optind], "--") == 0)
{
++optind; /* skip over "--" */
return EOF; /* "--" marks end of options */
}
}
c = argv[optind][sp]; /* option letter */
osp = sp++; /* get ready for next letter */
#ifndef STRICT
oind = optind; /* save optind for param test */
#endif
if(argv[optind][sp] == '\0')
{ /* end of argument */
++optind; /* get ready for next try */
sp = 1; /* beginning of next argument */
}
if(c == ':'
|| c == '?' /* optstring syntax conflict */
|| (cp = strchr (optstring, c)) == NULL) /* not found */
{
return Err (argv[0], "illegal option", c);
}
if(cp[1] == ':')
{ /* option takes parameter */
#ifdef STRICT
if(osp != 1)
{
return Err (argv[0], "option must not be clustered", c);
}
/* reset by end of argument */
if(sp != 1)
{
return Err (argv[0], "option must be followed by white space", c);
}
#else
if(oind == optind)
{ /* argument w/o whitespace */
optarg = &argv[optind][sp];
sp = 1; /* beginning of next argument */
}
else
#endif
if(optind >= argc)
{
return Err (argv[0], "option requires an argument", c);
}
else /* argument w/ whitespace */
optarg = argv[optind];
++optind; /* skip over parameter */
}
return c;
}
raptor2-2.0.16/utils/raptor_getopt.h 0000644 0001750 0001750 00000000443 11322277070 014316 0000000 0000000 /*
* Public Domain getopt header
*
*/
#ifndef RAPTOR_GETOPT_H
#define RAPTOR_GETOPT_H
#ifdef __cplusplus
extern "C" {
#endif
int getopt(int argc, char * const argv[], const char *optstring);
extern char *optarg;
extern int optind, opterr, optopt;
#ifdef __cplusplus
}
#endif
#endif
raptor2-2.0.16/utils/rapper.html 0000644 0001750 0001750 00000000000 14260471403 013420 0000000 0000000 raptor2-2.0.16/utils/rapper.c 0000644 0001750 0001750 00000070336 13126005707 012721 0000000 0000000 /* -*- Mode: c; c-basic-offset: 2 -*-
*
* rapper.c - Raptor RDF Parsing and Serializing utility
*
* Copyright (C) 2000-2010, David Beckett http://www.dajobe.org/
* Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/
*
* This package is Free Software and part of Redland http://librdf.org/
*
* It is licensed under the following three licenses as alternatives:
* 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version
* 2. GNU General Public License (GPL) V2 or any newer version
* 3. Apache License, V2.0 or any newer version
*
* You may not use this file except in compliance with at least one of
* the above three licenses.
*
* See LICENSE.html or LICENSE.txt at the top of this package for the
* complete terms and further detail along with the license texts for
* the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively.
*
*
*/
#ifdef HAVE_CONFIG_H
#include
#endif
#include
#include
/* Raptor includes */
#include
/* for access() and R_OK */
#ifdef HAVE_STDLIB_H
#include
#endif
#ifdef WIN32
#include
#endif
/* many places for getopt */
#ifdef HAVE_GETOPT_H
#include
#else
#include
#endif
#ifdef HAVE_UNISTD_H
#include
#endif
#ifdef NEED_OPTIND_DECLARATION
extern int optind;
extern char *optarg;
#endif
static void print_triples(void *user_data, raptor_statement *statement);
static void print_graph(void *user_data, raptor_uri *graph, int flags);
static void print_namespaces(void* user_data, raptor_namespace *nspace);
static void relay_namespaces(void* user_data, raptor_namespace *nspace);
int main(int argc, char *argv[]);
static char *program = NULL;
/* replace newlines in literal string output with spaces */
static int replace_newlines = 0;
/* extra noise? */
static int quiet = 0;
/* just count, no printing */
static int count = 0;
static long triple_count = 0;
static raptor_serializer* serializer = NULL;
static int guess = 0;
static int reported_guess = 0;
static int report_namespace = 0;
static int report_graph = 0;
static
void print_triples(void *user_data, raptor_statement *triple)
{
raptor_parser* rdf_parser = (raptor_parser*)user_data;
triple_count++;
if(guess && !quiet && !reported_guess) {
fprintf(stderr, "%s: Guessed parser name '%s'\n",
program, raptor_parser_get_name(rdf_parser));
reported_guess = 1;
}
if(count)
return;
/* replace newlines with spaces if object is a literal string */
if(replace_newlines &&
triple->object->type == RAPTOR_TERM_TYPE_LITERAL) {
char *s;
for(s = (char*)triple->object->value.literal.string; *s; s++)
if(*s == '\n')
*s=' ';
}
raptor_serializer_serialize_statement(serializer, triple);
return;
}
static
void print_graph(void *user_data, raptor_uri *graph, int flags)
{
/* raptor_parser *parser = (raptor_parser *)user_data; */
const char* const label = (flags & RAPTOR_GRAPH_MARK_START)
? (const char*)"start" : (const char*)"end";
if(!report_graph)
return;
if(graph)
fprintf(stderr, "%s: Graph URI %s %s\n",
program, raptor_uri_as_string(graph), label);
else
fprintf(stderr, "%s: Default graph %s\n",
program, label);
}
static void
print_namespaces(void* user_data, raptor_namespace *nspace)
{
/* raptor_parser* rdf_parser = (raptor_parser*)user_data; */
unsigned char *s;
if(!report_namespace)
return;
s = raptor_namespace_format_as_xml(nspace, NULL);
fprintf(stderr, "%s: Namespace declared: %s\n",
program, s);
raptor_free_memory(s);
return;
}
static void
relay_namespaces(void* user_data, raptor_namespace *nspace)
{
raptor_serializer* rdf_serializer = (raptor_serializer*)user_data;
if(report_namespace)
print_namespaces(user_data, nspace);
raptor_serializer_set_namespace_from_namespace(rdf_serializer, nspace);
}
#ifdef HAVE_GETOPT_LONG
#define HELP_TEXT(short, long, description) " -" short ", --" long " " description
#define HELP_TEXT_LONG(long, description) " --" long " " description
#define HELP_ARG(short, long) "--" #long
#define HELP_ARG_BOTH(short, long) " \"-" short "\" or \"--" long "\""
#define HELP_PAD "\n "
#else
#define HELP_TEXT(short, long, description) " -" short " " description
#define HELP_TEXT_LONG(long, description)
#define HELP_ARG(short, long) "-" #short
#define HELP_ARG_BOTH(short, long) "\"-" short "\""
#define HELP_PAD "\n "
#endif
#define GETOPT_STRING "cef:ghi:I:o:O:qrtvw"
#ifdef HAVE_GETOPT_LONG
#define SHOW_NAMESPACES_FLAG 0x100
#define SHOW_GRAPHS_FLAG 0x200
static const struct option long_options[] =
{
/* name, has_arg, flag, val */
{"count", 0, 0, 'c'},
{"ignore-errors", 0, 0, 'e'},
{"feature", 1, 0, 'f'},
{"guess", 0, 0, 'g'},
{"help", 0, 0, 'h'},
{"input", 1, 0, 'i'},
{"input-uri", 1, 0, 'I'},
{"output", 1, 0, 'o'},
{"output-uri", 1, 0, 'O'},
{"quiet", 0, 0, 'q'},
{"replace-newlines", 0, 0, 'r'},
{"show-graphs", 0, 0, SHOW_GRAPHS_FLAG},
{"show-namespaces", 0, 0, SHOW_NAMESPACES_FLAG},
{"trace", 0, 0, 't'},
{"version", 0, 0, 'v'},
{"ignore-warnings", 0, 0, 'w'},
{NULL, 0, 0, 0}
};
#endif
static int error_count = 0;
static int warning_count = 0;
static int ignore_warnings = 0;
static int ignore_errors = 0;
static const char * const title_string =
"Raptor RDF syntax parsing and serializing utility";
static void
rapper_log_handler(void *data, raptor_log_message *message)
{
raptor_parser *parser = (raptor_parser *)data;
switch(message->level) {
case RAPTOR_LOG_LEVEL_FATAL:
case RAPTOR_LOG_LEVEL_ERROR:
if(!ignore_errors) {
fprintf(stderr, "%s: Error - ", program);
raptor_locator_print(message->locator, stderr);
fprintf(stderr, " - %s\n", message->text);
raptor_parser_parse_abort(parser);
}
error_count++;
break;
case RAPTOR_LOG_LEVEL_WARN:
if(!ignore_warnings) {
fprintf(stderr, "%s: Warning - ", program);
raptor_locator_print(message->locator, stderr);
fprintf(stderr, " - %s\n", message->text);
}
warning_count++;
break;
case RAPTOR_LOG_LEVEL_NONE:
case RAPTOR_LOG_LEVEL_TRACE:
case RAPTOR_LOG_LEVEL_DEBUG:
case RAPTOR_LOG_LEVEL_INFO:
fprintf(stderr, "%s: Unexpected %s message - ", program,
raptor_log_level_get_label(message->level));
raptor_locator_print(message->locator, stderr);
fprintf(stderr, " - %s\n", message->text);
break;
}
}
struct namespace_decl
{
unsigned char *prefix;
unsigned char *uri_string;
};
static void
rapper_free_namespace_decl(void* data) {
struct namespace_decl* nsd = (struct namespace_decl*)data;
if(nsd->prefix)
raptor_free_memory(nsd->prefix);
if(nsd->uri_string)
raptor_free_memory(nsd->uri_string);
raptor_free_memory(nsd);
}
static int
rapper_uri_trace(void *user_data, raptor_uri* uri)
{
fprintf(stderr, "%s: Tracing retrieval of URI %s\n",
program, raptor_uri_as_string(uri));
return 0;
}
typedef struct
{
raptor_option option;
int i_value;
const char* s_value;
} option_value;
int
main(int argc, char *argv[])
{
/* input variables - parser
* 'uri_string' is set to a URI otherwise 'filename' is file name
* or if NULL, stdin. Base URI in 'base_uri_string' is required for stdin.
*/
raptor_world* world = NULL;
raptor_parser* rdf_parser = NULL;
char *filename = NULL;
#define FILENAME_LABEL(name) ((name) ? (name) : "")
unsigned char *uri_string = NULL;
int free_uri_string = 0;
raptor_uri *uri;
unsigned char *base_uri_string = NULL;
raptor_uri *base_uri = NULL;
const char *syntax_name="rdfxml";
raptor_sequence* parser_options = NULL;
int trace = 0;
/* output variables - serializer */
/* 'serializer' object variable is a global */
const char *serializer_syntax_name = "ntriples";
const unsigned char *output_base_uri_string = NULL;
raptor_uri *output_base_uri = NULL;
raptor_sequence* serializer_options = NULL;
raptor_sequence *namespace_declarations = NULL;
/* other variables */
int rc;
int usage = 0;
int help = 0;
char *p;
program = argv[0];
if((p = strrchr(program, '/')))
program = p + 1;
else if((p = strrchr(program, '\\')))
program = p + 1;
argv[0] = program;
world = raptor_new_world();
if(!world)
exit(1);
rc = raptor_world_open(world);
if(rc)
exit(1);
while(!usage && !help)
{
int c;
#ifdef HAVE_GETOPT_LONG
int option_index = 0;
c = getopt_long (argc, argv, GETOPT_STRING, long_options, &option_index);
#else
c = getopt (argc, argv, GETOPT_STRING);
#endif
if(c == -1)
break;
switch (c) {
case 0:
case '?': /* getopt() - unknown option */
usage = 1;
break;
case 'c':
count = 1;
if(serializer_syntax_name)
serializer_syntax_name = NULL;
break;
case 'f':
if(optarg) {
if(!strcmp(optarg, "help")) {
int option_count = (int)raptor_option_get_count();
int i;
fprintf(stderr, "%s: Valid parser options are:\n",
program);
for(i = 0; i < option_count; i++) {
raptor_option_description *od;
od = raptor_world_get_option_description(world,
RAPTOR_DOMAIN_PARSER,
(raptor_option)i);
if(od) {
fprintf(stderr, " %-21s %s (%s)\n",
od->name, od->label,
raptor_option_get_value_type_label(od->value_type));
}
}
fprintf(stderr, "%s: Valid serializer options are:\n",
program);
for(i = 0; i < option_count; i++) {
raptor_option_description *od;
od = raptor_world_get_option_description(world,
RAPTOR_DOMAIN_SERIALIZER,
(raptor_option)i);
if(od) {
fprintf(stderr, " %-21s %s (%s)\n",
od->name, od->label,
raptor_option_get_value_type_label(od->value_type));
raptor_free_option_description(od);
}
}
fputs("Options are set with `" HELP_ARG(f, option) " OPTION = VALUE or `-f OPTION'\n"
"and take a decimal integer VALUE except where noted, defaulting to 1 if omitted.\n", stderr);
fputs("\nA option of the form xmlns:PREFIX=\"URI\" can be used to declare output\n"
"namespace prefixes and names for serializing using an XML-style syntax\n"
"Either or both of PREFIX or URI can be omitted such as -f xmlns=\"URI\"\n"
"This form can be repeated for multiple declarations.\n",
stderr);
raptor_free_world(world);
exit(0);
} else if(!strncmp(optarg, "xmlns", 5)) {
struct namespace_decl *nd;
nd = (struct namespace_decl *)raptor_alloc_memory(sizeof(*nd));
if(raptor_xml_namespace_string_parse((unsigned char*)optarg,
&nd->prefix,
&nd->uri_string)) {
fprintf(stderr, "%s: Bad xmlns syntax in '%s'\n",
program, optarg);
rapper_free_namespace_decl(nd);
raptor_free_world(world);
exit(0);
}
if(!namespace_declarations)
namespace_declarations = raptor_new_sequence(rapper_free_namespace_decl, NULL);
raptor_sequence_push(namespace_declarations, nd);
} else {
int option_count = (int)raptor_option_get_count();
int i;
size_t arg_len = strlen(optarg);
option_value* fv;
int ok = 0;
/* parser options */
for(i = 0; i < option_count; i++) {
raptor_domain domain;
raptor_option_description *od;
size_t name_len;
domain = RAPTOR_DOMAIN_PARSER;
od = raptor_world_get_option_description(world,
domain,
(raptor_option)i);
if(!od) {
domain = RAPTOR_DOMAIN_SERIALIZER;
od = raptor_world_get_option_description(world,
domain,
(raptor_option)i);
if(!od)
/* Neither a parser or serializer option - skip */
continue;
}
name_len = od->name_len;
if(!strncmp(optarg, od->name, name_len)) {
fv = (option_value*)raptor_calloc_memory(sizeof(option_value),
1);
fv->option = (raptor_option)i;
if(od->value_type == RAPTOR_OPTION_VALUE_TYPE_BOOL ||
od->value_type == RAPTOR_OPTION_VALUE_TYPE_INT) {
if(name_len < arg_len && optarg[name_len] == '=')
fv->i_value = atoi(&optarg[name_len + 1]);
else if(name_len == arg_len)
fv->i_value = 1;
} else {
if(name_len < arg_len && optarg[name_len] == '=')
fv->s_value = &optarg[name_len + 1];
else if(name_len == arg_len)
fv->s_value = (const char*)"";
}
if(domain == RAPTOR_DOMAIN_PARSER) {
if(!parser_options)
parser_options = raptor_new_sequence(raptor_free_memory,
NULL);
raptor_sequence_push(parser_options, fv);
} else {
/* RAPTOR_DOMAIN_SERIALIZER */
if(!serializer_options)
serializer_options = raptor_new_sequence(raptor_free_memory,
NULL);
raptor_sequence_push(serializer_options, fv);
}
ok = 1;
}
raptor_free_option_description(od);
if(ok)
break;
}
if(!ok) {
fprintf(stderr,
"%s: invalid argument `%s' for `" HELP_ARG(f, option) "'\n"
"Try '%s " HELP_ARG(f, option) " help' for a list of valid options\n",
program, optarg, program);
usage = 1;
}
}
}
break;
case 'g':
guess = 1;
break;
case 'h':
help = 1;
break;
case 't':
trace = 1;
break;
case 'q':
quiet = 1;
break;
case 'r':
replace_newlines = 1;
break;
case 'o':
if(optarg) {
if(raptor_world_is_serializer_name(world, optarg))
serializer_syntax_name = optarg;
else {
int i;
fprintf(stderr,
"%s: invalid argument `%s' for `" HELP_ARG(o, output) "'\n",
program, optarg);
fprintf(stderr, "Valid arguments are:\n");
for(i = 0; 1; i++) {
const raptor_syntax_description* sd;
sd = raptor_world_get_serializer_description(world, i);
if(!sd)
break;
fprintf(stderr, " %-14s for %s\n", sd->names[0], sd->label);
}
usage = 1;
break;
}
}
break;
case 'O':
if(optarg)
output_base_uri_string = (const unsigned char*)optarg;
break;
case 'i':
if(optarg) {
if(raptor_world_is_parser_name(world, optarg))
syntax_name = optarg;
else {
int i;
fprintf(stderr,
"%s: invalid argument `%s' for `" HELP_ARG(i, input) "'\n",
program, optarg);
fprintf(stderr, "Valid arguments are:\n");
for(i = 0; 1; i++) {
const raptor_syntax_description* sd;
sd = raptor_world_get_parser_description(world, i);
if(!sd)
break;
fprintf(stderr, " %-14s for %s\n", sd->names[0], sd->label);
}
usage = 1;
break;
}
}
break;
case 'I':
if(optarg)
base_uri_string = (unsigned char*)optarg;
break;
case 'w':
ignore_warnings = 1;
break;
case 'e':
ignore_errors = 1;
break;
case 'v':
fputs(raptor_version_string, stdout);
fputc('\n', stdout);
raptor_free_world(world);
exit(0);
#ifdef SHOW_NAMESPACES_FLAG
case SHOW_NAMESPACES_FLAG:
report_namespace = 1;
break;
#endif
#ifdef SHOW_GRAPHS_FLAG
case SHOW_GRAPHS_FLAG:
report_graph = 1;
break;
#endif
} /* end switch */
}
if(optind != argc-1 && optind != argc-2 && !help && !usage) {
usage = 2; /* Title and usage */
}
if(usage) {
if(usage > 1) {
fputs(title_string, stderr); putc(' ', stderr); fputs(raptor_version_string, stderr); putc('\n', stderr);
fputs("Raptor home page: ", stderr);
fputs(raptor_home_url_string, stderr);
fputc('\n', stderr);
fputs(raptor_copyright_string, stderr);
fputs("\nLicense: ", stderr);
fputs(raptor_license_string, stderr);
fputs("\n\n", stderr);
}
fprintf(stderr, "Try `%s " HELP_ARG(h, help) "' for more information.\n",
program);
raptor_free_world(world);
exit(1);
}
if(help) {
int i;
puts(title_string); putchar(' '); puts(raptor_version_string); putchar('\n');
puts("Parse RDF syntax from a source into serialized RDF triples.");
printf("Usage: %s [OPTIONS] INPUT-URI [INPUT-BASE-URI]\n\n", program);
fputs(raptor_copyright_string, stdout);
fputs("\nLicense: ", stdout);
puts(raptor_license_string);
fputs("Raptor home page: ", stdout);
puts(raptor_home_url_string);
puts("\nArguments:");
puts(" INPUT-URI a filename, URI or '-' for standard input (stdin).");
puts(" INPUT-BASE-URI the input/parser base URI or '-' for none.\n"
" Default is INPUT-URI\n"
" Equivalent to" HELP_ARG_BOTH("I INPUT-BASE-URI", "input-uri INPUT-BASE-URI"));
puts("\nMain options:");
puts(HELP_TEXT("i FORMAT", "input FORMAT ", "Set the input format/parser to one of:"));
for(i = 0; 1; i++) {
const raptor_syntax_description* sd;
sd = raptor_world_get_parser_description(world, i);
if(!sd)
break;
printf(" %-14s %s", sd->names[0], sd->label);
if(!i)
puts(" (default)");
else
putchar('\n');
}
puts(HELP_TEXT("I URI", "input-uri URI ", "Set the input/parser base URI. '-' for none.") HELP_PAD " Default is INPUT-BASE-URI argument value.");
putchar('\n');
puts(HELP_TEXT("o FORMAT", "output FORMAT", "Set the output format/serializer to one of:"));
for(i = 0; 1; i++) {
const raptor_syntax_description* sd;
sd = raptor_world_get_serializer_description(world, i);
if(!sd)
break;
printf(" %-14s %s", sd->names[0], sd->label);
if(!i)
puts(" (default)");
else
putchar('\n');
}
puts(HELP_TEXT("O URI", "output-uri URI ", "Set the output/serializer base URI. '-' for none.") HELP_PAD " Default is input/parser base URI.");
putchar('\n');
puts("General options:");
puts(HELP_TEXT("c", "count ", "Count triples only - do not print them."));
puts(HELP_TEXT("e", "ignore-errors ", "Ignore error messages"));
puts(HELP_TEXT("f OPTION(=VALUE)", "feature OPTION(=VALUE)", HELP_PAD "Set parser or serializer options" HELP_PAD "Use `-f help' for a list of valid options"));
puts(HELP_TEXT("g", "guess ", "Guess the input syntax (same as -i guess)"));
puts(HELP_TEXT("h", "help ", "Print this help, then exit"));
puts(HELP_TEXT("q", "quiet ", "No extra information messages"));
puts(HELP_TEXT("r", "replace-newlines", "Replace newlines with spaces in literals"));
#ifdef SHOW_GRAPHS_FLAG
puts(HELP_TEXT_LONG("show-graphs ", "Show named graphs as they are declared"));
#endif
#ifdef SHOW_NAMESPACES_FLAG
puts(HELP_TEXT_LONG("show-namespaces ", "Show namespaces as they are declared"));
#endif
puts(HELP_TEXT("t", "trace ", "Trace URIs retrieved during parsing"));
puts(HELP_TEXT("w", "ignore-warnings ", "Ignore warning messages"));
puts(HELP_TEXT("v", "version ", "Print the Raptor version"));
puts("\nReport bugs to http://bugs.librdf.org/");
raptor_free_world(world);
exit(0);
}
if(optind == argc-1)
uri_string = (unsigned char*)argv[optind];
else {
uri_string = (unsigned char*)argv[optind++];
base_uri_string = (unsigned char*)argv[optind];
}
/* If uri_string is "path-to-file", turn it into a file: URI */
if(!strcmp((const char*)uri_string, "-")) {
if(!base_uri_string) {
fprintf(stderr,
"%s: A Base URI is required when reading from standard input.\n",
program);
return(1);
}
uri_string = NULL;
} else if(!access((const char*)uri_string, R_OK)) {
filename = (char*)uri_string;
uri_string = raptor_uri_filename_to_uri_string(filename);
if(!uri_string) {
fprintf(stderr, "%s: Failed to create URI for file %s.\n",
program, filename);
return(1);
}
free_uri_string = 1;
}
if(uri_string) {
uri = raptor_new_uri(world, uri_string);
if(!uri) {
fprintf(stderr, "%s: Failed to create URI for %s\n",
program, uri_string);
return(1);
}
} else
uri = NULL; /* stdin */
/* Set the input/parser base URI */
if(base_uri_string) {
if(strcmp((const char*)base_uri_string, "-")) {
base_uri = raptor_new_uri(world, base_uri_string);
if(!base_uri) {
fprintf(stderr, "%s: Failed to create URI for %s\n",
program, base_uri_string);
return(1);
}
}
}
/* Set the output/serializer base URI from the argument if explicitly
* set, otherwise default to the input base URI if present.
*/
if(!output_base_uri_string) {
if(base_uri)
output_base_uri = raptor_uri_copy(base_uri);
} else {
if(strcmp((const char*)output_base_uri_string, "-")) {
output_base_uri = raptor_new_uri(world, output_base_uri_string);
if(!output_base_uri) {
fprintf(stderr, "%s: Failed to create output base URI for %s\n",
program, output_base_uri_string);
return(1);
}
} else
output_base_uri = NULL;
}
if(guess)
syntax_name="guess";
rdf_parser = raptor_new_parser(world, syntax_name);
if(!rdf_parser) {
fprintf(stderr, "%s: Failed to create raptor parser type %s\n",
program, syntax_name);
return(1);
}
raptor_world_set_log_handler(world, rdf_parser, rapper_log_handler);
if(parser_options) {
option_value *fv;
while((fv = (option_value*)raptor_sequence_pop(parser_options))) {
raptor_parser_set_option(rdf_parser, fv->option,
fv->s_value, fv->i_value);
raptor_free_memory(fv);
}
raptor_free_sequence(parser_options);
parser_options = NULL;
}
if(trace)
raptor_parser_set_uri_filter(rdf_parser, rapper_uri_trace, rdf_parser);
if(!quiet) {
if(uri_string) {
if(base_uri_string)
fprintf(stderr, "%s: Parsing URI %s with parser %s and base URI %s\n",
program, uri_string, syntax_name, base_uri_string);
else
fprintf(stderr, "%s: Parsing URI %s with parser %s\n", program,
uri_string, syntax_name);
} else {
if(base_uri_string)
fprintf(stderr,
"%s: Parsing file %s with parser %s and base URI %s\n", program,
FILENAME_LABEL(filename), syntax_name, base_uri_string);
else
fprintf(stderr, "%s: Parsing file %s with parser %s\n", program,
FILENAME_LABEL(filename), syntax_name);
}
}
raptor_parser_set_statement_handler(rdf_parser, rdf_parser, print_triples);
if(report_graph)
raptor_parser_set_graph_mark_handler(rdf_parser, rdf_parser, print_graph);
if(report_namespace)
raptor_parser_set_namespace_handler(rdf_parser, rdf_parser,
print_namespaces);
if(serializer_syntax_name) {
if(!quiet) {
if(output_base_uri)
fprintf(stderr, "%s: Serializing with serializer %s and base URI %s\n",
program, serializer_syntax_name,
raptor_uri_as_string(output_base_uri));
else
fprintf(stderr, "%s: Serializing with serializer %s\n",
program, serializer_syntax_name);
}
serializer = raptor_new_serializer(world, serializer_syntax_name);
if(!serializer) {
fprintf(stderr,
"%s: Failed to create raptor serializer type %s\n", program,
serializer_syntax_name);
return(1);
}
if(namespace_declarations) {
int i;
for(i = 0; i< raptor_sequence_size(namespace_declarations); i++) {
struct namespace_decl *nd;
raptor_uri *ns_uri = NULL;
nd = (struct namespace_decl*)raptor_sequence_get_at(namespace_declarations, i);
if(nd->uri_string)
ns_uri = raptor_new_uri(world, nd->uri_string);
raptor_serializer_set_namespace(serializer, ns_uri, nd->prefix);
if(ns_uri)
raptor_free_uri(ns_uri);
}
raptor_free_sequence(namespace_declarations);
namespace_declarations = NULL;
}
if(serializer_options) {
option_value *fv;
while((fv = (option_value*)raptor_sequence_pop(serializer_options))) {
raptor_serializer_set_option(serializer, fv->option,
fv->s_value, fv->i_value);
raptor_free_memory(fv);
}
raptor_free_sequence(serializer_options);
serializer_options = NULL;
}
raptor_serializer_start_to_file_handle(serializer,
output_base_uri, stdout);
if(!report_namespace)
raptor_parser_set_namespace_handler(rdf_parser, serializer,
relay_namespaces);
}
/* Begin the parsing of the content from file or URI,
* sending it to serializer via callback print_triples()
*/
rc = 0;
if(!uri || filename) {
if(raptor_parser_parse_file(rdf_parser, uri, base_uri)) {
fprintf(stderr, "%s: Failed to parse file %s %s content\n",
program, FILENAME_LABEL(filename), syntax_name);
rc = 1;
}
} else {
if(raptor_parser_parse_uri(rdf_parser, uri, base_uri)) {
fprintf(stderr, "%s: Failed to parse URI %s %s content\n",
program, uri_string, syntax_name);
rc = 1;
}
}
raptor_free_parser(rdf_parser);
if(serializer) {
raptor_serializer_serialize_end(serializer);
raptor_free_serializer(serializer);
}
if(!quiet) {
if(triple_count == 1)
fprintf(stderr, "%s: Parsing returned 1 triple\n",
program);
else
fprintf(stderr, "%s: Parsing returned %ld triples\n",
program, triple_count);
}
if(output_base_uri)
raptor_free_uri(output_base_uri);
if(base_uri)
raptor_free_uri(base_uri);
if(uri)
raptor_free_uri(uri);
if(free_uri_string)
raptor_free_memory(uri_string);
if(namespace_declarations)
raptor_free_sequence(namespace_declarations);
if(parser_options)
raptor_free_sequence(parser_options);
if(serializer_options)
raptor_free_sequence(serializer_options);
raptor_free_world(world);
if(error_count && !ignore_errors)
return 1;
if(warning_count && !ignore_warnings)
return 2;
return(rc);
}
raptor2-2.0.16/utils/Makefile.in 0000644 0001750 0001750 00000070206 14377711062 013334 0000000 0000000 # Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# -*- Mode: Makefile -*-
#
# Makefile.am - automake file for Raptor utils
#
# Copyright (C) 2000-2009, David Beckett http://www.dajobe.org/
# Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/
#
# This package is Free Software and part of Redland http://librdf.org/
#
# It is licensed under the following three licenses as alternatives:
# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version
# 2. GNU General Public License (GPL) V2 or any newer version
# 3. Apache License, V2.0 or any newer version
#
# You may not use this file except in compliance with at least one of
# the above three licenses.
#
# See LICENSE.html or LICENSE.txt at the top of this package for the
# complete terms and further detail along with the license texts for
# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively.
#
#
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = rapper$(EXEEXT)
noinst_PROGRAMS = rdfdiff$(EXEEXT)
@GETOPT_TRUE@am__append_1 = getopt.c raptor_getopt.h
@GETOPT_TRUE@am__append_2 = getopt.c raptor_getopt.h
subdir = utils
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \
$(top_srcdir)/build/libtool.m4 \
$(top_srcdir)/build/ltoptions.m4 \
$(top_srcdir)/build/ltsugar.m4 \
$(top_srcdir)/build/ltversion.m4 \
$(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/build/pkg.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/src/raptor_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
am__rapper_SOURCES_DIST = rapper.c getopt.c raptor_getopt.h
@GETOPT_TRUE@am__objects_1 = getopt.$(OBJEXT)
am_rapper_OBJECTS = rapper.$(OBJEXT) $(am__objects_1)
rapper_OBJECTS = $(am_rapper_OBJECTS)
rapper_DEPENDENCIES = $(top_builddir)/src/libraptor2.la
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
am__rdfdiff_SOURCES_DIST = rdfdiff.c getopt.c raptor_getopt.h
am_rdfdiff_OBJECTS = rdfdiff.$(OBJEXT) $(am__objects_1)
rdfdiff_OBJECTS = $(am_rdfdiff_OBJECTS)
rdfdiff_DEPENDENCIES = $(top_builddir)/src/libraptor2.la
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
depcomp = $(SHELL) $(top_srcdir)/build/depcomp
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/getopt.Po ./$(DEPDIR)/rapper.Po \
./$(DEPDIR)/rdfdiff.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(rapper_SOURCES) $(rdfdiff_SOURCES)
DIST_SOURCES = $(am__rapper_SOURCES_DIST) $(am__rdfdiff_SOURCES_DIST)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
man1dir = $(mandir)/man1
NROFF = nroff
MANS = $(man_MANS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/build/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BISON = @BISON@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CURL_CONFIG = @CURL_CONFIG@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
GTKDOC_CHECK = @GTKDOC_CHECK@
GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@
GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
GTKDOC_MKPDF = @GTKDOC_MKPDF@
GTKDOC_REBASE = @GTKDOC_REBASE@
HTML_DIR = @HTML_DIR@
ICU_CFLAGS = @ICU_CFLAGS@
ICU_LIBS = @ICU_LIBS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JING = @JING@
LD = @LD@
LDFLAGS = @LDFLAGS@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
LIBCURL_CFLAGS = @LIBCURL_CFLAGS@
LIBCURL_LIBS = @LIBCURL_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@ $(MEM_LIBS)
LIBTOOL = @LIBTOOL@
LIBXML_CFLAGS = @LIBXML_CFLAGS@
LIBXML_LIBS = @LIBXML_LIBS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
# Memory debugging
MEM = @MEM@
MEM_LIBS = @MEM_LIBS@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
PKG_CONFIG_REQUIRES = @PKG_CONFIG_REQUIRES@
RANLIB = @RANLIB@
RAPTOR_LDFLAGS = @RAPTOR_LDFLAGS@
RAPTOR_LIBTOOLLIBS = @RAPTOR_LIBTOOLLIBS@
RAPTOR_LIBTOOL_VERSION = @RAPTOR_LIBTOOL_VERSION@
RAPTOR_PARSERS = @RAPTOR_PARSERS@
RAPTOR_SERIALIZERS = @RAPTOR_SERIALIZERS@
RAPTOR_VERSION = @RAPTOR_VERSION@
RAPTOR_VERSION_DECIMAL = @RAPTOR_VERSION_DECIMAL@
RAPTOR_VERSION_MAJOR = @RAPTOR_VERSION_MAJOR@
RAPTOR_VERSION_MINOR = @RAPTOR_VERSION_MINOR@
RAPTOR_VERSION_RELEASE = @RAPTOR_VERSION_RELEASE@
RAPTOR_WWW_LIBRARY = @RAPTOR_WWW_LIBRARY@
RAPTOR_XML_PARSER = @RAPTOR_XML_PARSER@
RECHO = @RECHO@
RECHO_C = @RECHO_C@
RECHO_N = @RECHO_N@
RPM_RELEASE = @RPM_RELEASE@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
TAR = @TAR@
VERSION = @VERSION@
XML_CONFIG = @XML_CONFIG@
XSLT_CFLAGS = @XSLT_CFLAGS@
XSLT_CONFIG = @XSLT_CONFIG@
XSLT_LIBS = @XSLT_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
man_MANS = rapper.1
CLEANFILES = *.plist
AM_CPPFLAGS = $(MEM) -I$(top_srcdir)/src
ANALYZE = clang
ANALYZE_FLAGS = "--analyze"
# Based on COMPILE target
ANALYZE_COMMAND = $(ANALYZE) \
$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) \
$(ANALYZE_FLAGS)
EXTRA_DIST = \
CMakeLists.txt \
rapper.html \
$(man_MANS)
rapper_SOURCES = rapper.c $(am__append_1)
rapper_LDADD = $(top_builddir)/src/libraptor2.la
rdfdiff_SOURCES = rdfdiff.c $(am__append_2)
rdfdiff_LDADD = $(top_builddir)/src/libraptor2.la
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu utils/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu utils/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p \
|| test -f $$p1 \
; then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' \
-e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' \
`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
installcheck-binPROGRAMS: $(bin_PROGRAMS)
bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \
case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
*" $$p "* | *" $(srcdir)/$$p "*) continue;; \
esac; \
f=`echo "$$p" | \
sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
for opt in --help --version; do \
if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \
2>c$${pid}_.err &2; bad=1; fi; \
done; \
done; rm -f c$${pid}_.???; exit $$bad
clean-noinstPROGRAMS:
@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
rapper$(EXEEXT): $(rapper_OBJECTS) $(rapper_DEPENDENCIES) $(EXTRA_rapper_DEPENDENCIES)
@rm -f rapper$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(rapper_OBJECTS) $(rapper_LDADD) $(LIBS)
rdfdiff$(EXEEXT): $(rdfdiff_OBJECTS) $(rdfdiff_DEPENDENCIES) $(EXTRA_rdfdiff_DEPENDENCIES)
@rm -f rdfdiff$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(rdfdiff_OBJECTS) $(rdfdiff_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rapper.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdfdiff.Po@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-man1: $(man_MANS)
@$(NORMAL_INSTALL)
@list1=''; \
list2='$(man_MANS)'; \
test -n "$(man1dir)" \
&& test -n "`echo $$list1$$list2`" \
|| exit 0; \
echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
{ for i in $$list1; do echo "$$i"; done; \
if test -n "$$list2"; then \
for i in $$list2; do echo "$$i"; done \
| sed -n '/\.1[a-z]*$$/p'; \
fi; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
done; }
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list=''; test -n "$(man1dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.1[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS) $(MANS)
installdirs:
for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic clean-libtool \
clean-noinstPROGRAMS mostlyclean-am
distclean: distclean-am
-rm -f ./$(DEPDIR)/getopt.Po
-rm -f ./$(DEPDIR)/rapper.Po
-rm -f ./$(DEPDIR)/rdfdiff.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-man
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-binPROGRAMS
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man: install-man1
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am: installcheck-binPROGRAMS
maintainer-clean: maintainer-clean-am
-rm -f ./$(DEPDIR)/getopt.Po
-rm -f ./$(DEPDIR)/rapper.Po
-rm -f ./$(DEPDIR)/rdfdiff.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-man
uninstall-man: uninstall-man1
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-binPROGRAMS clean-generic clean-libtool \
clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-binPROGRAMS install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-man1 install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installcheck-binPROGRAMS \
installdirs maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am uninstall-binPROGRAMS uninstall-man \
uninstall-man1
.PRECIOUS: Makefile
@MAINTAINER_MODE_TRUE@rapper.html: $(srcdir)/rapper.1 $(srcdir)/../scripts/fix-groff-xhtml.pl
@MAINTAINER_MODE_TRUE@ -groff -man -Thtml -P-l $< | tidy -asxml -wrap 1000 2>/dev/null | $(PERL) $(srcdir)/../scripts/fix-groff-xhtml.pl $@
$(top_builddir)/src/libraptor2.la:
cd $(top_builddir)/src && $(MAKE) libraptor2.la
# Run Clang static analyzer over sources.
@MAINTAINER_MODE_TRUE@analyze: $(SOURCES)
@MAINTAINER_MODE_TRUE@ @list='$(SOURCES)'; \
@MAINTAINER_MODE_TRUE@ result=0; \
@MAINTAINER_MODE_TRUE@ for file in $$list; do \
@MAINTAINER_MODE_TRUE@ if echo $$file | grep '\.c$$' >/dev/null 2>&1; then \
@MAINTAINER_MODE_TRUE@ $(RECHO) "Analyzing $$file"; \
@MAINTAINER_MODE_TRUE@ $(ANALYZE_COMMAND) $(srcdir)/$$file; \
@MAINTAINER_MODE_TRUE@ status=$$?; \
@MAINTAINER_MODE_TRUE@ if test $$status != 0; then \
@MAINTAINER_MODE_TRUE@ result=1; \
@MAINTAINER_MODE_TRUE@ fi; \
@MAINTAINER_MODE_TRUE@ fi; \
@MAINTAINER_MODE_TRUE@ done; \
@MAINTAINER_MODE_TRUE@ set -e; exit $$result
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
raptor2-2.0.16/utils/rdfdiff.c 0000644 0001750 0001750 00000062534 12565715034 013044 0000000 0000000 /* -*- Mode: c; c-basic-offset: 2 -*-
*
* rdfdiff.c - Raptor RDF diff tool
*
* Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/
* Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/
* Copyright (C) 2005, Steve Shepard steveshep@gmail.com
*
* This package is Free Software and part of Redland http://librdf.org/
*
* It is licensed under the following three licenses as alternatives:
* 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version
* 2. GNU General Public License (GPL) V2 or any newer version
* 3. Apache License, V2.0 or any newer version
*
* You may not use this file except in compliance with at least one of
* the above three licenses.
*
* See LICENSE.html or LICENSE.txt at the top of this package for the
* complete terms and further detail along with the license texts for
* the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively.
*
*
*/
#ifdef HAVE_CONFIG_H
#include
#endif
#include
#include
/* Raptor includes */
#include
#include
/* for access() and R_OK */
#ifdef HAVE_STDLIB_H
#include
#endif
#ifdef WIN32
#include
#endif
/* many places for getopt */
#ifdef HAVE_GETOPT_H
#include
#else
#include
#endif
#ifdef HAVE_UNISTD_H
#include
#endif
#if 0
#undef RAPTOR_DEBUG
#define RAPTOR_DEBUG 2
#endif
#ifndef RAPTOR_INTERNAL
#define RAPTOR_MALLOC(type, size) (type)malloc(size)
#define RAPTOR_CALLOC(type, nmemb, size) (type)calloc(nmemb, size)
#define RAPTOR_FREE(type, ptr) free((void*)ptr)
#endif
#ifdef NEED_OPTIND_DECLARATION
extern int optind;
extern char *optarg;
#endif
#define MAX_ASCII_INT_SIZE 13
#define RDF_NAMESPACE_URI_LEN 43
#define ORDINAL_STRING_LEN (RDF_NAMESPACE_URI_LEN + MAX_ASCII_INT_SIZE + 1)
#define GETOPT_STRING "bhf:t:u:"
#ifdef HAVE_GETOPT_LONG
static const struct option long_options[] =
{
/* name, has_arg, flag, val */
{"brief" , 0, 0, 'b'},
{"help" , 0, 0, 'h'},
{"from-format" , 1, 0, 'f'},
{"to-format" , 1, 0, 't'},
{"base-uri" , 1, 0, 'u'},
{NULL , 0, 0, 0}
};
#endif
#ifdef HAVE_GETOPT_LONG
#define HELP_TEXT(short, long, description) " -" short ", --" long " " description
#define HELP_ARG(short, long) "--" #long
#define HELP_PAD "\n "
#else
#define HELP_TEXT(short, long, description) " -" short " " description
#define HELP_ARG(short, long) "-" #short
#define HELP_PAD "\n "
#endif
typedef struct rdfdiff_link_s {
struct rdfdiff_link_s *next;
raptor_statement *statement;
} rdfdiff_link;
typedef struct rdfdiff_blank_s {
struct rdfdiff_blank_s *next;
raptor_world *world;
char *blank_id;
raptor_statement *owner;
rdfdiff_link *first;
rdfdiff_link *last;
int matched;
} rdfdiff_blank;
typedef struct {
raptor_world *world;
char *name;
raptor_parser *parser;
rdfdiff_link *first;
rdfdiff_link *last;
rdfdiff_blank *first_blank;
rdfdiff_blank *last_blank;
int statement_count;
int error_count;
int warning_count;
int difference_count;
} rdfdiff_file;
static int brief = 0;
static char *program = NULL;
static const char * const title_string="Raptor RDF diff utility";
static int ignore_errors = 0;
static int ignore_warnings = 0;
static int emit_from_header = 1;
static int emit_to_header = 1;
static rdfdiff_file* from_file = NULL;
static rdfdiff_file*to_file = NULL;
static rdfdiff_file* rdfdiff_new_file(raptor_world* world, const unsigned char *name, const char *syntax);
static void rdfdiff_free_file(rdfdiff_file* file);
static rdfdiff_blank *rdfdiff_find_blank(rdfdiff_blank *first, char *blank_id);
static rdfdiff_blank *rdfdiff_new_blank(raptor_world *world, char *blank_id);
static void rdfdiff_free_blank(rdfdiff_blank *blank);
static int rdfdiff_blank_equals(const rdfdiff_blank *b1, const rdfdiff_blank *b2,
rdfdiff_file*b1_file, rdfdiff_file*b2_file);
static void rdfdiff_log_handler(void *data, raptor_log_message *message);
static void rdfdiff_collect_statements(void *user_data, raptor_statement *statement);
int main(int argc, char *argv[]);
/* Version of strcmp that can take NULL parameters. Assume that
* Non-NULL strings are lexically greater than NULL strings
*/
static int
safe_strcmp(const char *s1, const char *s2)
{
if(s1 == NULL && s2 == NULL) {
return 0;
} else if(s1 == NULL && s2 != NULL) {
return -1;
} else if(s1 != NULL && s2 == NULL) {
return 1;
} else {
return strcmp(s1, s2);
}
}
static rdfdiff_file*
rdfdiff_new_file(raptor_world *world, const unsigned char *name, const char *syntax)
{
rdfdiff_file* file = RAPTOR_CALLOC(rdfdiff_file*, 1, sizeof(*file));
if(file) {
size_t name_len = strlen((const char*)name);
file->world = world;
file->name = RAPTOR_MALLOC(char*, name_len + 1);
if(!file->name) {
rdfdiff_free_file(file);
return(0);
}
memcpy(file->name, name, name_len + 1);
file->parser = raptor_new_parser(world, syntax);
if(file->parser) {
raptor_world_set_log_handler(world, file, rdfdiff_log_handler);
} else {
fprintf(stderr, "%s: Failed to create raptor parser type %s for %s\n",
program, syntax, name);
rdfdiff_free_file(file);
return(0);
}
}
return file;
}
static void
rdfdiff_free_file(rdfdiff_file* file)
{
rdfdiff_link *cur, *next;
rdfdiff_blank *cur1, *next1;
if(file->name)
RAPTOR_FREE(char*, file->name);
if(file->parser)
raptor_free_parser(file->parser);
for(cur = file->first; cur; cur = next) {
next = cur->next;
raptor_free_statement(cur->statement);
RAPTOR_FREE(rdfdiff_link, cur);
}
for(cur1 = file->first_blank; cur1; cur1 = next1) {
next1 = cur1->next;
rdfdiff_free_blank(cur1);
}
RAPTOR_FREE(rdfdiff_file, file);
}
static rdfdiff_blank *
rdfdiff_new_blank(raptor_world* world, char *blank_id)
{
rdfdiff_blank *blank = RAPTOR_CALLOC(rdfdiff_blank*, 1, sizeof(*blank));
if(blank) {
size_t blank_id_len = strlen(blank_id);
blank->world = world;
blank->blank_id = RAPTOR_MALLOC(char*, blank_id_len + 1);
if(!blank->blank_id) {
rdfdiff_free_blank(blank);
return NULL;
}
memcpy(blank->blank_id, blank_id, blank_id_len + 1);
}
return blank;
}
static void
rdfdiff_free_blank(rdfdiff_blank *blank)
{
rdfdiff_link *cur, *next;
if(blank->blank_id)
RAPTOR_FREE(char*, blank->blank_id);
if(blank->owner)
raptor_free_statement(blank->owner);
for(cur = blank->first; cur; cur = next) {
next = cur->next;
raptor_free_statement(cur->statement);
RAPTOR_FREE(rdfdiff_link, cur);
}
RAPTOR_FREE(rdfdiff_blank, blank);
}
static int
rdfdiff_statement_equals(raptor_world *world, const raptor_statement *s1, const raptor_statement *s2)
{
int rv = 0;
if(!s1 || !s2)
return 0;
#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1
fprintf(stderr, "(rdfdiff_statement_equals) Comparing ");
raptor_statement_print_as_ntriples(s1, stderr);
fprintf(stderr, " to ");
raptor_statement_print_as_ntriples(s2, stderr);
#endif
/* normal comparison */
if(s1->subject->type != s2->subject->type) {
rv = 0;
goto done;
}
if(s1->subject->type == RAPTOR_TERM_TYPE_BLANK) {
/* Here for completeness. Anonymous nodes are taken care of
* elsewhere */
/*if(strcmp((const char *)s1->subject, (const char *)s2->subject->value) != 0)
return 0;*/
} else {
if(!raptor_uri_equals(s1->subject->value.uri,
s2->subject->value.uri)) {
rv = 0;
goto done;
}
}
if(s1->predicate->type != s2->predicate->type) {
rv = 0;
goto done;
}
if(!raptor_uri_equals(s1->predicate->value.uri,
s2->predicate->value.uri)) {
rv = 0;
goto done;
}
if(s1->object->type != s2->object->type) {
rv = 0;
goto done;
}
if(s1->object->type == RAPTOR_TERM_TYPE_LITERAL) {
int equal;
equal= !safe_strcmp((char *)s1->object->value.literal.string,
(char *)s2->object->value.literal.string);
if(equal) {
if(s1->object->value.literal.language && s2->object->value.literal.language)
equal = !strcmp((char *)s1->object->value.literal.language,
(char *)s2->object->value.literal.language);
else if(s1->object->value.literal.language || s2->object->value.literal.language)
equal = 0;
else
equal = 1;
if(equal)
equal = raptor_uri_equals(s1->object->value.literal.datatype,
s2->object->value.literal.datatype);
}
rv = equal;
goto done;
} else if(s1->object->type == RAPTOR_TERM_TYPE_BLANK) {
/* Here for completeness. Anonymous nodes are taken care of
* elsewhere */
/* if(strcmp((const char *)s1->object, (const char *)s2->object->value) != 0)
return 0; */
} else {
if(!raptor_uri_equals(s1->object->value.uri,
s2->object->value.uri)) {
rv = 0;
goto done;
}
}
rv = 1;
done:
#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1
fprintf(stderr, " : %s\n", (rv ? "equal" : "not equal"));
#endif
return rv;
}
static int
rdfdiff_blank_equals(const rdfdiff_blank *b1, const rdfdiff_blank *b2,
rdfdiff_file *b1_file, rdfdiff_file *b2_file)
{
/* first compare "owners". Owners are subject/predicate or arcs
* in. */
int equal = 0;
if(b1->owner == NULL && b2->owner == NULL) {
/* Both are "top-level" anonymous objects. I.E. Neither is the
* object of a statement. Fall through and compare based on their
* contents. */
equal = 1;
} else if(b1->owner == NULL || b2->owner == NULL) {
equal = 0;
} else if(b1->owner->subject->type != RAPTOR_TERM_TYPE_BLANK &&
b2->owner->subject->type != RAPTOR_TERM_TYPE_BLANK) {
/* Neither are anonymous. Normal comparison. This will return
* false if both the subject and the predicates don't match. We
* know the objects are blank nodes. */
equal = rdfdiff_statement_equals(b1->world, b1->owner, b2->owner);
} else if(b1->owner->subject->type == RAPTOR_TERM_TYPE_BLANK &&
b2->owner->subject->type == RAPTOR_TERM_TYPE_BLANK) {
rdfdiff_blank *p1;
rdfdiff_blank *p2;
/* Both are anonymous. Need further testing. Check that the
* containing anononymous nodes are eaual. */
#if 0
fprintf(stderr, "b1->owner: ");
raptor_statement_print_as_ntriples(b1->owner, stderr);
fprintf(stderr, "\n");
fprintf(stderr, "b2->owner: ");
raptor_statement_print_as_ntriples(b2->owner, stderr);
fprintf(stderr, "\n");
#endif
p1 = rdfdiff_find_blank(b1_file->first_blank,
(char *)b1->owner->subject->value.blank.string);
p2 = rdfdiff_find_blank(b2_file->first_blank,
(char *)b2->owner->subject->value.blank.string);
equal = rdfdiff_blank_equals(p1, p2, b1_file, b2_file);
} else {
equal = 0;
}
/* Now compare the contents. This accounts for the case where a
* subject has several properties (of the same predicate value) with
* different blank nodes as values. */
if(equal) {
rdfdiff_link *s1 = b1->first;
while(s1) {
rdfdiff_link *s2 = b2->first;
while(s2) {
if(rdfdiff_statement_equals(b1->world, s1->statement, s2->statement))
break;
s2 = s2->next;
}
if(s2 == 0) {
equal = 0;
break;
}
s1 = s1->next;
}
}
return equal;
}
static void
rdfdiff_log_handler(void *data, raptor_log_message *message)
{
rdfdiff_file* file = (rdfdiff_file*)data;
switch(message->level) {
case RAPTOR_LOG_LEVEL_FATAL:
case RAPTOR_LOG_LEVEL_ERROR:
if(!ignore_errors) {
fprintf(stderr, "%s: Error - ", program);
raptor_locator_print(message->locator, stderr);
fprintf(stderr, " - %s\n", message->text);
raptor_parser_parse_abort(file->parser);
}
file->error_count++;
break;
case RAPTOR_LOG_LEVEL_WARN:
if(!ignore_warnings) {
fprintf(stderr, "%s: Warning - ", program);
raptor_locator_print(message->locator, stderr);
fprintf(stderr, " - %s\n", message->text);
}
file->warning_count++;
break;
case RAPTOR_LOG_LEVEL_NONE:
case RAPTOR_LOG_LEVEL_TRACE:
case RAPTOR_LOG_LEVEL_DEBUG:
case RAPTOR_LOG_LEVEL_INFO:
fprintf(stderr, "%s: Unexpected %s message - ", program,
raptor_log_level_get_label(message->level));
raptor_locator_print(message->locator, stderr);
fprintf(stderr, " - %s\n", message->text);
break;
}
}
static rdfdiff_blank *
rdfdiff_find_blank(rdfdiff_blank *first, char *blank_id)
{
rdfdiff_blank *rv_blank = 0;
rdfdiff_blank *cur = first;
while(cur) {
if(strcmp(cur->blank_id, blank_id) == 0) {
rv_blank = cur;
break;
}
cur = cur->next;
}
return rv_blank;
}
static rdfdiff_blank *
rdfdiff_lookup_blank(rdfdiff_file* file, char *blank_id)
{
rdfdiff_blank *rv_blank = rdfdiff_find_blank(file->first_blank, blank_id);
if(!rv_blank) {
rv_blank = rdfdiff_new_blank(file->world, blank_id);
if(rv_blank) {
if(!file->first_blank) {
file->first_blank = rv_blank;
file->last_blank = rv_blank;
} else {
file->last_blank->next = rv_blank;
file->last_blank = rv_blank;
}
}
}
return rv_blank;
}
static int
rdfdiff_add_blank_statement(rdfdiff_file* file,
raptor_statement *statement)
{
rdfdiff_blank *blank;
rdfdiff_link *dlink;
blank = rdfdiff_lookup_blank(file, (char *)statement->subject->value.blank.string);
if(!blank)
goto failed;
dlink = RAPTOR_MALLOC(rdfdiff_link*, sizeof(*dlink));
if(!dlink)
goto failed;
dlink->statement = raptor_statement_copy(statement);
if(!dlink->statement) {
RAPTOR_FREE(rdfdiff_link, dlink);
goto failed;
}
dlink->next = NULL;
if(!blank->first) {
blank->first = dlink;
blank->last = dlink;
} else {
blank->last->next = dlink;
blank->last = dlink;
}
return 0;
failed:
fprintf(stderr, "%s: Internal Error\n", program);
return 1;
}
static int
rdfdiff_add_blank_statement_owner(rdfdiff_file* file,
raptor_statement *statement)
{
rdfdiff_blank *blank;
blank = rdfdiff_lookup_blank(file,
(char*)statement->object->value.blank.string);
if(!blank)
goto failed;
if(blank->owner)
raptor_free_statement(blank->owner);
blank->owner = raptor_statement_copy(statement);
if(!blank->owner)
goto failed;
return 0;
failed:
fprintf(stderr, "%s: Internal Error\n", program);
return 1;
}
static int
rdfdiff_add_statement(rdfdiff_file* file, raptor_statement *statement)
{
int rv = 0;
rdfdiff_link *dlink = RAPTOR_MALLOC(rdfdiff_link*, sizeof(*dlink));
if(dlink) {
dlink->statement = raptor_statement_copy(statement);
if(dlink->statement) {
dlink->next = NULL;
if(!file->first) {
file->first = dlink;
file->last = dlink;
} else {
file->last->next = dlink;
file->last = dlink;
}
} else {
RAPTOR_FREE(rdfdiff_link, dlink);
rv = 1;
}
} else {
rv = 1;
}
if(rv != 0)
fprintf(stderr, "%s: Internal Error\n", program);
return rv;
}
static rdfdiff_link*
rdfdiff_statement_find(rdfdiff_file* file, const raptor_statement *statement,
rdfdiff_link** prev_p)
{
rdfdiff_link* prev = NULL;
rdfdiff_link* cur = file->first;
while(cur) {
if(rdfdiff_statement_equals(file->world, cur->statement, statement)) {
if(prev_p)
*prev_p=prev;
return cur;
}
prev = cur;
cur = cur->next;
}
return NULL;
}
static int
rdfdiff_statement_exists(rdfdiff_file* file, const raptor_statement *statement)
{
rdfdiff_link* node;
rdfdiff_link* prev = NULL;
node = rdfdiff_statement_find(file, statement, &prev);
return (node != NULL);
}
/*
* rdfdiff_collect_statements - Called when parsing "from" file to build a
* list of statements for comparison with those in the "to" file.
*/
static void
rdfdiff_collect_statements(void *user_data, raptor_statement *statement)
{
int rv = 0;
rdfdiff_file* file = (rdfdiff_file*)user_data;
if(rdfdiff_statement_exists(file, statement))
return;
file->statement_count++;
if(statement->subject->type == RAPTOR_TERM_TYPE_BLANK ||
statement->object->type == RAPTOR_TERM_TYPE_BLANK) {
if(statement->subject->type == RAPTOR_TERM_TYPE_BLANK)
rv = rdfdiff_add_blank_statement(file, statement);
if(rv == 0 && statement->object->type == RAPTOR_TERM_TYPE_BLANK)
rv = rdfdiff_add_blank_statement_owner(file, statement);
} else {
rv = rdfdiff_add_statement(file, statement);
}
if(rv != 0) {
raptor_parser_parse_abort(file->parser);
}
}
int
main(int argc, char *argv[])
{
raptor_world *world = NULL;
unsigned char *from_string = NULL;
unsigned char *to_string = NULL;
raptor_uri *from_uri = NULL;
raptor_uri *to_uri = NULL;
raptor_uri *base_uri = NULL;
const char *from_syntax = "rdfxml";
const char *to_syntax = "rdfxml";
int free_from_string = 0;
int free_to_string = 0;
int usage = 0;
int help = 0;
char *p;
int rv = 0;
rdfdiff_blank *b1;
rdfdiff_link *cur;
program = argv[0];
if((p = strrchr(program, '/')))
program = p+1;
else if((p = strrchr(program, '\\')))
program = p+1;
argv[0] = program;
world = raptor_new_world();
if(!world)
exit(1);
rv = raptor_world_open(world);
if(rv)
exit(1);
while(!usage && !help)
{
int c;
#ifdef HAVE_GETOPT_LONG
int option_index = 0;
c = getopt_long (argc, argv, GETOPT_STRING, long_options, &option_index);
#else
c = getopt (argc, argv, GETOPT_STRING);
#endif
if(c == -1)
break;
switch (c) {
case 0:
case '?': /* getopt() - unknown option */
usage = 1;
break;
case 'b':
brief = 1;
break;
case 'h':
help = 1;
break;
case 'f':
if(optarg)
from_syntax = optarg;
break;
case 't':
if(optarg)
to_syntax = optarg;
break;
case 'u':
if(optarg)
base_uri = raptor_new_uri(world, (const unsigned char*)optarg);
break;
}
}
if(optind != argc-2 && !help && !usage) {
usage = 2; /* Title and usage */
}
if(usage) {
if(usage > 1) {
fputs(title_string, stderr); putc(' ', stderr); fputs(raptor_version_string, stderr); putc('\n', stderr);
fputs(raptor_short_copyright_string, stderr);
fputc('\n', stderr);
}
fprintf(stderr, "Try `%s " HELP_ARG(h, help) "' for more information.\n",
program);
rv = 1;
goto exit;
}
if(help) {
printf("Usage: %s [OPTIONS] \n", program);
puts(title_string); putchar(' '); puts(raptor_version_string); putchar('\n');
puts(raptor_short_copyright_string);
puts("Find differences between two RDF files.");
puts("\nOPTIONS:");
puts(HELP_TEXT("h", "help ", "Print this help, then exit"));
puts(HELP_TEXT("b", "brief ", "Report only whether files differ"));
puts(HELP_TEXT("u BASE-URI", "base-uri BASE-URI ", "Set the base URI for the files"));
puts(HELP_TEXT("f FORMAT", "from-format FORMAT ", "Format of (default is rdfxml)"));
puts(HELP_TEXT("t FORMAT", "to-format FORMAT ", "Format of (default is rdfxml)"));
rv = 1;
goto exit;
}
from_string = (unsigned char *)argv[optind++];
to_string = (unsigned char *)argv[optind];
if(!access((const char *)from_string, R_OK)) {
char *filename = (char *)from_string;
from_string = raptor_uri_filename_to_uri_string(filename);
if(!from_string) {
fprintf(stderr, "%s: Failed to create URI for file %s.\n", program, filename);
rv = 2;
goto exit;
}
free_from_string = 1;
}
if(!access((const char *)to_string, R_OK)) {
char *filename = (char *)to_string;
to_string = raptor_uri_filename_to_uri_string(filename);
if(!to_string) {
fprintf(stderr, "%s: Failed to create URI for file %s.\n", program, filename);
rv = 2;
goto exit;
}
free_to_string = 1;
}
from_uri = raptor_new_uri(world, from_string);
if(!from_uri) {
fprintf(stderr, "%s: Failed to create URI for %s\n", program, from_string);
rv = 2;
goto exit;
}
to_uri = raptor_new_uri(world, to_string);
if(!to_uri) {
fprintf(stderr, "%s: Failed to create URI for %s\n", program, from_string);
rv = 2;
goto exit;
}
/* create and init "from" data structures */
from_file = rdfdiff_new_file(world, from_string, from_syntax);
if(!from_file) {
rv = 2;
goto exit;
}
/* create and init "to" data structures */
to_file = rdfdiff_new_file(world, to_string, to_syntax);
if(!to_file) {
rv = 2;
goto exit;
}
/* parse the files */
raptor_parser_set_statement_handler(from_file->parser, from_file,
rdfdiff_collect_statements);
if(raptor_parser_parse_uri(from_file->parser, from_uri, base_uri)) {
fprintf(stderr, "%s: Failed to parse URI %s as %s content\n", program,
from_string, from_syntax);
rv = 1;
goto exit;
} else {
/* Note intentional from_uri as base_uri */
raptor_parser_set_statement_handler(to_file->parser, to_file,
rdfdiff_collect_statements);
if(raptor_parser_parse_uri(to_file->parser, to_uri, base_uri ? base_uri: from_uri)) {
fprintf(stderr, "%s: Failed to parse URI %s as %s content\n", program,
to_string, to_syntax);
rv = 1;
goto exit;
}
}
/* Compare triples with no blank nodes */
cur = to_file->first;
while(cur) {
rdfdiff_link* node;
rdfdiff_link* prev;
node = rdfdiff_statement_find(from_file, cur->statement, &prev);
if(node) {
/* exists in from file - remove it from the list */
if(from_file->first == node) {
from_file->first = node->next;
} else {
prev->next = node->next;
}
raptor_free_statement(node->statement);
RAPTOR_FREE(rdfdiff_link, node);
} else {
if(!brief) {
if(emit_from_header) {
fprintf(stderr, "Statements in %s but not in %s\n",
to_file->name, from_file->name);
emit_from_header = 0;
}
fprintf(stderr, "< ");
raptor_statement_print_as_ntriples(cur->statement, stderr);
fprintf(stderr, "\n");
}
to_file->difference_count++;
}
cur = cur->next;
}
/* Now compare the blank nodes */
b1 = to_file->first_blank;
while(b1) {
rdfdiff_blank *b2 = from_file->first_blank;
while(b2) {
if(!b2->matched && rdfdiff_blank_equals(b1, b2, to_file, from_file)) {
b1->matched = 1;
b2->matched = 1;
break;
}
b2 = b2->next;
}
if(b2 == 0) {
if(!brief) {
#if 0
fprintf(stderr, "< ");
raptor_statement_print_as_ntriples(b1->owner, stderr);
fprintf(stderr, "\n");
#else
if(emit_from_header) {
fprintf(stderr, "Statements in %s but not in %s\n", to_file->name, from_file->name);
emit_from_header = 0;
}
fprintf(stderr, "< anonymous node %s\n", b1->blank_id);
#endif
}
to_file->difference_count++;
}
b1 = b1->next;
}
if(from_file->first) {
/* The entrys left in from_file have not been found in to_file. */
if(!brief) {
if(emit_to_header) {
fprintf(stderr, "Statements in %s but not in %s\n", from_file->name,
to_file->name);
emit_to_header = 0;
}
cur = from_file->first;
while(cur) {
if(!brief) {
fprintf(stderr, "> ");
raptor_statement_print_as_ntriples(cur->statement, stderr);
fprintf(stderr, "\n");
}
cur = cur->next;
from_file->difference_count++;
}
}
}
if(from_file->first_blank) {
rdfdiff_blank *blank = from_file->first_blank;
while(blank) {
if(!blank->matched) {
if(!brief) {
#if 0
fprintf(stderr, "> ");
raptor_statement_print_as_ntriples(blank->owner, stderr);
fprintf(stderr, "\n");
#else
if(emit_to_header) {
fprintf(stderr, "Statements in %s but not in %s\n", from_file->name, to_file->name);
emit_to_header = 0;
}
fprintf(stderr, "> anonymous node %s\n", blank->blank_id);
#endif
}
from_file->difference_count++;
}
blank = blank->next;
}
}
if(!(from_file->difference_count == 0 &&
to_file->difference_count == 0)) {
if(brief)
fprintf(stderr, "Files differ\n");
rv = 1;
}
exit:
if(base_uri)
raptor_free_uri(base_uri);
if(from_file)
rdfdiff_free_file(from_file);
if(to_file)
rdfdiff_free_file(to_file);
if(free_from_string)
raptor_free_memory(from_string);
if(free_to_string)
raptor_free_memory(to_string);
if(from_uri)
raptor_free_uri(from_uri);
if(to_uri)
raptor_free_uri(to_uri);
raptor_free_world(world);
return rv;
}
raptor2-2.0.16/utils/Makefile.am 0000644 0001750 0001750 00000004447 12433674556 013336 0000000 0000000 # -*- Mode: Makefile -*-
#
# Makefile.am - automake file for Raptor utils
#
# Copyright (C) 2000-2009, David Beckett http://www.dajobe.org/
# Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/
#
# This package is Free Software and part of Redland http://librdf.org/
#
# It is licensed under the following three licenses as alternatives:
# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version
# 2. GNU General Public License (GPL) V2 or any newer version
# 3. Apache License, V2.0 or any newer version
#
# You may not use this file except in compliance with at least one of
# the above three licenses.
#
# See LICENSE.html or LICENSE.txt at the top of this package for the
# complete terms and further detail along with the license texts for
# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively.
#
#
bin_PROGRAMS = rapper
noinst_PROGRAMS = rdfdiff
man_MANS = rapper.1
CLEANFILES = *.plist
# Memory debugging
MEM=@MEM@
MEM_LIBS=@MEM_LIBS@
AM_CPPFLAGS= $(MEM) -I$(top_srcdir)/src
LIBS=@LIBS@ $(MEM_LIBS)
ANALYZE = clang
ANALYZE_FLAGS = "--analyze"
# Based on COMPILE target
ANALYZE_COMMAND = $(ANALYZE) \
$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) \
$(ANALYZE_FLAGS)
EXTRA_DIST= \
CMakeLists.txt \
rapper.html \
$(man_MANS)
rapper_SOURCES = rapper.c
if GETOPT
rapper_SOURCES += getopt.c raptor_getopt.h
endif
rapper_LDADD= $(top_builddir)/src/libraptor2.la
rdfdiff_SOURCES = rdfdiff.c
if GETOPT
rdfdiff_SOURCES += getopt.c raptor_getopt.h
endif
rdfdiff_LDADD= $(top_builddir)/src/libraptor2.la
if MAINTAINER_MODE
rapper.html: $(srcdir)/rapper.1 $(srcdir)/../scripts/fix-groff-xhtml.pl
-groff -man -Thtml -P-l $< | tidy -asxml -wrap 1000 2>/dev/null | $(PERL) $(srcdir)/../scripts/fix-groff-xhtml.pl $@
endif
$(top_builddir)/src/libraptor2.la:
cd $(top_builddir)/src && $(MAKE) libraptor2.la
if MAINTAINER_MODE
# Run Clang static analyzer over sources.
analyze: $(SOURCES)
@list='$(SOURCES)'; \
result=0; \
for file in $$list; do \
if echo $$file | grep '\.c$$' >/dev/null 2>&1; then \
$(RECHO) "Analyzing $$file"; \
$(ANALYZE_COMMAND) $(srcdir)/$$file; \
status=$$?; \
if test $$status != 0; then \
result=1; \
fi; \
fi; \
done; \
set -e; exit $$result
endif
raptor2-2.0.16/utils/rapper.1 0000644 0001750 0001750 00000013444 14146554362 012645 0000000 0000000 .\" Hey, EMACS: -*- nroff -*-
.\"
.\" rapper.1 - Raptor RDF parsing and serializing utility manual page
.\"
.\" Copyright (C) 2002-2010 David Beckett - http://www.dajobe.org/
.\" Copyright (C) 2002-2005 University of Bristol - http://www.bristol.ac.uk/
.\"
.TH rapper 1 "2010-04-28"
.\" Please adjust this date whenever revising the manpage.
.SH NAME
rapper \- Raptor RDF parsing and serializing utility
.SH SYNOPSIS
.B rapper
.RB [ OPTIONS ]
.IR "INPUT-URI"
.IR "[INPUT-BASE-URI]"
.SH EXAMPLE
.nf
.B rapper -o ntriples http://planetrdf.com/guide/rss.rdf
.br
.B rapper -i rss-tag-soup -o rss-1.0 pile-of-rss.xml http://example.org/base/
.br
.B rapper --count http://example.org/index.rdf
.SH DESCRIPTION
The
.B rapper
utility allows parsing of RDF content by the
.B Raptor
RDF parser toolkit emitting the results as RDF triples in
a choice of syntaxes. The \fIINPUT-URI\fR can be a file name, '-'
for standard input or if Raptor is built with a WWW retrieval
library, a general URI. The optional \fIINPUT-BASE-URI\fR is used as the
document parser base URI if present otherwise defaults to the \fIINPUT-URI\fR.
A value of '-' means no base URI.
.SH OPTIONS
rapper uses the usual GNU command line syntax, with long
options starting with two dashes (`-') if supported by the
getopt_long function. Otherwise the short options are only available.
.TP
.B \-h, \-\-help
Show a summary of the options.
.TP
.B \-i, \-\-input FORMAT
Set the input
.I FORMAT
to one of 'rdfxml' (RDF/XML, default), 'ntriples'
(N-Triples, see below), 'turtle' (Turtle, see below)
or 'rss-tag-soup' (RSS Tag Soup). The RSS Tag Soup parser
can turn the many XML RSS formats, Atom 0.3 and Atom 1.0 into RDF
triples.
.IP
The list of
parsers depends on how libraptor(3) was built. The list of
supported parsers is given in the help summary given by \-h.
.TP
.B \-I, \-\-input-uri URI
Set the input/parser base
.I URI
or use value '-' for no base.
The default is the INPUT-URI argument value.
.TP
.B \-o, \-\-output FORMAT
Set the output
.I FORMAT
to 'ntriples' (N-Triples, default), 'rdfxml' (RDF/XML), 'rdfxml-abbrev'
(RDF/XML with abbreviations) or 'rss-1.0' (RSS 1.0, also an RDF/XML syntax).
.IP
The list of
serializers depends on how libraptor(3) was built. The list of
supported serializers is given in the help summary given by \-h.
.TP
.B \-O, \-\-output-uri URI
Set the output/serializer base
.I URI
or use value '-' for no base.
The default is the input base uri, either set by the argument
INPUT-BASE-URI or via options
.B \-I, \-\-input-uri URI
.TP
.B \-c, \-\-count
Only count the triples and produce no other output.
.TP
.B \-e, \-\-ignore-errors
Ignore errors, do not emit the messages and try to continue parsing.
.TP
.B \-f, \-\-feature FEATURE[=VALUE]
Set a parser or serializer feature
.I FEATURE
to a value, or to 1 if
.I VALUE
is omitted,
Use \-f help to get lists of valid parser and serializer features.
.IP
If the form \-f 'xmlns:\fIprefix\fP=\(dq\fIuri\fP\(dq' is used,
the prefix and namespace uri given will be set for serializing.
The syntax matches XML in that either or both of \fIprefix\fP
or \fIuri\fP can be omitted.
.TP
.B \-g, \-\-guess
Guess the parser to use from the source-URI rather than use
the \-i FORMAT.
.TP
.B \-q, \-\-quiet
No extra information messages.
.TP
.B \-r, \-\-replace-newlines
Replace newlines in multi-line literals with spaces.
.TP
.B \-\-show-graphs
Print graph names (URIs) as they are seen in the input. This only
has a meaning for parsers that support graph names such as the TRiG parser.
.TP
.B \-\-show-namespaces
Print namespaces as they are seen in the input.
.TP
.B \-t, \-\-trace
Print URIs retrieved during parsing. Especially useful for
monitoring what the guess and GRDDL parsers are doing.
.TP
.B \-w, \-\-ignore-warnings
Ignore warnings, do not emit the messages.
.TP
.B \-v, \-\-version
Print the raptor version and exit.
.SH "EXAMPLES"
.br
.B rapper -q -i ntriples -o rdfxml -f 'xmlns:rss="http://purl.org/rss/1.0/"' -f 'xmlns:ex="http://example.org/"' tests/test.nt
.br
.B rapper -q -o rdfxml -f 'xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"' tests/rdf-schema.rdf 'http://www.w3.org/2000/01/rdf-schema#'
.SH "CONFORMING TO"
\fIRDF/XML Syntax (Revised)\fR,
W3C Recommendation,
.UR http://www.w3.org/TR/rdf-syntax-grammar/
http://www.w3.org/TR/rdf-syntax-grammar/
.UE
\fIN-Triples\fR, in \fIRDF Test Cases\fR, Jan Grant and Dave Beckett (eds.),
W3C Recommendation,
.UR http://www.w3.org/TR/rdf-testcases/#ntriples
http://www.w3.org/TR/rdf-testcases/#ntriples
.UE
\fITurtle Terse RDF Triple Language\fR, Dave Beckett,
.UR http://www.dajobe.org/2004/01/turtle/
http://www.dajobe.org/2004/01/turtle/
.UE
\fIRDFA in XHTML: Syntax and Processing\fR, Ben Adida, Mark Birbeck,
Shane McCarron and Steven Pemberton (eds.),
W3C Candidate Recommendation, 20 June 2008
.UR http://www.w3.org/TR/2008/CR-rdfa-syntax-20080620/
http://www.w3.org/TR/2008/CR-rdfa-syntax-20080620/
.UE
\fIRDF Site Summary (RSS) 1.0\fR, 2000-12-06
.UR http://purl.org/rss/1.0/spec
http://purl.org/rss/1.0/spec
.UE
.SH SEE ALSO
.BR libraptor(3), raptor-config(1)
.SH CHANGES
.SS 2.0.0
Removed \-a option that did nothing.
.LP
Removed \-m option from rapper but it was never documented here.
.LP
Removed \-n option that was long hidden.
.LP
Removed \-s option that was equivalent to \-f scanForRDF
.SS 1.4.16
Added \-I/\-\-input-uri and \-O/\-\-output\-uri to set the input and output
(parser and serializer) base URIs separately.
.SS 1.4.15
Added \-t/\-\-trace to do URI traces.
.SS 1.4.5
Updated to add serializer rdfxml-abbrev
.SS 1.4.3
Updated potential parser and serializers and described \-f for
defining namespaces.
.SS 1.3.0
Added \-f for features.
.br
Added \-g for guessing the parser to use.
.SS 1.1.0
Removed \-a, \-\-assume since rdf:RDF is now always optional.
.br
.SH AUTHOR
Dave Beckett -
.UR http://www.dajobe.org/
http://www.dajobe.org/
.UE
.br
raptor2-2.0.16/LICENSE-2.0.txt 0000644 0001750 0001750 00000026136 10360131567 012244 0000000 0000000
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
raptor2-2.0.16/CMakeLists.txt 0000644 0001750 0001750 00000030275 14353466162 012673 0000000 0000000 # raptor/CMakeLists.txt
#
# This file allows building Raptor2 with the CMake configuration tool.
# Download CMake in source or binary form from http://www.cmake.org/
#
# Original listfile by Daniel Richard G.
# This file is in the public domain.
#
SET(RAPTOR_VERSION_MAJOR 2)
SET(RAPTOR_VERSION_MINOR 0)
SET(RAPTOR_VERSION_RELEASE 16)
SET(RAPTOR_MIN_VERSION_DECIMAL 20016)
SET(VERSION "${RAPTOR_VERSION_MAJOR}.${RAPTOR_VERSION_MINOR}.${RAPTOR_VERSION_RELEASE}")
MATH(EXPR RAPTOR_VERSION_DECIMAL "${RAPTOR_VERSION_MAJOR} * 10000 + ${RAPTOR_VERSION_MINOR} * 100 + ${RAPTOR_VERSION_RELEASE}")
PROJECT(Raptor2 C)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)
INCLUDE( GNUInstallDirs )
SET(CMAKE_INCLUDE_CURRENT_DIR 1)
################################################################
# Third-party libraries/dependencies
FIND_PACKAGE(CURL)
FIND_PACKAGE(LibXml2)
FIND_PACKAGE(LibXslt)
#FIND_PACKAGE(YAJL)
FIND_PACKAGE(Perl REQUIRED)
FIND_PACKAGE(BISON 3.4 REQUIRED)
FIND_PACKAGE(FLEX 2.5.19 REQUIRED)
if(EXISTS ${CURL_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS})
endif(EXISTS ${CURL_INCLUDE_DIRS})
if(EXISTS ${EXPAT_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${EXPAT_INCLUDE_DIRS})
endif(EXISTS ${EXPAT_INCLUDE_DIRS})
if(EXISTS ${LIBXML2_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
endif(EXISTS ${LIBXML2_INCLUDE_DIR})
if(EXISTS ${LIBXSLT_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${LIBXSLT_INCLUDE_DIRS})
endif(EXISTS ${LIBXSLT_INCLUDE_DIRS})
################################################################
# Configuration checks
INCLUDE(CheckIncludeFile)
INCLUDE(CheckIncludeFiles)
INCLUDE(CheckFunctionExists)
INCLUDE(CheckTypeSize)
INCLUDE(CheckStructHasMember)
INCLUDE(CheckCSourceCompiles)
CHECK_INCLUDE_FILE(errno.h HAVE_ERRNO_H)
CHECK_INCLUDE_FILE(fcntl.h HAVE_FCNTL_H)
CHECK_INCLUDE_FILE(getopt.h HAVE_GETOPT_H)
CHECK_INCLUDE_FILE(limits.h HAVE_LIMITS_H)
CHECK_INCLUDE_FILE(math.h HAVE_MATH_H)
CHECK_INCLUDE_FILE(setjmp.h HAVE_SETJMP_H)
CHECK_INCLUDE_FILE(stddef.h HAVE_STDDEF_H)
CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
CHECK_INCLUDE_FILE(time.h HAVE_TIME_H)
CHECK_INCLUDE_FILE(sys/param.h HAVE_SYS_PARAM_H)
CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
CHECK_INCLUDE_FILE(sys/time.h HAVE_SYS_TIME_H)
CHECK_INCLUDE_FILES("sys/time.h;time.h" TIME_WITH_SYS_TIME)
CHECK_FUNCTION_EXISTS(access HAVE_ACCESS)
CHECK_FUNCTION_EXISTS(_access HAVE__ACCESS)
CHECK_FUNCTION_EXISTS(getopt HAVE_GETOPT)
CHECK_FUNCTION_EXISTS(getopt_long HAVE_GETOPT_LONG)
CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
CHECK_FUNCTION_EXISTS(isascii HAVE_ISASCII)
CHECK_FUNCTION_EXISTS(setjmp HAVE_SETJMP)
CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF)
CHECK_FUNCTION_EXISTS(_snprintf HAVE__SNPRINTF)
CHECK_FUNCTION_EXISTS(stat HAVE_STAT)
CHECK_FUNCTION_EXISTS(strcasecmp HAVE_STRCASECMP)
CHECK_FUNCTION_EXISTS(stricmp HAVE_STRICMP)
CHECK_FUNCTION_EXISTS(_stricmp HAVE__STRICMP)
CHECK_FUNCTION_EXISTS(strtok_r HAVE_STRTOK_R)
CHECK_FUNCTION_EXISTS(vasprintf HAVE_VASPRINTF)
CHECK_FUNCTION_EXISTS(vsnprintf HAVE_VSNPRINTF)
CHECK_FUNCTION_EXISTS(_vsnprintf HAVE__VSNPRINTF)
CHECK_TYPE_SIZE("unsigned char" SIZEOF_UNSIGNED_CHAR)
CHECK_TYPE_SIZE("unsigned short" SIZEOF_UNSIGNED_SHORT)
CHECK_TYPE_SIZE("unsigned int" SIZEOF_UNSIGNED_INT)
CHECK_TYPE_SIZE("unsigned long" SIZEOF_UNSIGNED_LONG)
CHECK_TYPE_SIZE("unsigned long long" SIZEOF_UNSIGNED_LONG_LONG)
CHECK_C_SOURCE_COMPILES("
int main(void){ printf(__FUNCTION__); }"
HAVE___FUNCTION__
)
IF(LIBXML2_FOUND)
SET(CMAKE_REQUIRED_INCLUDES ${LIBXML2_INCLUDE_DIR})
SET(CMAKE_REQUIRED_LIBRARIES ${LIBXML2_LIBRARIES})
CHECK_FUNCTION_EXISTS(xmlCtxtUseOptions HAVE_XMLCTXTUSEOPTIONS)
CHECK_FUNCTION_EXISTS(xmlSAX2InternalSubset HAVE_XMLSAX2INTERNALSUBSET)
CHECK_STRUCT_HAS_MEMBER(
xmlEntity
name_length
libxml/parser.h
RAPTOR_LIBXML_ENTITY_NAME_LENGTH
)
CHECK_STRUCT_HAS_MEMBER(
xmlEntity
etype
libxml/parser.h
RAPTOR_LIBXML_ENTITY_ETYPE
)
CHECK_STRUCT_HAS_MEMBER(
xmlSAXHandler
initialized
libxml/parser.h
RAPTOR_LIBXML_XMLSAXHANDLER_INITIALIZED
)
CHECK_STRUCT_HAS_MEMBER(
xmlSAXHandler
externalSubset
libxml/parser.h
RAPTOR_LIBXML_XMLSAXHANDLER_EXTERNALSUBSET
)
CHECK_C_SOURCE_COMPILES("
#include
int main(void){ xmlParserOption foo; foo = XML_PARSE_NONET; return 0; }"
RAPTOR_LIBXML_XML_PARSE_NONET
)
CHECK_C_SOURCE_COMPILES("
#include
int main(void){ htmlParserOption foo; foo = HTML_PARSE_NONET; return 0; }"
RAPTOR_LIBXML_HTML_PARSE_NONET
)
SET(CMAKE_REQUIRED_INCLUDES)
SET(CMAKE_REQUIRED_LIBRARIES)
ENDIF(LIBXML2_FOUND)
################################################################
# User-configurable options
#
# (Note: The CMake GUI displays these in alphabetical order, regardless of
# the order we use here)
SET(BUILD_SHARED_LIBS ON CACHE BOOL
"Build shared libraries instead of static ones.")
IF(BUILD_SHARED_LIBS)
SET(RAPTOR_STATIC FALSE)
ELSE(BUILD_SHARED_LIBS)
SET(RAPTOR_STATIC TRUE)
ENDIF(BUILD_SHARED_LIBS)
SET(RAPTOR_XML_INIT none)
IF(LIBXML2_FOUND)
SET(RAPTOR_XML_INIT libxml)
ENDIF(LIBXML2_FOUND)
SET(RAPTOR_XML ${RAPTOR_XML_INIT} CACHE STRING
"Which XML library to use (any of \"libxml\", \"none\").")
SET(RAPTOR_XML_DEFINE RAPTOR_XML_NONE)
IF(RAPTOR_XML STREQUAL "libxml")
SET(RAPTOR_XML_DEFINE RAPTOR_XML_LIBXML)
ENDIF(RAPTOR_XML STREQUAL "libxml")
SET(RAPTOR_WWW_INIT none)
IF(LIBXML2_FOUND)
SET(RAPTOR_WWW_INIT xml)
ENDIF(LIBXML2_FOUND)
IF(CURL_FOUND)
SET(RAPTOR_WWW_INIT curl)
ENDIF(CURL_FOUND)
SET(RAPTOR_WWW ${RAPTOR_WWW_INIT} CACHE STRING
"Which WWW library to use (any of \"curl\", \"xml\", \"none\").")
SET(RAPTOR_WWW_DEFINE RAPTOR_WWW_NONE)
IF(RAPTOR_WWW STREQUAL "curl")
SET(RAPTOR_WWW_DEFINE RAPTOR_WWW_LIBCURL)
ELSEIF(RAPTOR_WWW STREQUAL "xml")
SET(RAPTOR_WWW_DEFINE RAPTOR_WWW_LIBXML)
ENDIF(RAPTOR_WWW STREQUAL "curl")
SET(RAPTOR_XML_1_1 FALSE CACHE BOOL
"Use XML version 1.1 name checking.")
SET(HAVE_RAPTOR_PARSE_DATE 1)
SET(RAPTOR_PARSEDATE 1)
SET(RAPTOR_PARSER_RDFXML_INIT FALSE)
IF(LIBXML2_FOUND)
SET(RAPTOR_PARSER_RDFXML_INIT TRUE)
ENDIF(LIBXML2_FOUND)
SET(RAPTOR_PARSER_GRDDL_INIT FALSE)
IF(LIBXML2_FOUND AND LIBXSLT_FOUND)
SET(RAPTOR_PARSER_GRDDL_INIT TRUE)
ENDIF(LIBXML2_FOUND AND LIBXSLT_FOUND)
SET(RAPTOR_PARSER_RDFXML ${RAPTOR_PARSER_RDFXML_INIT}
CACHE BOOL "Build RDF/XML parser.")
SET(RAPTOR_PARSER_NTRIPLES TRUE
CACHE BOOL "Build N-Triples parser.")
SET(RAPTOR_PARSER_TURTLE TRUE
CACHE BOOL "Build Turtle parser.")
SET(RAPTOR_PARSER_TRIG TRUE
CACHE BOOL "Build TRiG parser.")
SET(RAPTOR_PARSER_RSS ${LIBXML2_FOUND}
CACHE BOOL "Build RSS Tag Soup parser.")
SET(RAPTOR_PARSER_GRDDL ${RAPTOR_PARSER_GRDDL_INIT}
CACHE BOOL "Build GRDDL parser.")
SET(RAPTOR_PARSER_GUESS TRUE
CACHE BOOL "Build guess parser.")
SET(RAPTOR_PARSER_RDFA ${LIBXML2_FOUND}
CACHE BOOL "Build RDFA parser.")
SET(RAPTOR_PARSER_JSON ${YAJL_FOUND}
CACHE BOOL "Build JSON parser.")
SET(RAPTOR_PARSER_NQUADS TRUE
CACHE BOOL "Build N-Quads parser.")
SET(RAPTOR_SERIALIZER_RDFXML TRUE
CACHE BOOL "Build RDF/XML serializer.")
SET(RAPTOR_SERIALIZER_NTRIPLES TRUE
CACHE BOOL "Build N-Triples serializer.")
SET(RAPTOR_SERIALIZER_RDFXML_ABBREV TRUE
CACHE BOOL "Build RDF/XML-abbreviated serializer.")
SET(RAPTOR_SERIALIZER_TURTLE TRUE
CACHE BOOL "Build Turtle serializer.")
SET(RAPTOR_SERIALIZER_RSS_1_0 TRUE
CACHE BOOL "Build RSS 1.0 serializer.")
SET(RAPTOR_SERIALIZER_ATOM TRUE
CACHE BOOL "Build Atom 1.0 serializer.")
SET(RAPTOR_SERIALIZER_DOT TRUE
CACHE BOOL "Build GraphViz DOT serializer.")
SET(RAPTOR_SERIALIZER_HTML TRUE
CACHE BOOL "Build HTML Table serializer.")
SET(RAPTOR_SERIALIZER_JSON TRUE
CACHE BOOL "Build JSON serializer.")
SET(RAPTOR_SERIALIZER_NQUADS TRUE
CACHE BOOL "Build N-Quads serializer.")
################################################################
CONFIGURE_FILE(
src/raptor_config_cmake.h.in
src/raptor_config.h
@ONLY
)
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
CONFIGURE_FILE(
src/raptor2.h.in
src/raptor2.h
@ONLY
)
################################################################
message(STATUS "
################################################################
Raptor Configuration Summary
################################################################
http://librdf.org/raptor/
Configured on host $ENV{COMPUTERNAME} ${HOSTNAME}
host OS ${CMAKE_SYSTEM_NAME}
host architecture ${CMAKE_SYSTEM_PROCESSOR}
General flags:
CC ${CMAKE_C_COMPILER}
CXX (not used) ${CMAKE_CXX_COMPILER}
CFLAGS ${CMAKE_C_FLAGS}
CXXFLAGS ${CMAKE_CXX_FLAGS}
LDFLAGS ${CMAKE_EXE_LINKER_FLAGS}
Installation prefix: ${CMAKE_INSTALL_PREFIX}
Dependencies (packages marked with *** are required):
"
)
message( " *** Perl ${PERL_EXECUTABLE}")
message( " *** Bison ${BISON_EXECUTABLE}")
message( " *** Flex ${FLEX_EXECUTABLE}")
message( " *** libxml2 (lib) ${LIBXML2_LIBRARIES}")
message( " *** libxml2 (include) ${LIBXML2_INCLUDE_DIR}")
################################################################
# On Windows, the test/utility programs usually have DLL dependencies that
# make them cumbersome to invoke within IDE environments, so we enable the
# test suite only when makefiles are being used.
#
# Note that a partial solution is described at
#
# http://www.cmake.org/pipermail/cmake/2009-May/029464.html
#
# but we don't have a good way of knowing where the third-party DLLs are.
#
IF(CMAKE_GENERATOR MATCHES "Makefiles")
ENABLE_TESTING()
ENDIF(CMAKE_GENERATOR MATCHES "Makefiles")
SUBDIRS(src)
SUBDIRS(utils)
################################################################
FIND_PROGRAM(JING jing)
IF(NOT JING STREQUAL "JING-NOTFOUND")
SET(HAVE_JING TRUE)
ENDIF(NOT JING STREQUAL "JING-NOTFOUND")
SET(RAPPER ${CMAKE_BINARY_DIR}/utils/rapper)
SET(RDFDIFF ${CMAKE_BINARY_DIR}/utils/rdfdiff)
MACRO(RAPPER_TEST NAME_PREFIX COMMAND OUTPUT REFERENCE)
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test-${NAME_PREFIX}.cmake "
EXECUTE_PROCESS(
COMMAND ${COMMAND}
TIMEOUT 10
OUTPUT_FILE ${OUTPUT}.raw
ERROR_QUIET
)
# http://public.kitware.com/Bug/view.php?id=13007
CONFIGURE_FILE(
${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT}.raw
${OUTPUT}
@ONLY
NEWLINE_STYLE UNIX
)
")
ADD_TEST("${NAME_PREFIX}:run" ${CMAKE_COMMAND} -P test-${NAME_PREFIX}.cmake)
ADD_TEST("${NAME_PREFIX}:cmp" ${CMAKE_COMMAND} -E compare_files ${REFERENCE} ${OUTPUT})
ENDMACRO(RAPPER_TEST NAME_PREFIX COMMAND OUTPUT REFERENCE)
INCLUDE(CMakeParseArguments)
FUNCTION(RAPPER_RDFDIFF_TEST TEST_NAME RAPPER_COMMAND RAPPER_OUTPUT RDFDIFF_COMMAND)
# http://www.cmake.org/pipermail/cmake/2012-July/051309.html
SET(options EXPECTED_FAILURE)
SET(oneValueArgs )
SET(multiValueArgs )
CMAKE_PARSE_ARGUMENTS(RRT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
SET(TEST_NAME ${ARGV0})
SET(RAPPER_COMMAND ${ARGV1})
SET(RAPPER_OUTPUT ${ARGV2})
SET(RDFDIFF_COMMAND ${ARGV3})
# workaround because TRUE is not true in a CMake IF
IF(RRT_EXPECTED_FAILURE)
SET(EXPECT_FAILURE 1)
ELSE()
SET(EXPECT_FAILURE 0)
ENDIF()
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test-${TEST_NAME}.cmake "
SET(rdfdiff_status -1)
EXECUTE_PROCESS(
COMMAND ${RAPPER_COMMAND}
TIMEOUT 10
OUTPUT_FILE ${RAPPER_OUTPUT}
ERROR_QUIET
RESULT_VARIABLE rapper_status
)
IF(rapper_status EQUAL 0 OR rapper_status EQUAL 2)
EXECUTE_PROCESS(
COMMAND ${RDFDIFF_COMMAND}
TIMEOUT 10
OUTPUT_QUIET
ERROR_QUIET
RESULT_VARIABLE rdfdiff_status
)
ENDIF(rapper_status EQUAL 0 OR rapper_status EQUAL 2)
IF(${EXPECT_FAILURE})
IF(rdfdiff_status EQUAL 0)
MESSAGE(FATAL_ERROR \"Test succeeded, but expected to fail.\")
ENDIF(rdfdiff_status EQUAL 0)
ELSE()
IF(NOT rdfdiff_status EQUAL 0)
MESSAGE(FATAL_ERROR \"Test failed.\")
ENDIF(NOT rdfdiff_status EQUAL 0)
ENDIF()
")
ADD_TEST(${TEST_NAME} ${CMAKE_COMMAND} -P test-${TEST_NAME}.cmake)
ENDFUNCTION(RAPPER_RDFDIFF_TEST)
SUBDIRS(tests/feeds)
SUBDIRS(tests/grddl)
SUBDIRS(tests/json)
SUBDIRS(tests/ntriples)
SUBDIRS(tests/rdfa)
SUBDIRS(tests/rdfa11)
SUBDIRS(tests/rdfxml)
SUBDIRS(tests/trig)
#SUBDIRS(tests/turtle) # TODO
# end raptor/CMakeLists.txt
raptor2-2.0.16/autogen.sh 0000755 0001750 0001750 00000024643 12466757645 012152 0000000 0000000 #!/bin/sh
#
# autogen.sh - Generates initial makefiles from a pristine source tree
#
# USAGE:
# autogen.sh [configure options]
#
# Configuration is affected by environment variables as follows:
#
# DRYRUN
# If set to any value it will do no configuring but will emit the
# programs that would be run.
# e.g. DRYRUN=1 ./autogen.sh
#
# NOCONFIGURE
# If set to any value it will generate all files but not invoke the
# generated configure script.
# e.g. NOCONFIGURE=1 ./autogen.sh
#
# AUTOMAKE ACLOCAL AUTOCONF AUTOHEADER LIBTOOLIZE GTKDOCIZE
# If set (named after program) then this overrides any searching for
# the programs on the current PATH.
# e.g. AUTOMAKE=automake-1.7 ACLOCAL=aclocal-1.7 ./autogen.sh
#
# CONFIG_DIR (default ../config)
# The directory where fresh GNU config.guess and config.sub can be
# found for automatic copying in-place.
#
# PATH
# Where the programs are searched for
#
# SRCDIR (default .)
# Source directory
#
# This script is based on similar scripts used in various tools
# commonly made available via CVS and used with GNU automake.
# Try 'locate autogen.sh' on your system and see what you get.
#
# This script is in the public domain
#
# Directory for the sources
SRCDIR=${SRCDIR-.}
# Where the GNU config.sub, config.guess might be found
CONFIG_DIR=${CONFIG_DIR-../config}
# GIT sub modules file
GITMODULES='.gitmodules'
# The programs required for configuring which will be searched for
# in the current PATH.
# Set an envariable of the same name in uppercase, to override scan
#
programs="automake aclocal autoconf autoheader libtoolize"
confs=`find . -name configure.ac -print | grep -v /releases/`
gtkdoc_args=
if grep "^GTK_DOC_CHECK" $confs >/dev/null; then
programs="$programs gtkdocize"
gtkdoc_args="--enable-gtk-doc"
fi
if grep "^AC_CHECK_PROGS.SWIG" $confs >/dev/null; then
programs="$programs swig"
fi
ltdl_args=
if grep "^AC_LIBLTDL_" $confs >/dev/null; then
ltdl_args="--ltdl"
fi
silent_args=
if grep "^AM_SILENT_RULES" $confs >/dev/null; then
silent_args="--enable-silent-rules"
fi
# Some dependencies for autotools:
# automake 1.13 requires autoconf 2.65
# automake 1.12 requires autoconf 2.62
# automake 1.11 requires autoconf 2.62 (needed for AM_SILENT_RULES)
automake_min_vers=011102
aclocal_min_vers=$automake_min_vers
autoconf_min_vers=026200
autoheader_min_vers=$autoconf_min_vers
# libtool 2.2 required for LT_INIT language fix
libtoolize_min_vers=020200
gtkdocize_min_vers=010300
swig_min_vers=010324
# Default program arguments
automake_args="--gnu --add-missing --force --copy -Wall"
aclocal_args="-Wall"
autoconf_args="-Wall"
libtoolize_args="--force --copy --automake $ltdl_args"
gtkdocize_args="--copy"
# --enable-gtk-doc does no harm if it's not available
configure_args="--enable-maintainer-mode $gtkdoc_args $silent_args"
# You should not need to edit below here
######################################################################
# number comparisons may need a C locale
LANG=C
LC_NUMERIC=C
program=`basename $0`
if test "X$DRYRUN" != X; then
DRYRUN=echo
fi
cat > autogen-get-version.pl <&1 |") || next;
while() {
chomp;
next if @vnums; # drain pipe if we got a vnums
# Add optional leading g
next unless /^g?\$mname/i;
my(\$v)=/(\S+)\$/i; \$v =~ s/-.*\$//;
@vnums=grep { defined \$_ && !/^\s*\$/} map { s/\D//g; \$_; } split(/\./, \$v);
}
close(PIPE);
last if @vnums;
}
@vnums=(@vnums, 0, 0, 0)[0..2];
\$vn=join('', map { sprintf('%02d', \$_) } @vnums);
print "\$vn\n";
exit 0;
EOF
autogen_get_version="`pwd`/autogen-get-version.pl"
trap "rm -f $autogen_get_version" 0 1 9 15
update_prog_version() {
dir=$1
prog=$2
# If there exists an envariable PROG in uppercase, use that and do not scan
ucprog=`echo $prog | tr 'a-z' 'A-Z' `
eval env=\$${ucprog}
if test X$env != X; then
prog_name=$env
prog_vers=`perl $autogen_get_version $prog_name $prog`
if test X$prog_vers = X; then
prog_vers=0
fi
eval ${prog}_name=${prog_name}
eval ${prog}_vers=${prog_vers}
eval ${prog}_dir=environment
return
fi
eval prog_name=\$${prog}_name
eval prog_vers=\$${prog}_vers
eval prog_dir=\$${prog}_dir
if test X$prog_vers = X; then
prog_vers=0
fi
save_PATH="$PATH"
cd "$dir"
PATH=".:$PATH"
nameglob="$prog*"
if [ -x /usr/bin/uname ]; then
if [ `/usr/bin/uname` = 'Darwin' -a $prog = 'libtoolize' ] ; then
nameglob="g$nameglob"
fi
fi
names=`ls $nameglob 2>/dev/null`
if [ "X$names" != "X" ]; then
for name in $names; do
vers=`perl $autogen_get_version $dir/$name $prog`
if [ "X$vers" = "X" ]; then
continue
fi
if expr $vers '>' $prog_vers >/dev/null; then
prog_name=$name
prog_vers=$vers
prog_dir="$dir"
fi
done
fi
eval ${prog}_name=${prog_name}
eval ${prog}_vers=${prog_vers}
eval ${prog}_dir=${prog_dir}
PATH="$save_PATH"
}
check_prog_version() {
prog=$1
eval min=\$${prog}_min_vers
eval prog_name=\$${prog}_name
eval prog_vers=\$${prog}_vers
eval prog_dir=\$${prog}_dir
echo "$program: $prog program '$prog_name' V $prog_vers (min $min) in $prog_dir" 1>&2
rc=1
if test $prog_vers != 0; then
if expr $prog_vers '<' $min >/dev/null; then
echo "$program: ERROR: \`$prog' version $prog_vers in $prog_dir is too old."
echo " (version $min or newer is required)"
rc=0
else
# Things are ok, so set the ${prog} name
eval ${prog}=${prog_name}
fi
else
echo "$program: ERROR: You must have \`$prog' installed to compile this package."
echo " (version $min or newer is required)"
rc=0
fi
return $rc
}
# Find newest version of programs in the current PATH
save_args=${1+"$*"}
save_ifs="$IFS"
IFS=":"
set - $PATH
IFS="$save_ifs"
echo "$program: Looking for programs: $programs"
here=`pwd`
while [ $# -ne 0 ] ; do
dir=$1
shift
if [ ! -d "$dir" ]; then
continue
fi
for prog in $programs; do
update_prog_version "$dir" $prog
done
done
cd $here
set - $save_args
# END Find programs
# Check the versions meet the requirements
for prog in $programs; do
if check_prog_version $prog; then
exit 1
fi
done
echo "$program: Dependencies satisfied"
if test -d $SRCDIR/libltdl; then
touch $SRCDIR/libltdl/NO-AUTO-GEN
fi
config_dir=
if test -d $CONFIG_DIR; then
config_dir=`cd $CONFIG_DIR; pwd`
fi
# Initialise and/or update GIT submodules
if test -f $GITMODULES ; then
echo " "
modules=`sed -n -e 's/^.*path = \(.*\)/\1/p' $GITMODULES`
for module in $modules; do
if test `ls -1 $module | wc -l` -eq 0; then
echo "$program: Initializing git submodule in $module"
$DRYRUN git submodule init $module
fi
done
echo "$program: Updating git submodules: $modules"
$DRYRUN git submodule update
fi
for coin in `find $SRCDIR -name configure.ac -print | grep -v /releases/`
do
status=0
dir=`dirname $coin`
if test -f "$dir/NO-AUTO-GEN"; then
echo "$program: Skipping $dir -- flagged as no auto-generation"
else
echo " "
echo $program: Processing directory $dir
( cd "$dir"
# Ensure that these are created by the versions on this system
# (indirectly via automake)
$DRYRUN rm -f ltconfig ltmain.sh libtool stamp-h*
# Made by automake
$DRYRUN rm -f missing depcomp
# automake junk
$DRYRUN rm -rf autom4te*.cache
config_macro_dir=`sed -ne 's/^AC_CONFIG_MACRO_DIR(\([^)]*\).*/\1/p' configure.ac`
if test "X$config_macro_dir" = X; then
config_macro_dir=.
else
aclocal_args="$aclocal_args -I $config_macro_dir "
fi
config_aux_dir=`sed -ne 's/^AC_CONFIG_AUX_DIR(\([^)]*\).*/\1/p' configure.ac`
if test "X$config_aux_dir" = X; then
config_aux_dir=.
fi
if test "X$config_dir" != X; then
echo "$program: Updating config.guess and config.sub"
for file in config.guess config.sub; do
cfile=$config_dir/$file
xfile=$config_aux_dir/$file
if test -f $cfile; then
$DRYRUN rm -f $xfile
$DRYRUN cp -p $cfile $xfile
fi
done
fi
echo "$program: Running $libtoolize $libtoolize_args"
$DRYRUN rm -f ltmain.sh libtool
eval $DRYRUN $libtoolize $libtoolize_args
status=$?
if test $status != 0; then
break
fi
if grep "^GTK_DOC_CHECK" configure.ac >/dev/null; then
# gtkdocize junk
$DRYRUN rm -rf gtk-doc.make
echo "$program: Running $gtkdocize $gtkdocize_args"
$DRYRUN $gtkdocize $gtkdocize_args
status=$?
if test $status != 0; then
break
fi
fi
for docs in NEWS README; do
if test ! -f $docs; then
echo "$program: Creating empty $docs file to allow configure to work"
$DRYRUN touch -t 200001010000 $docs
fi
done
echo "$program: Running $aclocal $aclocal_args"
$DRYRUN $aclocal $aclocal_args
if grep "^A[CM]_CONFIG_HEADER" configure.ac >/dev/null; then
echo "$program: Running $autoheader"
$DRYRUN $autoheader
status=$?
if test $status != 0; then
break
fi
fi
echo "$program: Running $automake $automake_args"
$DRYRUN $automake $automake_args
status=$?
if test $status != 0; then
break
fi
echo "$program: Running $autoconf $autoconf_args"
$DRYRUN $autoconf $autoconf_args
status=$?
if test $status != 0; then
break
fi
)
fi
if test $status != 0; then
echo "$program: FAILED to configure $dir"
exit $status
fi
done
rm -f config.cache
AUTOMAKE=$automake
AUTOCONF=$autoconf
ACLOCAL=$aclocal
export AUTOMAKE AUTOCONF ACLOCAL
if test "X$NOCONFIGURE" = X; then
echo " "
if test -z "$*"; then
echo "$program: WARNING: Running \`configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo "\`$program' command line."
fi
echo "$program: Running ./configure $configure_args $@"
if test "X$DRYRUN" = X; then
$DRYRUN ./configure $configure_args "$@" \
&& echo "$program: Now type \`make' to compile this package" || exit 1
else
$DRYRUN ./configure $configure_args "$@"
fi
fi
exit $status
raptor2-2.0.16/UPGRADING.html 0000644 0001750 0001750 00000012776 14377546071 012353 0000000 0000000
Raptor RDF Syntax Library - Upgrading to the Raptor V2 API
Raptor RDF Syntax Library - Upgrading to the Raptor V2 API
Raptor V2 is a major new version of the Raptor V1 API with many
cleanups and changes that include adding, removing and re-ordering
parameters, adding and removing return types as well as renaming the
functions.
The headers and libraries install to different places or names so
that Raptor V1 and Raptor V2 can both be present (including headers)
on the same system without clashing. However, if you do try linking
the same binary with both libraries, the symbols will clash and the
program will fail in mysterious ways if it runs at all. There are
only two installed files that overlap - the rapper
utility and it's manual page.
Configuration and compiling changes
Raptor V2 uses pkg-config(1) to provide the compile
and link parameters whereas Raptor V1 supports that as well as a
script raptor-config. The recommended linking approach
is now as follows:
cc -o prog prog.c `pkg-config raptor2 --cflags` `pkg-config raptor2 --libs`
Shown here as a compile in link all in one line but you typically
split that into two stages.
cc -c `pkg-config raptor2 --cflags` raptor-module.c
...
cc -o prog raptor-module.c ... other modules ... `pkg-config raptor2 --libs`
Code changes
There are significant API changes, which are described in the
Release Notes in long summary form with
some background to why, in the ChangeLog in
very long form. The reference manual contains
a section
describing what was added, deleted, renamed and otherwise changed for
both the functions exported from the library, as well as the
typedefs and enum values.
There is no fully automatic way to handle updating the code
however there is a perl script provided in the docs directory that
renames what it can, and otherwise inserts a WARNING comment near
code that needs manual updating. This cannot be automated in some
places such as when the fields of the raptor_statement object were
replaced with raptor_term pointers. The script is used like
perl docs/upgrade-script.plsource files for example
$ perl docs/upgrade-script.pl prog.c
and then edit the file prog.c and search for WARNING:
for any places that manual editing is needed.
Handling Raptor V1 or Raptor V2 in the same code
If you need to handle both APIs in the same codebase as
alternatives, it is recommended that you use the following approach.
Create an application #define that records the choice of
which API you want to use. You can do this triggered on whichever
raptor.h is in the include path by #ifdef
RAPTOR_V2_AVAILABLE but that may be dangerous if both
libraries and headers are present. A better choice is an application
specific define that is determined by a configuration step.
Once the choice is made, it is recommended you convert the
code to the Raptor V2 API and then add backwards-compatible macros
for the changed functions:
Where the code cannot be done by simple expansion such as use of
raptor_init() and raptor_finish() in V1
that are replaced by the functions around the world object in V2, use
an #ifdef that provides the two code paths.
rasqal
in GIT (will be 0.9.20) uses this approach.
Another approach if the Raptor V1 code is in a separate module /
source file is to copy it and make a V2 version and then choose the
file to use at configure or build time.
Either way, basing the interface on the V2 APIs makes it clear
what to remove when V1 is no longer supported.
Packaging recommendations for distributors
Since Raptor V2 probably needs to be installed in parallel with V1
for some time, at least for the different libraries and headers, both
need to be packaged such that no files clash.
There are, however, two files that are shared after a 'make install':
rapper(1) and rapper.1 the manual page.
For packaging systems that split the installation into multiple
packages (libraries, headers, docs, debug files), these two files
should be in a package of their own that replace and conflict with
the earlier files. (This is what I have done with the Debian
packages raptor-utils and raptor2-utils). For packaging systems that
do not use multiple packages, you will have to either leave these
files out of the V2 package or migrate them from the V1 package to
the V2 package using dependencies to ensure there are no conflicts.
The advantage of making the V2 version of rapper is that it means
the command-line utility under the well known name uses the latest
Raptor code.