GraphML
Thursday, 9 May 2013 · 6 messages · last reply 10 May 2013
AR
Ali Rostami9 May 2013 15:07 #
Dear All
Since we need to add the graphml visualization to our software, I am wondering if the parser part of BaseX can be used independently?
To have an idea, look at the following GraphML from [1],
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:svg="
http://www.w3.org/2000/svg" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://graphml.graphdrawing.org/xmlns
graphml+svg.xsd">
<key id="k0" for="node">
<default>
<svg:svg width="5cm" height="4cm" version="1.1">
<svg:desc>Default graphical representation for nodes</svg:desc>
<svg:rect x="0.5cm" y="0.5cm" width="2cm" height="1cm"/>
</svg:svg>
</default>
</key>
<key id="k1" for="edge">
<desc>Graphical representation for edges</desc>
</key>
<graph edgedefault="directed">
<node id="n0">
<data key="k0">
<svg:svg width="4cm" height="8cm" version="1.1">
<svg:ellipse cx="2cm" cy="4cm" rx="2cm" ry="1cm"/>
</svg:svg>
</data>
</node>
<node id="n1"/>
<edge source="n0" target="n1">
<data key="k1">
<svg:svg width="12cm" height="4cm" viewBox="0 0 1200 400">
<svg:line x1="100" y1="300" x2="300" y2="100" stroke-width="5"/>
</svg:svg>
</data>
</edge>
</graph>
</graphml>Regards,
Ali
[1] :
http://graphml.graphdrawing.org/primer/graphml-primer.html#AttributesExample
CG
Christian Grün9 May 2013 20:59 #
Hi Ali,
I’m not completely sure what you are after; could you please give us some more details?
Best,
Christian
Quoted text · Ali Rostami · 54 lines
On Thu, May 9, 2013 at 3:07 PM, Ali Rostami <ali at c3e.de> wrote: > Dear All > > Since we need to add the graphml visualization to our software, > I am wondering if the parser part of BaseX can be used independently? > > To have an idea, look at the following GraphML from [1], > > <graphml xmlns="http://graphml.graphdrawing.org/xmlns" > xmlns:svg="http://www.w3.org/2000/svg" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns > graphml+svg.xsd"> > <key id="k0" for="node"> > <default> > <svg:svg width="5cm" height="4cm" version="1.1"> > <svg:desc>Default graphical representation for nodes</svg:desc> > <svg:rect x="0.5cm" y="0.5cm" width="2cm" height="1cm"/> > </svg:svg> > </default> > </key> > <key id="k1" for="edge"> > <desc>Graphical representation for edges</desc> > </key> > <graph edgedefault="directed"> > <node id="n0"> > <data key="k0"> > <svg:svg width="4cm" height="8cm" version="1.1"> > <svg:ellipse cx="2cm" cy="4cm" rx="2cm" ry="1cm"/> > </svg:svg> > </data> > </node> > <node id="n1"/> > <edge source="n0" target="n1"> > <data key="k1"> > <svg:svg width="12cm" height="4cm" viewBox="0 0 1200 400"> > <svg:line x1="100" y1="300" x2="300" y2="100" stroke-width="5"/> > </svg:svg> > </data> > </edge> > </graph> > </graphml> > > Regards, > Ali > > [1] : > http://graphml.graphdrawing.org/primer/graphml-primer.html#AttributesExample > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
AR
Ali Rostami10 May 2013 07:35 #
Hi Christian
I mean using the BaseX parser as an independent library.
For example, I like to write the following code,
BaseXParser bp = new BaseXParser();
XMLData xd = bp.parse("graph.xml");
Query nodes = xd.query("data(//node/@id)");
Query edgesSources = xd.query("data(//edge/@source)");
Query edgesTargets = xd.query("data(//edge/@target)");Regards,
Ali
On Thu, May 9, 2013 at 8:59 PM, Christian Grün <christian.gruen at gmail.com>wrote:
Quoted text · Christian Grün · 65 lines
> Hi Ali, > I’m not completely sure what you are after; could you please give us > some more details? > > Best, > Christian > ___________________________ > > On Thu, May 9, 2013 at 3:07 PM, Ali Rostami <ali at c3e.de> wrote: > > Dear All > > > > Since we need to add the graphml visualization to our software, > > I am wondering if the parser part of BaseX can be used independently? > > > > To have an idea, look at the following GraphML from [1], > > > > <graphml xmlns="http://graphml.graphdrawing.org/xmlns" > > xmlns:svg="http://www.w3.org/2000/svg" > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns > > graphml+svg.xsd"> > > <key id="k0" for="node"> > > <default> > > <svg:svg width="5cm" height="4cm" version="1.1"> > > <svg:desc>Default graphical representation for nodes</svg:desc> > > <svg:rect x="0.5cm" y="0.5cm" width="2cm" height="1cm"/> > > </svg:svg> > > </default> > > </key> > > <key id="k1" for="edge"> > > <desc>Graphical representation for edges</desc> > > </key> > > <graph edgedefault="directed"> > > <node id="n0"> > > <data key="k0"> > > <svg:svg width="4cm" height="8cm" version="1.1"> > > <svg:ellipse cx="2cm" cy="4cm" rx="2cm" ry="1cm"/> > > </svg:svg> > > </data> > > </node> > > <node id="n1"/> > > <edge source="n0" target="n1"> > > <data key="k1"> > > <svg:svg width="12cm" height="4cm" viewBox="0 0 1200 400"> > > <svg:line x1="100" y1="300" x2="300" y2="100" > stroke-width="5"/> > > </svg:svg> > > </data> > > </edge> > > </graph> > > </graphml> > > > > Regards, > > Ali > > > > [1] : > > > http://graphml.graphdrawing.org/primer/graphml-primer.html#AttributesExample > > > > _______________________________________________ > > BaseX-Talk mailing list > > BaseX-Talk at mailman.uni-konstanz.de > > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > > >
CG
Christian Grün10 May 2013 09:12 #
Hi Ali,
I see; yes, there are (maybe too) many ways to do so. Feel free to check out the examples provided in our basex-examples repository [1,2].
Hope this helps,
Christian
[1] https://github.com/BaseXdb/basex-examples/tree/master/src/main/java/org/basex/examples [2] https://github.com/BaseXdb/basex-examples/blob/master/src/main/java/org/basex/examples/query/RunQueries.java
Quoted text · Ali Rostami · 86 lines
On Fri, May 10, 2013 at 7:35 AM, Ali Rostami <ali at c3e.de> wrote: > Hi Christian > > I mean using the BaseX parser as an independent library. > For example, I like to write the following code, > > BaseXParser bp = new BaseXParser(); > XMLData xd = bp.parse("graph.xml"); > Query nodes = xd.query("data(//node/@id)"); > Query edgesSources = xd.query("data(//edge/@source)"); > Query edgesTargets = xd.query("data(//edge/@target)"); > > Regards, > Ali > > > > On Thu, May 9, 2013 at 8:59 PM, Christian Grün <christian.gruen at gmail.com> > wrote: >> >> Hi Ali, >> I’m not completely sure what you are after; could you please give us >> some more details? >> >> Best, >> Christian >> ___________________________ >> >> On Thu, May 9, 2013 at 3:07 PM, Ali Rostami <ali at c3e.de> wrote: >> > Dear All >> > >> > Since we need to add the graphml visualization to our software, >> > I am wondering if the parser part of BaseX can be used independently? >> > >> > To have an idea, look at the following GraphML from [1], >> > >> > <graphml xmlns="http://graphml.graphdrawing.org/xmlns" >> > xmlns:svg="http://www.w3.org/2000/svg" >> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >> > xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns >> > graphml+svg.xsd"> >> > <key id="k0" for="node"> >> > <default> >> > <svg:svg width="5cm" height="4cm" version="1.1"> >> > <svg:desc>Default graphical representation for nodes</svg:desc> >> > <svg:rect x="0.5cm" y="0.5cm" width="2cm" height="1cm"/> >> > </svg:svg> >> > </default> >> > </key> >> > <key id="k1" for="edge"> >> > <desc>Graphical representation for edges</desc> >> > </key> >> > <graph edgedefault="directed"> >> > <node id="n0"> >> > <data key="k0"> >> > <svg:svg width="4cm" height="8cm" version="1.1"> >> > <svg:ellipse cx="2cm" cy="4cm" rx="2cm" ry="1cm"/> >> > </svg:svg> >> > </data> >> > </node> >> > <node id="n1"/> >> > <edge source="n0" target="n1"> >> > <data key="k1"> >> > <svg:svg width="12cm" height="4cm" viewBox="0 0 1200 400"> >> > <svg:line x1="100" y1="300" x2="300" y2="100" >> > stroke-width="5"/> >> > </svg:svg> >> > </data> >> > </edge> >> > </graph> >> > </graphml> >> > >> > Regards, >> > Ali >> > >> > [1] : >> > >> > http://graphml.graphdrawing.org/primer/graphml-primer.html#AttributesExample >> > >> > _______________________________________________ >> > BaseX-Talk mailing list >> > BaseX-Talk at mailman.uni-konstanz.de >> > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >> > > >
AR
Ali Rostami10 May 2013 09:54 #
Hi Christian,
Exactly, this is the one I need for Query.
However, I can not find how BaseX open/parse the database from the file. Is there any easy way to do that?
Regards,
Ali
On Fri, May 10, 2013 at 9:12 AM, Christian Grün
<christian.gruen at gmail.com>wrote:
Quoted text · Christian Grün · 105 lines
> Hi Ali, > > I see; yes, there are (maybe too) many ways to do so. Feel free to > check out the examples provided in our basex-examples repository > [1,2]. > > Hope this helps, > Christian > > [1] > https://github.com/BaseXdb/basex-examples/tree/master/src/main/java/org/basex/examples > [2] > https://github.com/BaseXdb/basex-examples/blob/master/src/main/java/org/basex/examples/query/RunQueries.java > ___________________________ > > On Fri, May 10, 2013 at 7:35 AM, Ali Rostami <ali at c3e.de> wrote: > > Hi Christian > > > > I mean using the BaseX parser as an independent library. > > For example, I like to write the following code, > > > > BaseXParser bp = new BaseXParser(); > > XMLData xd = bp.parse("graph.xml"); > > Query nodes = xd.query("data(//node/@id)"); > > Query edgesSources = xd.query("data(//edge/@source)"); > > Query edgesTargets = xd.query("data(//edge/@target)"); > > > > Regards, > > Ali > > > > > > > > On Thu, May 9, 2013 at 8:59 PM, Christian Grün < > christian.gruen at gmail.com> > > wrote: > >> > >> Hi Ali, > >> I’m not completely sure what you are after; could you please give us > >> some more details? > >> > >> Best, > >> Christian > >> ___________________________ > >> > >> On Thu, May 9, 2013 at 3:07 PM, Ali Rostami <ali at c3e.de> wrote: > >> > Dear All > >> > > >> > Since we need to add the graphml visualization to our software, > >> > I am wondering if the parser part of BaseX can be used independently? > >> > > >> > To have an idea, look at the following GraphML from [1], > >> > > >> > <graphml xmlns="http://graphml.graphdrawing.org/xmlns" > >> > xmlns:svg="http://www.w3.org/2000/svg" > >> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > >> > xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns > >> > graphml+svg.xsd"> > >> > <key id="k0" for="node"> > >> > <default> > >> > <svg:svg width="5cm" height="4cm" version="1.1"> > >> > <svg:desc>Default graphical representation for > nodes</svg:desc> > >> > <svg:rect x="0.5cm" y="0.5cm" width="2cm" height="1cm"/> > >> > </svg:svg> > >> > </default> > >> > </key> > >> > <key id="k1" for="edge"> > >> > <desc>Graphical representation for edges</desc> > >> > </key> > >> > <graph edgedefault="directed"> > >> > <node id="n0"> > >> > <data key="k0"> > >> > <svg:svg width="4cm" height="8cm" version="1.1"> > >> > <svg:ellipse cx="2cm" cy="4cm" rx="2cm" ry="1cm"/> > >> > </svg:svg> > >> > </data> > >> > </node> > >> > <node id="n1"/> > >> > <edge source="n0" target="n1"> > >> > <data key="k1"> > >> > <svg:svg width="12cm" height="4cm" viewBox="0 0 1200 400"> > >> > <svg:line x1="100" y1="300" x2="300" y2="100" > >> > stroke-width="5"/> > >> > </svg:svg> > >> > </data> > >> > </edge> > >> > </graph> > >> > </graphml> > >> > > >> > Regards, > >> > Ali > >> > > >> > [1] : > >> > > >> > > http://graphml.graphdrawing.org/primer/graphml-primer.html#AttributesExample > >> > > >> > _______________________________________________ > >> > BaseX-Talk mailing list > >> > BaseX-Talk at mailman.uni-konstanz.de > >> > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > >> > > > > > >
AR
Ali Rostami10 May 2013 09:59 #
Hi,
I think I find it here:
https://github.com/BaseXdb/basex-examples/blob/master/src/main/java/org/basex/examples/UserExample.java
I misunderstood the code because the name of the function is "createDB" and not "openDB".
I try this new one and let you know if it works.
Regards,
Ali
Quoted text · Ali Rostami · 121 lines
On Fri, May 10, 2013 at 9:54 AM, Ali Rostami <ali at c3e.de> wrote: > Hi Christian, > > Exactly, this is the one I need for Query. > However, I can not find how BaseX open/parse the database from the file. > Is there any easy way to do that? > > Regards, > Ali > > > On Fri, May 10, 2013 at 9:12 AM, Christian Grün <christian.gruen at gmail.com > > wrote: > >> Hi Ali, >> >> I see; yes, there are (maybe too) many ways to do so. Feel free to >> check out the examples provided in our basex-examples repository >> [1,2]. >> >> Hope this helps, >> Christian >> >> [1] >> https://github.com/BaseXdb/basex-examples/tree/master/src/main/java/org/basex/examples >> [2] >> https://github.com/BaseXdb/basex-examples/blob/master/src/main/java/org/basex/examples/query/RunQueries.java >> ___________________________ >> >> On Fri, May 10, 2013 at 7:35 AM, Ali Rostami <ali at c3e.de> wrote: >> > Hi Christian >> > >> > I mean using the BaseX parser as an independent library. >> > For example, I like to write the following code, >> > >> > BaseXParser bp = new BaseXParser(); >> > XMLData xd = bp.parse("graph.xml"); >> > Query nodes = xd.query("data(//node/@id)"); >> > Query edgesSources = xd.query("data(//edge/@source)"); >> > Query edgesTargets = xd.query("data(//edge/@target)"); >> > >> > Regards, >> > Ali >> > >> > >> > >> > On Thu, May 9, 2013 at 8:59 PM, Christian Grün < >> christian.gruen at gmail.com> >> > wrote: >> >> >> >> Hi Ali, >> >> I’m not completely sure what you are after; could you please give us >> >> some more details? >> >> >> >> Best, >> >> Christian >> >> ___________________________ >> >> >> >> On Thu, May 9, 2013 at 3:07 PM, Ali Rostami <ali at c3e.de> wrote: >> >> > Dear All >> >> > >> >> > Since we need to add the graphml visualization to our software, >> >> > I am wondering if the parser part of BaseX can be used independently? >> >> > >> >> > To have an idea, look at the following GraphML from [1], >> >> > >> >> > <graphml xmlns="http://graphml.graphdrawing.org/xmlns" >> >> > xmlns:svg="http://www.w3.org/2000/svg" >> >> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >> >> > xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns >> >> > graphml+svg.xsd"> >> >> > <key id="k0" for="node"> >> >> > <default> >> >> > <svg:svg width="5cm" height="4cm" version="1.1"> >> >> > <svg:desc>Default graphical representation for >> nodes</svg:desc> >> >> > <svg:rect x="0.5cm" y="0.5cm" width="2cm" height="1cm"/> >> >> > </svg:svg> >> >> > </default> >> >> > </key> >> >> > <key id="k1" for="edge"> >> >> > <desc>Graphical representation for edges</desc> >> >> > </key> >> >> > <graph edgedefault="directed"> >> >> > <node id="n0"> >> >> > <data key="k0"> >> >> > <svg:svg width="4cm" height="8cm" version="1.1"> >> >> > <svg:ellipse cx="2cm" cy="4cm" rx="2cm" ry="1cm"/> >> >> > </svg:svg> >> >> > </data> >> >> > </node> >> >> > <node id="n1"/> >> >> > <edge source="n0" target="n1"> >> >> > <data key="k1"> >> >> > <svg:svg width="12cm" height="4cm" viewBox="0 0 1200 400"> >> >> > <svg:line x1="100" y1="300" x2="300" y2="100" >> >> > stroke-width="5"/> >> >> > </svg:svg> >> >> > </data> >> >> > </edge> >> >> > </graph> >> >> > </graphml> >> >> > >> >> > Regards, >> >> > Ali >> >> > >> >> > [1] : >> >> > >> >> > >> http://graphml.graphdrawing.org/primer/graphml-primer.html#AttributesExample >> >> > >> >> > _______________________________________________ >> >> > BaseX-Talk mailing list >> >> > BaseX-Talk at mailman.uni-konstanz.de >> >> > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >> >> > >> > >> > >> > >
Written for BaseX 7.6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery