melgi / cturtle Goto Github PK
View Code? Open in Web Editor NEWConvert RDF Turtle to N-Triples or N3P
License: Apache License 2.0
Convert RDF Turtle to N-Triples or N3P
License: Apache License 2.0
Surrogate pairs are not handled correctly, when unescaping numeric escapes (\uxxxx
) in IRIs and strings:
On input "\uD864\uDD54"
, cturtle outputs byte sequence 0xED 0xA1 0XA4 0xED 0xB5 0x94
.
It should output 0xF0 0xA9 0x85 0x94
(https://codepoints.net/U+29154).
cturtle -h
should exit with status 0. Now it returns -1.
I am installing cturtle to use EYE.
using mac, I executed makefile command "make"
but I get this error
lex --warn -o src/TurtleLexer.cc src/Turtle.l
src/Turtle.l:75: unrecognized rule
src/Turtle.l:75: unrecognized rule
src/Turtle.l:75: unrecognized rule
src/Turtle.l:75: unrecognized rule
src/Turtle.l:75: unrecognized rule
src/Turtle.l:75: unrecognized rule
src/Turtle.l:75: unrecognized rule
src/Turtle.l:75: unrecognized rule
src/Turtle.l:75: unrecognized rule
src/Turtle.l:75: unrecognized rule
src/Turtle.l:75: unrecognized rule
src/Turtle.l:76: unrecognized rule
src/Turtle.l:76: unrecognized rule
src/Turtle.l:76: unrecognized rule
src/Turtle.l:76: unrecognized rule
src/Turtle.l:76: unrecognized rule
src/Turtle.l:76: unrecognized rule
src/Turtle.l:76: unrecognized rule
src/Turtle.l:76: unrecognized rule
src/Turtle.l:76: unrecognized rule
make: *** [src/TurtleLexer.cc] Error 1
how I avoid this error?
On Windows
cturtle LITERAL1_all_controls.ttl
succeeds but,
cturtle < LITERAL1_all_controls.ttl
fails,
because stdin is a "text" stream and interprets the control characters.
This was the error
c++ -c -O2 -Wall -march=native -std=c++11 -o obj/Utf8.o src/Utf8.cc
In file included from src/Utf8.cc:18:
src/Utf8.hh:27:8: error: no type named 'size_t' in namespace 'std'
std::size_t encode(char32_t c, OutputIterator i)
~~~~~^
src/Utf8.hh:29:9: error: no type named 'size_t' in namespace 'std'
std::size_t size = 0;
~~~~~^
src/Utf8.hh:108:49: error: no type named 'size_t' in namespace 'std'
template<typename InputIterator> friend std::size_t decode(char32_t *c32, InputIterator begin, InputIterator end, State *state);
~~~~~^
src/Utf8.hh:112:8: error: no type named 'size_t' in namespace 'std'
std::size_t decode(char32_t *c32, InputIterator begin, InputIterator end, State *state)
~~~~~^
4 errors generated.
make: *** [obj/Utf8.o] Error 1
I fixed up this error adding this #include <cstddef>
line in src/Utf8.hh file as explained in this stackoverflow answer. I hope it helps.
The Turtle test case turtle-eval-lists-04 gives a different model than expected when parsed with -f=nt
.
Right now, the program accepts non-existing files and gives an empty result: Done: translated 0 triples
. This is only on Windows.
The errors are as follows:
src/TurtleLexer.cc:1177:8: error: member reference type 'std::istream *' (aka 'basic_istream<char> *') is a pointer; maybe you meant to use '->'?
yyin.rdbuf(std::cin.rdbuf());
~~~~^
->
src/TurtleLexer.cc:1180:9: error: member reference type 'std::ostream *' (aka 'basic_ostream<char> *') is a pointer; maybe you meant to use '->'?
yyout.rdbuf(std::cout.rdbuf());
~~~~~^
->
src/TurtleLexer.cc:1401:50: error: member reference type 'std::istream *' (aka 'basic_istream<char> *') is a pointer; maybe you meant to use '->'?
YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin.rdbuf();
~~~~^
->
src/TurtleLexer.cc:1516:2: error: cannot initialize a member subobject of type 'std::istream *' (aka 'basic_istream<char> *') with an rvalue of type
'basic_streambuf<char_type, traits_type> *'
yyin(arg_yyin ? arg_yyin->rdbuf() : std::cin.rdbuf()),
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/TurtleLexer.cc:1517:2: error: cannot initialize a member subobject of type 'std::ostream *' (aka 'basic_ostream<char> *') with an rvalue of type
'basic_streambuf<char_type, traits_type> *'
yyout(arg_yyout ? arg_yyout->rdbuf() : std::cout.rdbuf())
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/TurtleLexer.cc:1519:2: error: use of undeclared identifier 'ctor_common'
ctor_common();
^
src/TurtleLexer.cc:1524:14: error: out-of-line definition of 'yyFlexLexer' does not match any declaration in 'yyFlexLexer'
yyFlexLexer::yyFlexLexer( std::istream& arg_yyin, std::ostream& arg_yyout ):
^~~~~~~~~~~
src/TurtleLexer.cc:29:25: note: expanded from macro 'yyFlexLexer'
#define yyFlexLexer yyFlexLexer
^~~~~~~~~~~
src/TurtleLexer.cc:1515:27: note: type of 1st parameter of member declaration does not match definition ('std::istream *'
(aka 'basic_istream<char> *') vs 'std::istream &' (aka 'basic_istream<char> &'))
yyFlexLexer::yyFlexLexer( FLEX_STD istream* arg_yyin, FLEX_STD ostream* arg_yyout ):
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/FlexLexer.h:53:22: note: expanded from macro 'FLEX_STD'
# define FLEX_STD std::
^
src/TurtleLexer.cc:1525:2: error: cannot initialize a member subobject of type 'std::istream *' (aka 'basic_istream<char> *') with an rvalue of type
'basic_streambuf<char_type, traits_type> *'
yyin(arg_yyin.rdbuf()),
^ ~~~~~~~~~~~~~~~~
src/TurtleLexer.cc:1526:2: error: cannot initialize a member subobject of type 'std::ostream *' (aka 'basic_ostream<char> *') with an rvalue of type
'basic_streambuf<char_type, traits_type> *'
yyout(arg_yyout.rdbuf())
^ ~~~~~~~~~~~~~~~~~
src/TurtleLexer.cc:1528:2: error: use of undeclared identifier 'ctor_common'
ctor_common();
^
src/TurtleLexer.cc:1533:19: error: out-of-line definition of 'ctor_common' does not match any declaration in 'yyFlexLexer'
void yyFlexLexer::ctor_common()
^~~~~~~~~~~
src/TurtleLexer.cc:1571:19: error: out-of-line definition of 'switch_streams' does not match any declaration in 'yyFlexLexer'
void yyFlexLexer::switch_streams( std::istream& new_in, std::ostream& new_out )
^~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/FlexLexer.h:129:31: note: type of 1st parameter of member
declaration does not match definition ('std::istream *' (aka 'basic_istream<char> *') vs 'std::istream &' (aka 'basic_istream<char> &'))
virtual void switch_streams( FLEX_STD istream* new_in, FLEX_STD ostream* new_out = 0 );
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/FlexLexer.h:53:22: note: expanded from macro 'FLEX_STD'
# define FLEX_STD std::
^
src/TurtleLexer.cc:1575:41: error: no viable conversion from 'std::istream' (aka 'basic_istream<char>') to 'std::istream *'
(aka 'basic_istream<char> *')
yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) );
^~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/FlexLexer.h:121:62: note: passing argument to parameter 's'
here
struct yy_buffer_state* yy_create_buffer( FLEX_STD istream* s, int size );
^
src/TurtleLexer.cc:1578:7: error: member reference type 'std::ostream *' (aka 'basic_ostream<char> *') is a pointer; maybe you meant to use '->'?
yyout.rdbuf(new_out.rdbuf());
~~~~~^
->
src/TurtleLexer.cc:1586:10: error: assigning to 'std::istream *' (aka 'basic_istream<char> *') from incompatible type 'std::istream **'
(aka 'basic_istream<char> **'); remove &
new_in = &yyin;
^ ~~~~~
src/TurtleLexer.cc:1590:11: error: assigning to 'std::ostream *' (aka 'basic_ostream<char> *') from incompatible type 'std::ostream **'
(aka 'basic_ostream<char> **'); remove &
new_out = &yyout;
^ ~~~~~~
src/TurtleLexer.cc:1599:18: error: out-of-line definition of 'LexerInput' does not match any declaration in 'yyFlexLexer'
int yyFlexLexer::LexerInput( char* buf, int max_size )
^~~~~~~~~~
src/TurtleLexer.cc:1602:11: error: member reference type 'std::istream *' (aka 'basic_istream<char> *') is a pointer; maybe you meant to use '->'?
if ( yyin.eof() || yyin.fail() )
~~~~^
->
src/TurtleLexer.cc:1602:25: error: member reference type 'std::istream *' (aka 'basic_istream<char> *') is a pointer; maybe you meant to use '->'?
if ( yyin.eof() || yyin.fail() )
~~~~^
->
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [obj/TurtleLexer.o] Error 1
Are there certain versions of certain tools needed?
E.g. on URIs like http://example.org#
.
Installing with makes exits with error:
with the current master branch
g++ -c -O2 -Wall -march=native -std=c++11 -o obj/Utf8.o src/Utf8.cc
src/Utf8.cc:26:10: error: expected constructor, destructor, or type conversion before ‘(’ token
src/Utf8.cc:39:10: error: expected constructor, destructor, or type conversion before ‘(’ token
make: *** [obj/Utf8.o] Errors 1
and with the 1.0.5 release:
g++ -c -O2 -Wall -march=native -std=c++11 -o obj/Main.o src/Main.cc
In file included from src/Parser.hh:27:0,
from src/Main.cc:25:
src/Model.hh:189:3: error: looser throw specifier for ‘virtual turtle::RDFList::~RDFList()’
src/Model.hh:75:9: error: overriding ‘virtual turtle::Resource::~Resource() noexcept (true)’
make: *** [obj/Main.o] Errors 1
I want to install cturtle for usage wit EYE on debian. Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.