GraphStream Users

Archives de la liste Aide


Re: Questions about DGS and steps


Chronologique Discussions 
  • From: Keith Thompson <kthomps6 AT binghamton.edu>
  • To: guilhelm savin <guilhelm.savin AT gmail.com>, graphstream-users AT litislab.fr
  • Subject: Re: Questions about DGS and steps
  • Date: Mon, 2 Jul 2012 09:52:45 -0400

Hi Guilhelm,

I downloaded the latest nightly build, but still got the \r error.  It says "end of line is missing." When I manually delete the \r, this error does not show when parsing the dgs file to display the graph. However, I am now getting a second error. When trying to read the dgs file it's saying "eol expected, got 'e'." I am not sure what 'e' is though. Here is the stack trace:

java.io.IOException: org.graphstream.util.parser.ParseException: parse error at (-9;-2) : eol expected, got 'e' (254|1024)
at org.graphstream.stream.file.FileSourceDGS.nextStep(FileSourceDGS.java:80)
...
Caused by: org.graphstream.util.parser.ParseException: parse error at (-9;-2) : eol expected, got 'e' (254|1024)
at org.graphstream.stream.file.dgs.DGSParser.parseException(DGSParser.java:764)
at org.graphstream.stream.file.dgs.DGSParser.next(DGSParser.java:326)
at org.graphstream.stream.file.dgs.DGSParser.nextStep(DGSParser.java:336)
at org.graphstream.stream.file.FileSourceDGS.nextStep(FileSourceDGS.java:78)
... 2 more

Regards,
Keith


On Wed, Jun 27, 2012 at 9:22 AM, Keith Thompson <kthomps6 AT binghamton.edu> wrote:
Hello Guilhelm. Thank you so much for your help. I will download the new jar. :)

Keith


On Wed, Jun 27, 2012 at 5:29 AM, guilhelm savin <guilhelm.savin AT gmail.com> wrote:
Hi again,

I think that the handling of CR and CR+LF have been
included in the 1.1.1 but I just check and ... it is
not. Sorry, my mistake.

You can get lastest jar here :

|
|

In this version, LF, CR, and CR+LF are handle by the
dgs parser.

We will publish soon a 1.1.2 that will fix a lot of bugs.

Tell me if it works with this version.

Regards.
Guilhelm

2012/6/27 guilhelm savin <guilhelm.savin AT gmail.com>
Can you send me a DGS file with the \r for tests ?
I will try to fix the parser.

Thanks.
Guilhelm

2012/6/27 Keith Thompson <kthomps6 AT binghamton.edu>
Thank you so much for your help. I understand now after your explanation. Everything worked as expected. I still get the \r but that was the only thing.

Regards,
Keith


On Tue, Jun 26, 2012 at 6:44 PM, guilhelm savin <guilhelm.savin AT gmail.com> wrote:
I think that the problem come from your use of
the sink. In your example, you create a first
dgs file between fs.begin() and fs.end(). This
file is closed by calling fs.end().
graph.write(fs, "..") creates a new file that
is a snapshot of the graph (the file will contain
only the current state of the graph) so steps
will not appear here.

You should try to do this :

|
| Graph g = ... ;
| FileSinkDGS fs = ... ;
| g.addSink(fs);
|
| // Start to write
| fs.begin("/path/to/output/dgs");
| // Start reading
| g.stepBegins(0);
| // read the first week
| g.stepBegins(1);
| // read the second week
| // ...
| // Close the sink
| fs.end();

By calling "g.addSink(fs)" you connect the graph to
the output, so every change on the graph will be
reflected in the dgs.

Tell me if it works. If not I will try to help you
more.

Regards.


2012/6/27 Keith Thompson <kthomps6 AT binghamton.edu>
Hello Guilhelm,

Yes, I am using the gs-core-1.1.1, but still getting the \r error.

I tried adding the begin( ) method and then calling end( ) before calling write(new FileSinkDGS( ),"path/to/output"). The dgs file is created and shows all the events, but there are no steps listed. Here is what I have in sequence:

FileSinkDGS fs = new FileSinkDGS();
fs.begin( );
fs.stepBegins( );
//read one week of data into graph
fs.stepBegins( );
//read another week of data into graph
etc ...
fs.end( );
graph.write(fs, "/path/to/output/dgs");

Here are a few lines of output:
DGS004
null 0 0
an "8576"
cn "8576"  "ui.label":"8576"
cn "8576"  "ui.class":"U"
an "10571"
cn "10571"  "ui.label":"10571"
cn "10571"  "ui.class":"U"

I'm still just not getting the steps to write out. For instance, I would like to see:

DGS004
null 0 0
st 0
an "8576"
cn "8576"  "ui.label":"8576"
cn "8576"  "ui.class":"U"
st 1
an "10571"
cn "10571"  "ui.label":"10571"
cn "10571"  "ui.class":"U"

Regards,
Keith


On Tue, Jun 26, 2012 at 5:08 PM, guilhelm savin <guilhelm.savin AT gmail.com> wrote:
Hi Keith,

What is your GraphStream version ?
This bug (\r) should be corrected with the gs-core-1.1.1

About your use of stepBegins(), it should work. Have you
called the begin() method first ?

Regards.
Guilhelm

2012/6/26 Keith Thompson <kthomps6 AT binghamton.edu>
Dear Graphstream users,

I have noticed a possible issue in writing/reading dgs files. The writer in graphstream puts \r\n at the end of lines; however, the dgs parser in graphstream throws an exception if the \r is there. Thus, I have been using search/replace to manually remove \r after using graph.write(new FileSinkDGS( ), "path/to/output") so that I can read the file back in with nextEvents( ).

Here is my actual question though. I am trying to write a dgs file with steps to denote sequences of events. I am able to use FileSinkDGS to write the dgs file with no problems, but I get an error when I try to use steps. I am placing fs.stepBegins(graphId, timeId, step) at each location where I want a new step to begin (fs is the name of my FileSinkDGS object). For example, I might have something like fs.stepBegins("myGraph", 0, 0). Is this correct usage? The reason I ask is that I get a NullPointerException every time I call stepBegins.

Regards,

--
Keith Thompson




--
Guilhelm Savin
PhD Student of Computer Science




--
Keith Thompson
Graduate Research Associate, Xerox Corporation
SUNY Research Foundation
Dept. of Systems Science and Industrial Engineering
Binghamton University
Binghamton, NY 13902




--
Guilhelm Savin
PhD Student of Computer Science




--
Keith Thompson
Graduate Research Associate, Xerox Corporation
SUNY Research Foundation
Dept. of Systems Science and Industrial Engineering
Binghamton University
Binghamton, NY 13902




--
Guilhelm Savin
PhD Student of Computer Science




--
Guilhelm Savin
PhD Student of Computer Science




--
Keith Thompson
Graduate Research Associate, Xerox Corporation
SUNY Research Foundation
Dept. of Systems Science and Industrial Engineering
Binghamton University
Binghamton, NY 13902




--
Keith Thompson
Graduate Research Associate, Xerox Corporation
SUNY Research Foundation
Dept. of Systems Science and Industrial Engineering
Binghamton University
Binghamton, NY 13902




Archives gérées par MHonArc 2.6.16.

Top of page