[FIXED] Attribute isn't importing and I don't know why!

Get help with your data
sbourke
Posts:10
Joined:01 Feb 2011 20:35
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[FIXED] Attribute isn't importing and I don't know why!

Post by sbourke » 01 Feb 2011 20:46

I'm new here! Gephi seems great. However I'm having an issue using attributes!

I'm trying to create a dynamic topolgy using the geo plugin ( http://gephi.org/2010/map-geocoded-data-with-gephi/ ) However I'm getting errors which arent to descriptive about the longitude and latitude attributes. I was hoping someone could point out what I'm doing wrong.

The top of the report file looks as follows
Default edge type set as UNDIRECTED
GEXF version 1.1
Node attribute found 'People Count' (DYNAMIC_FLOAT)
Node attribute found 'latitude' (DYNAMIC_DOUBLE)
Node attribute found 'longitude' (DYNAMIC_DOUBLE)
Data value 'latitude' type error for element node id=0. The value cannot be set as 'latitude' attribute.
Data value 'longitude' type error for element node id=0. The value cannot be set as 'longitude' attribute.

This is the case for all nodes in the file (3k~)

The top of the airline dataset taken from gephi looks as follows (It's what I'm using to structure my file!)

Code: Select all

<graph defaultedgetype="undirected" idtype="string" type="static">
<attributes class="node" mode="static">
<attribute id="code" title="Code" type="string"/>
<attribute id="city" title="City" type="string"/>
<attribute id="latitude" title="latitude" type="double"/>
<attribute id="longitude" title="longitude" type="double"/>
So I'm using this as my baseline to work out how to create a similar diagram. Therefore I declared the following at the top of my file

Code: Select all

  <graph mode="dynamic" defaultedgetype="undirected">
  	
<attributes class="node" mode="dynamic">
<attribute id="people_count" title="People Count" type="float"/>
<attribute id="latitude" title="latitude" type="double"/>
<attribute id="longitude" title="longitude" type="double"/>
</attributes>
A node in the airline data set looks like the following

Code: Select all

<node id="0" label="Adams Field Airport">
<attvalues>
<attvalue for="code" value="LIT"/>
<attvalue for="city" value="Little Rock, AR"/>
<attvalue for="latitude" value="34.729444"/>
<attvalue for="longitude" value="-92.224444"/>
</attvalues>
<viz:color b="243" g="107" r="88"/>
</node>
and in mine

Code: Select all

  </node><node id='3' label='Catch 22' start='0' end='66'>
	  	  <attvalues><attvalue for='people_count' value='1' start='40'/>
	          <attvalue for='people_count' value='3' start='47'/>
	          <attvalue for='latitude' value='53.3649'/>
	          <attvalue for='longitude' value='-6.2204'/></attvalues>
	      	  </node><node id='4' label='Clarion Hotel IFSC Dublin' start='0' end='66'>
	  	  <attvalues><attvalue for='people_count' value='1' start='5'/>
	          <attvalue for='people_count' value='2' start='60'/>
	          <attvalue for='people_count' value='1' start='44'/>
	          <attvalue for='latitude' value='53.3478'/>
	          <attvalue for='longitude' value='-6.24369'/>
</attvalues>
	      	  </node>
I'm assuming the formatting shouldnt be causing me the issues. Any help greatly appreciated.

admin
Gephi Community Manager
Posts:964
Joined:09 Dec 2009 14:41
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Attribute isn't importing and I don't know why!

Post by admin » 01 Feb 2011 23:44

Hi,

I can't reproduce this bug. Attached is my test file, containing your nodes #3 and #4.

Can you share the whole file please?

In case of, did you updated your Gephi? It may be an old bug already fixed.
Attachments
test.gexf
(1.54KiB)Downloaded 249 times

sbourke
Posts:10
Joined:01 Feb 2011 20:35
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Attribute isn't importing and I don't know why!

Post by sbourke » 02 Feb 2011 00:11

Ah sorry I only posted a few nodes incase I was doing something obviously wrong.

The file was to big to upload in its entirety, I've put up as much as I can. The error occurs for every single node.

I'm working off the latest gephi download.
Attachments
graph.gexf
(1.84MiB)Downloaded 242 times

User avatar
seinecle
Gephi Community Support
Posts:546
Joined:08 Feb 2010 16:55
Location:Lyon, France
Contact:

Re: Attribute isn't importing and I don't know why!

Post by seinecle » 02 Feb 2011 13:54

Hi,

I have a clean report when I try to import your graph.gexf

So... ???

Best,

Clement

sbourke
Posts:10
Joined:01 Feb 2011 20:35
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Attribute isn't importing and I don't know why!

Post by sbourke » 02 Feb 2011 14:45

I've attached the screenshots of the errors. I'm working off Gephi 0.7 for mac (Latest on the downloads page).

The error doesn't give me any insight at all into what the problem is.

I already have a netbeans environment for development. I'm assuming that this could not be causing the issue at all. I get it on my desktop and laptop (Both macs).
Attachments
two.png
one.png

admin
Gephi Community Manager
Posts:964
Joined:09 Dec 2009 14:41
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Attribute isn't importing and I don't know why!

Post by admin » 02 Feb 2011 15:43

It loads fine for me too.

Ok for the download, but there are updates available. Go to the menu: Help > Check for Updates.

User avatar
seinecle
Gephi Community Support
Posts:546
Joined:08 Feb 2010 16:55
Location:Lyon, France
Contact:

Re: Attribute isn't importing and I don't know why!

Post by seinecle » 02 Feb 2011 15:47

Ok, it is beyond my skills. The only thing I could advise, but you probably did that already, is click on "check for updates"in the "Help" menu - that would definitely ensure that you have the latest version with all debugs.

Best,

Clement.

sbourke
Posts:10
Joined:01 Feb 2011 20:35
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Attribute isn't importing and I don't know why!

Post by sbourke » 02 Feb 2011 15:58

It removed the errors. However now when I go into the graph the geo layout is unable to find the attributes

D'oh

Alexis Jacomy
Gephi Plugin Developer
Posts:8
Joined:11 Dec 2009 12:22
Contact:

Re: Attribute isn't importing and I don't know why!

Post by Alexis Jacomy » 02 Feb 2011 17:35

I don't know how work the dynamics in Gephi. Here are the attributes that are recognized by GeoLayout:

Code: Select all

AttributeModel attModel = Lookup.getDefault().lookup(AttributeController.class).getModel();
for (AttributeColumn c : attModel.getNodeTable().getColumns()) {
    [...]
}
I guess this model does not contain the dynamics attributes. At the same time, it looks like latitude and longitude are actually not dynamics in your file (no start values, no end values). May be you should try to use two different attributes declarations in your file, for example:

Code: Select all

<attributes class="node" mode="dynamic">
    <attribute id="people_count" title="People Count" type="float"/>
</attributes>
<attributes class="node" mode="static">
    <attribute id="latitude" title="latitude" type="double"/>
    <attribute id="longitude" title="longitude" type="double"/>
</attributes>
instead of

Code: Select all

<attributes class="node" mode="dynamic">
    <attribute id="people_count" title="People Count" type="float"/>
    <attribute id="latitude" title="latitude" type="double"/>
    <attribute id="longitude" title="longitude" type="double"/>
</attributes>
as you currently do.

I do not have Gephi with me, so I can't try it, and I don't know if Gephi can interpret several attributes tags. But the fact that your attributes are said dynamic is surely the problem.

Good luck

User avatar
mbastian
Gephi Architect
Posts:728
Joined:10 Dec 2009 10:11
Location:San Francisco, CA
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Attribute isn't importing and I don't know why!

Post by mbastian » 04 Feb 2011 21:02

I believe the GeoLayout is looking for FLOAT or DOUBLE columns for latitude or longitude.

When working with dynamic graphs, you have DYNAMIC_FLOAT or DYNAMIC_DOUBLE types. Alexis, I guess you'll need to update the plugin to support these new types. As you know, a dynamic type is a set of values indexed by interval of time. The question is though: "How to get the latitude and longitude value for the current interval (defined by the timeline)".

Here is the code to do that, add DynamicAPI as library:

Code: Select all

DynamicModel dynamicModel = workspace.getLookup().lookup(DynamicModel.class);
TimeInterval visibleInterval = dynamicModel != null ? dynamicModel.getVisibleInterval() : new TimeInterval();
...
AttributeColumn latColumn = ...      //DYNAMIC_FLOAT
Object val = node.getNodeData().getAttributes().getValue(latColumn.getIndex());
val = DynamicUtilities.getDynamicValue(val, visibleInterval.getLow(), visibleInterval.getHigh());
if (val != null) {
   Float latitude = (Float)val;     //Latitude for the current interval
}

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable