[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#632836: Incorrect qname definition in TRiG parser



Package: libraptor2-0
Version: 2.0.3-1
Severity: normal
Tags: patch upstream
Forwarded: http://bugs.librdf.org/mantis/view.php?id=451

Hello,

Raptor2 TRiG does not parse some qnames properly. This poses a problem for
soprano [1] and the whole KDE stack. Could you include an attached patch or put
more pressure on upstream to include it & release new upstream version?

[1] http://lists.kde.org/?l=nepomuk&m=130994864025383

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (110, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.0.0-rc5-amd64 (SMP w/4 CPU cores)
Locale: LANG=lt_LT.UTF-8, LC_CTYPE=lt_LT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libraptor2-0 depends on:
ii  libc6                       2.13-10      Embedded GNU C Library: Shared lib
ii  libcurl3-gnutls             7.21.6-3     Multi-protocol file transfer libra
ii  libxml2                     2.7.8.dfsg-3 GNOME XML library
ii  libxslt1.1                  1.1.26-7+b1  XSLT 1.0 processing library - runt
ii  libyajl1                    1.0.8-1      Yet Another JSON Library

libraptor2-0 recommends no packages.

Versions of packages libraptor2-0 suggests:
pn  raptor2-utils                 <none>     (no description available)

-- no debconf information
--- Begin Message ---
Problem: QName in Turtle syntax are different from QName in XML Namespaces.
It Turtle qname can miss prefix, local_part or both ( http://www.w3.org/TeamSubmission/turtle/#qname ). So if
@prefix nie: <blablabal> .
@prefix : <http://soprano.sf.net/testdata/> .

then the following

 nie:
 nie:xxx
 :yyy

are all valid qnames. ( Unlike XML Namespaces, where nie: is not a valid QName )

Currently term "nie:" is not recognized as valid qname when used as graph
name. This issue has made all nepomuk ontologies invalid. Test data are given
in "Steps to reproduce" field.

--- a/src/turtle_lexer.l
+++ b/src/turtle_lexer.l
@@ -381,9 +381,13 @@ EXPONENT [eE][+-]?[0-9]+
                while(1) {
                   int c = yytext[yyleng - 1];
                   if(c == '{' || c == ' ' || c=='\t' || c == '\v' || c == '\n' ||
-                     c == ':' || c == '-') {
+                     c == '=' ) {
                     yyleng--;
-                  } else
+                  } 
+                  else if ( yyleng >= 2 && ( c == '-' && yytext[yyleng - 2] == ':' ) ) { 
+                    yyleng -= 2;
+                  }
+                  else
                     break;
                 }
                 yytext[yyleng] = '\0';

--- End Message ---

Reply to: