[gephi-dev] A few questions about the Filters API

Luiz Ribeiro luizribeiro at gmail.com
Tue Aug 9 05:28:25 CEST 2011


On Thu, Aug 4, 2011 at 12:03 AM, Mathieu Bastian
<mathieu.bastian at gmail.com> wrote:
>> 1) When you apply a NodeAttributeRangeFilter with a given range that
>> doesn't match any node (or edge, in the case of an
>> EdgeAttributeRangeFilter), a GraphView which is equal to the original
>> main graph is returned. Is this a bug or is it expected behavior?
>
> That is a bug. It's not something that can be done from the UI as the range
> is restricted to existing values, so we probably don't deal with that case.
> Please file a bug on Launchpad.

Done. https://bugs.launchpad.net/gephi/+bug/823036

>> 2) I'm a bit unsure of how to create NodeEqualNumberFilters. Here's
>> what I've been trying so far, with no success:
>>
>> NodeEqualNumberFilter filter = new
>> AttributeEqualBuilder.NodeEqualNumberFilter(attributeColumn);
>> Query query = filterController.createQuery(filter);
>> filter.setMatch(new Integer(2));
>
> That sounds right. Is the column the same type as the match (i.e. Integer) ?

Yes, it is. Actually, I believe this is a bug too. I tried doing
everything via Gephi's UI: added some nodes to the graph, created an
Integer attribute column and assigned values to the nodes. Whenever I
try filtering the graph with the Attribute Equal Filter on the Filters
UI, I get the same exception that I get with my code:

java.lang.IllegalArgumentException: min, max and value must be the same class
	at org.gephi.filters.api.Range.tribToBounds(Range.java:356)
	at org.gephi.filters.plugin.attribute.AttributeEqualBuilder$EqualNumberFilter.refreshValues(AttributeEqualBuilder.java:390)
	at org.gephi.filters.plugin.attribute.AttributeEqualBuilder$EqualNumberFilter.init(AttributeEqualBuilder.java:337)
	at org.gephi.filters.FilterProcessor.processNodeFilter(FilterProcessor.java:110)
	at org.gephi.filters.FilterProcessor.process(FilterProcessor.java:84)
	at org.gephi.filters.FilterThread.filter(FilterThread.java:128)
[catch] at org.gephi.filters.FilterThread.run(FilterThread.java:99)

I've filed a bug report on Launchpad for this too (Bug #823038). I'll
try to track these bugs down during the next few days.

--Luiz


More information about the gephi-dev mailing list