Heidi McClure created SOLR-12534:
------------------------------------

             Summary: Add Edge Labels for Graph exports to GraphML to allow 
imports to Gephi
                 Key: SOLR-12534
                 URL: https://issues.apache.org/jira/browse/SOLR-12534
             Project: Solr
          Issue Type: New Feature
      Security Level: Public (Default Security Level. Issues are Public)
          Components: Response Writers
    Affects Versions: 7.4, 7.3.1, 7.3, 7.2.1, 7.2
         Environment: Hello,

I am trying to export graph data from a Solr index (version 7.2) in a format 
that can be imported to Gephi for visualization. I'm getting close! Is there a 
way to add edge labels to the exports from this type of command (see curl 
command that follows and sample outputs)?

Thanks in advance,
 -heidi

Based on the examples found here: 
[https://lucene.apache.org/solr/guide/7_2/graph-traversal.html] , this is 
working in my GDELT-based data set query request:

curl --data-urlencode 'expr=nodes(gdelt_graph,
 nodes(gdelt_graph,
 walk="POLICE->Actor1Name_s",
 trackTraversal="true",
 gather="Actor2Name_s"),
 walk="node->Actor1Name_s",
 scatter="leaves,branches",
 trackTraversal="true",
 gather="Actor2Name_s")' [http://mymachine:8983/solr/gdelt_graph/graph]

Output is like this (just a subset):
 <?xml version="1.0" encoding="UTF-8"?>
 <graphml xmlns="http://graphml.graphdrawing.org/xmlns"; 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
 xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns 
[http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd]";>
 <graph id="G" edgedefault="directed">
 <node id="POLICE">
 <data key="field">node</data>
 <data key="level">0</data>
 </node>
 <edge id="1" source="BANGLADESH" target="POLICE"/>
 <node id="HOSPITAL">
 <data key="field">Actor2Name_s</data>
 <data key="level">1</data>
 </node>
 <edge id="2" source="POLICE" target="HOSPITAL"/>
 <node id="UNITED STATES">
 <data key="field">Actor2Name_s</data>
 <data key="level">1</data>
 </node>
 <edge id="3" source="UNITED STATES" target="UNITED STATES"/>
 <edge id="4" source="AFRICA" target="UNITED STATES"/>
 <edge id="5" source="POLICE" target="UNITED STATES"/>

And I'd like to have a key for label and the data tag on the edges so that I 
can get the Labels into Gephi. Does anyone know if this can be done? Below is 
example of what I mean. Notice the key for label at the top of the file and the 
"This is an edge description" entries on two of the edges (ids 1 and 2).

<?xml version="1.0" encoding="UTF-8"?>
 <graphml xmlns="http://graphml.graphdrawing.org/xmlns"; 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
 xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns 
[http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd]";>
 <key id="label" for="edge" attr.name="label" attr.type="string"/>
 <graph id="G" edgedefault="directed">
 <node id="POLICE">
 <data key="field">node</data>
 <data key="level">0</data>
 </node>
 <edge id="1" source="BANGLADESH" target="POLICE" label="foo">
 <data key="label">This is an edge description.</data>
 </edge>
 <node id="HOSPITAL">
 <data key="field">Actor2Name_s</data>
 <data key="level">1</data>
 </node>
 <edge id="2" source="POLICE" target="HOSPITAL">
 <data key="label">This is an edge description.</data>
 </edge>
 <node id="UNITED STATES">
 <data key="field">Actor2Name_s</data>
 <data key="level">1</data>
 </node>
 <edge id="3" source="UNITED STATES" target="UNITED STATES"/>
 <edge id="4" source="AFRICA" target="UNITED STATES"/>
 <edge id="5" source="POLICE" target="UNITED STATES"/>
            Reporter: Heidi McClure
             Fix For: 7.5


Please add the ability to export edge labels to the GraphML export API.

In the environment section is the email I sent to solr-users where they 
suggested adding an issue to request this capability be added - they also said 
it would be an easy change to make.  The change is minor and would possibly be 
to this class:

org.apache.solr.response.GraphMLResponseWriter or might be an extension to that 
class.




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to