Wrapping the expression in a fetch function as follows works:

fetch(names, select(nodes(enron_emails,
  nodes(enron_emails,
walk="kayne.coul...@enron.com->from",
      trackTraversal="true",
gather="to"),                                  walk="node->from",
                            scatter="leaves,branches",
                 trackTraversal="true",
  gather="to"), node as from), fl="name", on="from")


however, the response loses some of its structure and no edges are
returned, i.e. it becomes:

<?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="null">

    <data key="from">kayne.coul...@enron.com</data>

    <data key="name">Kayne Coulter</data>

  </node>

  <node id="null">

    <data key="from">randal.maff...@enron.com</data>

    <data key="name">Randal Maffett</data>

  </node>

...

</graph>

which can be used as a subsequent request to the first in order to retrieve
additional fields but it would be more efficient if there's a way to
retrieve the required fields in one request.

Best,
A. Adel

On Mon, Jul 22, 2019 at 4:00 PM Ahmed Adel <aa.0...@gmail.com> wrote:

> Hi,
>
> Similar to this question (
> https://mail-archives.apache.org/mod_mbox/lucene-solr-user/201907.mbox/browser),
> how can additional fields be returned when using /graph request handler?
>
> For example, from the documentation, for the request:
>
> nodes(enron_emails,                                  nodes(enron_emails,      
>                                   walk="kayne.coul...@enron.com->from",       
>                                  trackTraversal="true",                       
>                  gather="to"),                                  
> walk="node->from",                                  
> scatter="leaves,branches",                                  
> trackTraversal="true",                                  gather="to")
>
>
> is there a way to add more fields to the response:
>
> <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="kayne.coul...@enron.com">
>            <data key="field">node</data>
>            <data key="level">0</data>
>            <data key="count(*)">0.0</data>
>      </node>
>      <node id="don.baugh...@enron.com">
>            <data key="field">to</data>
>            <data key="level">1</data>
>            <data key="count(*)">1.0</data>
>      </node>
>      <edge id="1"  source="kayne.coul...@enron.com"  
> target="don.baugh...@enron.com"/>
>      <node id="john.kin...@enron.com">
>            <data key="field">to</data>
>            <data key="level">1</data>
>            <data key="count(*)">1.0</data>
>     </node>
>     <edge id="2"  source="kayne.coul...@enron.com"  
> target="john.kin...@enron.com"/>
>     <node id="jay.wi...@enron.com">
>           <data key="field">to</data>
>           <data key="level">1</data>
>           <data key="count(*)">1.0</data>
>     </node>
>     <edge id="3"  source="kayne.coul...@enron.com"  
> target="jay.wi...@enron.com"/></graph></graphml>
>
>
> Best,
> A. Adel
> http://aadel.io
>

Reply via email to