John Emmas | 22 May 13:47
Picon

Bug in raptor_vsnprintf()

I've found a bug in raptor_vsnprintf2() (raptor2).  Where should I report it?  For anyone who's curious, here's the problem:-


int
raptor_vsnprintf2(char *buffer, size_t size,
                  const char *format, va_list arguments)
{
  size_t len;

  RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(format, char*, 0);

#ifdef CHECK_VSNPRINTF_RUNTIME

  if(vsnprintf_is_c99())
    VSNPRINTF_C99_BLOCK(len, buffer, size, format, arguments) ;
  else
    VSNPRINTF_NOT_C99_BLOCK(len, buffer, size, format, arguments) ;

#else

#ifdef HAVE_C99_VSNPRINTF
  VSNPRINTF_C99_BLOCK(len, buffer, size, format, arguments) ;
#else
  VSNPRINTF_NOT_C99_BLOCK(len, buffer, size, format, arguments) ;
#endif

#endif

  

  return RAPTOR_BAD_CAST(int, len);
}

Note that 'len' is uninitialised when it gets passed to either of the macros (VSNPRINTF_NOT_C99_BLOCK, in my case).  In abbreviated form, the macro translates to this code:-

#define VSNPRINTF_NOT_C99_BLOCK(len, buffer, size, format, arguments)   \
  do {                                                                  \
    if(!buffer || !size) {                                              \
      /* This vsnprintf doesn't return number of bytes required */      \
      size = 2 + strlen(format);                                        \
      len = -1;                                                         \
      /* Do some other stuff (includes setting */                       \
      /* the correct value for 'len')          */                       \
    }                                                                   \
                                                                        \
    if(buffer)                                                          \
      vsnprintf(buffer, len, format, arguments);                        \
  } while(0)

The variable 'len' gets passed to vsnprintf() - but if 'buffer' and 'size' both started off with nonzero values, 'len' will contain a garbage value.

Hope that makes sense.

John
_______________________________________________
redland-dev mailing list
redland-dev@...
http://lists.librdf.org/mailman/listinfo/redland-dev
Mantis Bug Tracker | 19 May 22:53
Favicon

[Rasqal RDF Query Library 0000506]: configure.ac has bash -specific (non-POSIX) == syntax


The following issue has been SUBMITTED. 
====================================================================== 
http://bugs.librdf.org/mantis/view.php?id=506 
====================================================================== 
Reported By:                ssuominen
Assigned To:                
====================================================================== 
Project:                    Rasqal RDF Query Library
Issue ID:                   506
Category:                   portability
Reproducibility:            always
Severity:                   trivial
Priority:                   high
Status:                     new
Query Language:              
====================================================================== 
Date Submitted:             2012-05-19 20:53
Last Modified:              2012-05-19 20:53
====================================================================== 
Summary:                    configure.ac has bash -specific (non-POSIX) ==
syntax
Description: 
Line 1124 of configure.ac has this:

if test "$random_approach" == none; then

But it should have this:

if test "$random_approach" = none; then

As in, change the == to =

This was reported downstream here,

http://bugs.gentoo.org/416659

This will cause problems for example, if /bin/sh is dash
Or BSD systems
Or any Unix system with /bin/sh not bash

Steps to Reproduce: 
.

Additional Information: 
.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-05-19 20:53 ssuominen      New Issue                                    
======================================================================
Mantis Bug Tracker | 14 May 14:57
Favicon

[Raptor RDF Syntax Library 0000505]: Parsing certain escaped unicode strings in Turtle cases an error


The following issue has been SUBMITTED. 
====================================================================== 
http://bugs.librdf.org/mantis/view.php?id=505 
====================================================================== 
Reported By:                swh
Assigned To:                
====================================================================== 
Project:                    Raptor RDF Syntax Library
Issue ID:                   505
Category:                   api
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     new
Syntax Name:                Turtle 
====================================================================== 
Date Submitted:             2012-05-14 12:57
Last Modified:              2012-05-14 12:57
====================================================================== 
Summary:                    Parsing certain escaped unicode strings in Turtle
cases an error
Description: 
Trying to parse the following Turtle document causes an error:

   @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

   <x> rdfs:label "\ud801\udc69" .

Both of the unicode codepoints are "unusual", they're surrogates, but should be
legal in Turtle.

The error is:

$ rapper -i turtle /tmp/foo.ttl 
rapper: Parsing URI file:///tmp/foo.ttl with parser turtle
rapper: Serializing with serializer ntriples
rapper: Error - URI file:///tmp/foo.ttl:3 - turtle_copy_string_token failed
rapper: Error - URI file:///tmp/foo.ttl:3 - syntax error
rapper: Parsing returned 0 triples

Steps to Reproduce: 
rapper -i turtle /tmp/foo.ttl

Additional Information: 
It fails with 2.0.4 as well, not tried other versions.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-05-14 12:57 swh            New Issue                                    
======================================================================
Dave Beckett | 14 May 05:53
Favicon
Gravatar

ANNOUNCEMENT: Rasqal RDF Query Library 0.9.29


		   Rasqal RDF Query Library 0.9.29
		      http://librdf.org/rasqal/

Rasqal is a free software / Open Source C library that handles Resource
Description Framework (RDF) query language syntaxes, query construction
and execution of queries returning results as bindings, boolean, RDF
graphs/triples or syntaxes. The supported query languages are:
  SPARQL 1.0[3], RDQL (will be removed in 0.9.30),
  SPARQL Query 1.1[4], SPARQL Update 1.1[5] (no executing) and
  Experimental SPARQL extensions (LAQRS).
Rasqal can write binding query results in the following formats:
  SPARQL XML, SPARQL JSON, CSV, TSV, HTML, ASCII tables, RDF/XML and
  Turtle / N3
and read them in:
  SPARQL XML, RDF/XML and Turtle / N3.

Rasqal was designed to work closely with the Redland librdf[1] RDF
library and the Raptor[2] RDF Syntax Library but is entirely separate
from both.

This is a beta quality library - the code is mature, the API is
mostly stable but changing slowly.  Rasqal supports all of SPARQL 1.0
query and most of SPARQL 1.1 query.  It is a portable library and has
been tested on multiple POSIX systems and architectures.  Rasqal has
no known memory leaks.

The main changes in this version since the last release 2011-11-17 are:
 * Supports all of SPARQL 1.0 by passing 100% of the approved tests
 * Added support for XSD date
 * Made XSD dateTime and XSD date equality and comparison work
 * Make limit and offset check work properly in a subquery
 * Correctly handle errors during aggregation expressions evaluation
 * Fix blank node generation when made in a CONSTRUCT to match SPARQL
 * Added SPARQL 1.1 draft UUID() and STRUUID() support
 * Requires Raptor 2.0.7+
 * RDQL support will be removed in the next release (0.9.30)
 * Made other fixes and improvements including fixing reported issues:
   0000493, 0000494 and 0000504

For full details see the Rasqal 0.9.29 release notes at
 http://librdf.org/rasqal/RELEASE.html#rel0_9_29

  rasqal-0.9.29.tar.gz
  MD5    49e4b75a0c67465edf55dd20606715fa
  SHA256 8b218dc51b77b99f33103a9251218a4439748f73ee30fa8ee549ab6d150e7c53

The Rasqal API reference manual section on API changes at
http://librdf.org/rasqal/docs/api/raptor-changes.html provides
detailed function, enum, macro and type changes.

Rasqal 0.9.29 requires Raptor 2.0.7[2] or newer to provide RDF
syntax, web, XML and URI support.  Optional requirements are a POSIX
regular expression library such as PCRE or one built into the C
library to handle regex matching / replacing; a multi-precision
decimal library such as GNU MP or MPFR for handling XSD decimals;
a UUID library for generating unique IDs.

Binary deb packages for Debian unstable will be made available
later via the standard Debian archive.

The http://librdf.org/ site lets you browse and check out the latest
version of the sources in GIT and try out Rasqal (as part of Redland)
in a web demonstration at http://librdf.org/query and as part of
Triplr http://triplr.org/

For more information on Redland, Raptor or Rasqal please join
the redland-dev list by visiting http://librdf.org/lists/
or visit IRC channel #redland on irc.freenode.net

Issues should be reported to http://bugs.librdf.org/

Dave

[1] Redland librdf RDF API library
http://librdf.org/

[2] Raptor RDF Syntax Library
http://librdf.org/raptor/

[3] SPARQL Query W3C Recommendation 2008-01-15
http://www.w3.org/TR/2008/REC-rdf-sparql-query-20080115/

[3] SPARQL 1.1 Query W3C Working Draft of 2012-01-05
http://www.w3.org/TR/2012/WD-sparql11-query-20120105/

[4] SPARQL 1.1 Update W3C Working Draft of 2012-01-05
http://www.w3.org/TR/2012/WD-sparql11-update-20120105/
bakowski | 7 May 12:30
Picon

storage in mysql on kubuntu 12.04

hello
on http://blog.literarymachine.net/ i found following example:

<?php
require_once('LibRDF/LibRDF.php');
 
$store = new LibRDF_Storage();
$model = new LibRDF_Model($store);
$model->loadStatementsFromURI(
        new LibRDF_Parser('rdfxml'),
        'http://richard.cyganiak.de/foaf.rdf');
 
$foafKnows = new LibRDF_URINode("http://xmlns.com/foaf/0.1/knows");
$foafName = new LibRDF_URINode("http://xmlns.com/foaf/0.1/name");
$results = $model->findStatements(null, $foafKnows, null);
foreach ($results as $result) {
    $person1 = $result->getSubject();
    $person2 = $result->getObject();
    $name1 = $model->getTarget($person1, $foafName);
    $name2 = $model->getTarget($person2, $foafName);
    echo "$name1 knows $name2\n";
}

which runs on my pc without error.

futher it is mentioned in the article, that it can be stored in a database
with following amendment:

$store = new LibRDF_Storage("mysql", "db",
        "new='yes',
        host='localhost',
        database='mydatabase',
        user='foo',
        password='bar'");

but when i replace the "$store = new LibRDF_Storage();" with my existing
mysql databbase i got the error message
"LibRDF_Storage->__construct('mysql', 'db', 'new='yes',?    ...')"
What is wrong in my code.
bk


  

Ihr WEB.DE Postfach immer dabei: die kostenlose WEB.DE Mail App für iPhone und Android.   
https://produkte.web.de/freemail_mobile_startseite/
_______________________________________________
redland-dev mailing list
redland-dev@...
http://lists.librdf.org/mailman/listinfo/redland-dev
John Emmas | 7 May 09:22
Picon

First use of raptor2 (Windows)

Hello,

I've just installed the raptor2 source code (2.0.7) which I'll be building for Windows.  Fortunately the
tarball seems to include some projects for building with Visual C++ 8.  Unfortunately, they seem to be
quite out of date.  In fact AFAICT they're the same projects that originally came with raptor1.  Some of the
files from raptor1 are no longer supplied with raptor2 (e.g. n3_lexer.c and n3_parser.c) whilst
(presumably) some new files might have been added.

I appreciate that the VC++ projects have been contributed by a third party but is there anyone who can help me
in getting some up-to-date VC++ projects?

Also, the file "raptor.h" simply seems to #include "raptor2.h" - but no such file exists in the tarball.  Do I
need to create it using some pre-build step or something?

John
Leigh L. Klotz, Jr. | 25 Apr 23:36
Favicon

fix and proposed patch for rdfproc --results

I found that 'rdfproc --results' always fails, no matter what result type
is given:

It fails with these packages:
 http://download.librdf.org/source/raptor2-2.0.7.tar.gz
 http://download.librdf.org/source/rasqal-0.9.28.tar.gz
 http://download.librdf.org/source/redland-1.0.15.tar.gz
 http://download.librdf.org/source/redland-bindings-1.0.14.1.tar.gz

The same bug appears in the earlier versions currently in the Ubuntu
Oneiric repository.

Here is how it fails:

    $ rdfproc -s postgresql -t
"host='localhost',database='red',user='red',password='*'" test query
sparql - 'select ?s,?p,?o where { ?s ?p ?o}'  --results rdfxml
    rdfproc: invalid argument `rdfxml' for `-r / --results'
    Try 'rdfproc -r / --results help' for a list of valid query result
formats
    Try `rdfproc -h / --help' for more information.

If you ask for the list it gives an OK list:

    $ rdfproc -s postgresql --results help
    rdfproc: Valid query result formats are:
      xml                   SPARQL XML Query Results
      json                  SPARQL JSON Query Results
      table                 Table
      csv                   Comma Separated Values (CSV)
      tsv                   Tab Separated Values (TSV)
      html                  HTML Table
      turtle                Turtle Query Results
      rdfxml                RDF/XML Query Results

I believe the problem is in redland-1.0.15/src/rdf_query_results.c, where
it specifies READER rather than WRITER flags for format:

    $ diff redland-1.0.15/src/rdf_query_results.c
redland-1.0.15.new/src/rdf_query_results.c
    960c960
    <   int flags = RASQAL_QUERY_RESULTS_FORMAT_FLAG_READER;
    ---
    >   int flags = RASQAL_QUERY_RESULTS_FORMAT_FLAG_WRITER;

With this patch I am able to get rdfproc to accept the --results argument
and produce results for
  json, table, csv, tsv, and html.
It still won't produce results in xml, turtle, or rdfxml, but perhaps
those serializers are unimplemented.

Leigh.
Mantis Bug Tracker | 25 Apr 23:11
Favicon

[Rasqal RDF Query Library 0000504]: rasqal_regex_replace() is not public


The following issue has been SUBMITTED. 
====================================================================== 
http://bugs.librdf.org/mantis/view.php?id=504 
====================================================================== 
Reported By:                swh
Assigned To:                
====================================================================== 
Project:                    Rasqal RDF Query Library
Issue ID:                   504
Category:                   api
Reproducibility:            N/A
Severity:                   minor
Priority:                   normal
Status:                     new
Query Language:             SPARQL 1.1 
====================================================================== 
Date Submitted:             2012-04-25 21:11
Last Modified:              2012-04-25 21:11
====================================================================== 
Summary:                    rasqal_regex_replace() is not public
Description: 
It would be great if rasqal_regex_replace() appeared in the public header, so it
could be used elsewhere.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-04-25 21:11 swh            New Issue                                    
======================================================================
Jens Ortmann | 25 Apr 11:01
Picon
Favicon

Compile Raptor for iOS

Hello,
Is there a way to compile raptor so that I can include it in iOS applications?
I am using Xcode and have raptor installed on my Mac, it works in OS X projects.
Cheers,
Jens

Sent from my iPhone
Maxence Guesdon | 3 Apr 21:48
Picon
Picon
Favicon

problem with transactions with mysql storage

Hello,

I am having problem when using transactions with a mysql storage.
Everything is ok when I don't use transactions, but when I do,
librdf_storage_mysql_find_statements_with_options seems not to find some
statements previously inserted in the transaction.

I don't have a small test example ready, but can someone tell me where I
should have a look at (in the librdf code) to find a possible reason for
this ?

Regards,

Maxence
Mantis Bug Tracker | 2 Apr 15:27
Favicon

[Raptor RDF Syntax Library 0000502]: librdf_new_node_from_node (raptor_term_copy) does not make a deep copy


The following issue has been SUBMITTED. 
====================================================================== 
http://bugs.librdf.org/mantis/view.php?id=502 
====================================================================== 
Reported By:                zoggy
Assigned To:                
====================================================================== 
Project:                    Raptor RDF Syntax Library
Issue ID:                   502
Category:                   api
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
Syntax Name:                 
====================================================================== 
Date Submitted:             2012-04-02 13:27
Last Modified:              2012-04-02 13:27
====================================================================== 
Summary:                    librdf_new_node_from_node (raptor_term_copy) does
not make a deep copy
Description: 
raptor_term_copy (called by librdf_new_node_from_node) does not make a deep
copy, for example it does not copy uri.

So when the node is freed, it results in original node having a null URI.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-04-02 13:27 zoggy          New Issue                                    
======================================================================

Gmane