digraph questions

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

digraph questions

Lloyd R. Prentice-2

The Erlang digraph library looks like it may provide an interesting way to diagram scenes in a novel.

 

1> Scene10 = digraph:new().

 

Imagine:

 

Setting:"park"

Character1:"Franco"

Character2:"Sophia"

 

2> digraph:add_vertex(Scene10, "Park", "Night").

3> digraph:add_vertex(Scene10, "Franco", "Old and fat").

4> digraph:add_vertex(Scene10, "Sophia", "Young and beautiful").

5> digraph:add_edge(Scene10, "Franco", "Sophia", "loves").

 

OK to here EXCEPT command 5 returns:

 

['$e'|0]

 

6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").

 

OK to here EXCEPT command 5 returns:

 

['$e'|0]

 

6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").

['$e'|1]

 

Wah!

 

Question 1: How do I see labels?

 

Question 2: Be cool to add a sequence of actions. I can probably figure this out, but is there an elegant solution?

 

Question 3: I'd love to visualize the graph. I see it can be done in Elixir. But I don't know Elixir. Has anyone programmed a way to visualize digraphs in Erlang?

 

Comment: Digraph is crying out for a comprehensive tutorial. I'd love to do it, but just don't know enough yet.

 

Many thanks,

 

LRP

 

 

 

 


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: digraph questions

Richard O'Keefe
The obvious way to visualise a graph would be to drive
something like GraphViz or Gephi or, ideally, UbiGraph
copy of the Linux x86-64 version; the official source
is currently unreachable).  There is an erlubi. But
perhaps the thing you might want to look at first is
It will take a bit of patching to get up to date with
current versions of Erlang and Cowboy.

On Tue, 9 Apr 2019 at 11:29, <[hidden email]> wrote:

The Erlang digraph library looks like it may provide an interesting way to diagram scenes in a novel.

 

1> Scene10 = digraph:new().

 

Imagine:

 

Setting:"park"

Character1:"Franco"

Character2:"Sophia"

 

2> digraph:add_vertex(Scene10, "Park", "Night").

3> digraph:add_vertex(Scene10, "Franco", "Old and fat").

4> digraph:add_vertex(Scene10, "Sophia", "Young and beautiful").

5> digraph:add_edge(Scene10, "Franco", "Sophia", "loves").

 

OK to here EXCEPT command 5 returns:

 

['$e'|0]

 

6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").

 

OK to here EXCEPT command 5 returns:

 

['$e'|0]

 

6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").

['$e'|1]

 

Wah!

 

Question 1: How do I see labels?

 

Question 2: Be cool to add a sequence of actions. I can probably figure this out, but is there an elegant solution?

 

Question 3: I'd love to visualize the graph. I see it can be done in Elixir. But I don't know Elixir. Has anyone programmed a way to visualize digraphs in Erlang?

 

Comment: Digraph is crying out for a comprehensive tutorial. I'd love to do it, but just don't know enough yet.

 

Many thanks,

 

LRP

 

 

 

 

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: digraph questions

Lloyd R. Prentice-2
Many thanks, Richard. I’ll definitively follow up.

Can you tell me how to return the labels?

All the best,

Lloyd

Sent from my iPad

On Apr 8, 2019, at 8:46 PM, Richard O'Keefe <[hidden email]> wrote:

The obvious way to visualise a graph would be to drive
something like GraphViz or Gephi or, ideally, UbiGraph
copy of the Linux x86-64 version; the official source
is currently unreachable).  There is an erlubi. But
perhaps the thing you might want to look at first is
It will take a bit of patching to get up to date with
current versions of Erlang and Cowboy.

On Tue, 9 Apr 2019 at 11:29, <[hidden email]> wrote:

The Erlang digraph library looks like it may provide an interesting way to diagram scenes in a novel.

 

1> Scene10 = digraph:new().

 

Imagine:

 

Setting:"park"

Character1:"Franco"

Character2:"Sophia"

 

2> digraph:add_vertex(Scene10, "Park", "Night").

3> digraph:add_vertex(Scene10, "Franco", "Old and fat").

4> digraph:add_vertex(Scene10, "Sophia", "Young and beautiful").

5> digraph:add_edge(Scene10, "Franco", "Sophia", "loves").

 

OK to here EXCEPT command 5 returns:

 

['$e'|0]

 

6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").

 

OK to here EXCEPT command 5 returns:

 

['$e'|0]

 

6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").

['$e'|1]

 

Wah!

 

Question 1: How do I see labels?

 

Question 2: Be cool to add a sequence of actions. I can probably figure this out, but is there an elegant solution?

 

Question 3: I'd love to visualize the graph. I see it can be done in Elixir. But I don't know Elixir. Has anyone programmed a way to visualize digraphs in Erlang?

 

Comment: Digraph is crying out for a comprehensive tutorial. I'd love to do it, but just don't know enough yet.

 

Many thanks,

 

LRP

 

 

 

 

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: digraph questions

Bob Ippolito
The data structures here are all opaque, which is why their representations in the terminal don't see very useful. To get the label, you use the digraph:vertex/2 or digraph:edge/2 functions. You can discover this by reading the documentation and search for label, these are the only functions that have a label anywhere in their return types. You can traverse the whole graph by using digraph:vertices/1 and then get the label and edges for each vertex from there (and get the label of each edge along the way).

Usage of digraph would look something like:

1> Scene10 = digraph:new().
{digraph,#Ref<0.1177877097.1300365313.19691>,
         #Ref<0.1177877097.1300365313.19692>,
         #Ref<0.1177877097.1300365313.19693>,true}
2> digraph:add_vertex(Scene10, "Franco", "Old and fat").
"Franco"
3> digraph:add_vertex(Scene10, "Sophia", "Young and beautiful").
"Sophia"
4> digraph:add_edge(Scene10, "Franco", "Sophia", "loves").
['$e'|0]
5> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").
['$e'|1]
6> digraph:vertex(Scene10, "Franco").
{"Franco","Old and fat"}
7> digraph:edges(Scene10, "Franco").
[['$e'|1],['$e'|0]]
8> [digraph:edge(Scene10, E) || E <- digraph:edges(Scene10, "Franco")].
[{['$e'|1],"Sophia","Franco","hates"},
 {['$e'|0],"Franco","Sophia","loves"}]

Using digraph in the shell is probably not an ideal user experience because it uses ets tables behind the scene, and they'll be destroyed when your shell process crashes (e.g. the first time you make a mistake!).

Searching for "erlang digraph graphviz" comes up with a few projects that seem relevant to your visualization needs.

-bob


On Mon, Apr 8, 2019 at 8:33 PM Lloyd R. Prentice <[hidden email]> wrote:
Many thanks, Richard. I’ll definitively follow up.

Can you tell me how to return the labels?

All the best,

Lloyd

Sent from my iPad

On Apr 8, 2019, at 8:46 PM, Richard O'Keefe <[hidden email]> wrote:

The obvious way to visualise a graph would be to drive
something like GraphViz or Gephi or, ideally, UbiGraph
copy of the Linux x86-64 version; the official source
is currently unreachable).  There is an erlubi. But
perhaps the thing you might want to look at first is
It will take a bit of patching to get up to date with
current versions of Erlang and Cowboy.

On Tue, 9 Apr 2019 at 11:29, <[hidden email]> wrote:

The Erlang digraph library looks like it may provide an interesting way to diagram scenes in a novel.

 

1> Scene10 = digraph:new().

 

Imagine:

 

Setting:"park"

Character1:"Franco"

Character2:"Sophia"

 

2> digraph:add_vertex(Scene10, "Park", "Night").

3> digraph:add_vertex(Scene10, "Franco", "Old and fat").

4> digraph:add_vertex(Scene10, "Sophia", "Young and beautiful").

5> digraph:add_edge(Scene10, "Franco", "Sophia", "loves").

 

OK to here EXCEPT command 5 returns:

 

['$e'|0]

 

6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").

 

OK to here EXCEPT command 5 returns:

 

['$e'|0]

 

6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").

['$e'|1]

 

Wah!

 

Question 1: How do I see labels?

 

Question 2: Be cool to add a sequence of actions. I can probably figure this out, but is there an elegant solution?

 

Question 3: I'd love to visualize the graph. I see it can be done in Elixir. But I don't know Elixir. Has anyone programmed a way to visualize digraphs in Erlang?

 

Comment: Digraph is crying out for a comprehensive tutorial. I'd love to do it, but just don't know enough yet.

 

Many thanks,

 

LRP

 

 

 

 

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: digraph questions

Mike French
In reply to this post by Lloyd R. Prentice-2

I understand you are looking for a digraph use case, but to answer the actual question, see StoryFlow:


http://www.ycwu.org/projects/infovis13.html


Mike


From: [hidden email] <[hidden email]> on behalf of [hidden email] <[hidden email]>
Sent: Tuesday, April 9, 2019 2:28:49 AM
To: [hidden email]
Subject: [erlang-questions] digraph questions
 

The Erlang digraph library looks like it may provide an interesting way to diagram scenes in a novel.

 

1> Scene10 = digraph:new().

 

Imagine:

 

Setting:"park"

Character1:"Franco"

Character2:"Sophia"

 

2> digraph:add_vertex(Scene10, "Park", "Night").

3> digraph:add_vertex(Scene10, "Franco", "Old and fat").

4> digraph:add_vertex(Scene10, "Sophia", "Young and beautiful").

5> digraph:add_edge(Scene10, "Franco", "Sophia", "loves").

 

OK to here EXCEPT command 5 returns:

 

['$e'|0]

 

6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").

 

OK to here EXCEPT command 5 returns:

 

['$e'|0]

 

6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").

['$e'|1]

 

Wah!

 

Question 1: How do I see labels?

 

Question 2: Be cool to add a sequence of actions. I can probably figure this out, but is there an elegant solution?

 

Question 3: I'd love to visualize the graph. I see it can be done in Elixir. But I don't know Elixir. Has anyone programmed a way to visualize digraphs in Erlang?

 

Comment: Digraph is crying out for a comprehensive tutorial. I'd love to do it, but just don't know enough yet.

 

Many thanks,

 

LRP

 

 

 

 


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: digraph questions

Hugo Mills-2
In reply to this post by Lloyd R. Prentice-2
On Mon, Apr 08, 2019 at 07:28:49PM -0400, [hidden email] wrote:

>
> The Erlang digraph library looks like it may provide an interesting way to diagram scenes in a novel.
>  
> 1> Scene10 = digraph:new().
>  
> Imagine:
>  
> Setting:"park"
> Character1:"Franco"
> Character2:"Sophia"
>  
> 2> digraph:add_vertex(Scene10, "Park", "Night").
> 3> digraph:add_vertex(Scene10, "Franco", "Old and fat").
> 4> digraph:add_vertex(Scene10, "Sophia", "Young and beautiful").
> 5> digraph:add_edge(Scene10, "Franco", "Sophia", "loves").
   Congratulations, you just invented a subset of RDF. :)

   Also, I fear that contextus.net has now vanished, but there were a
bunch of people at Southampton University about 10 years ago
(including me) who were working on narrative descriptions in RDF.

   It gets more complicated when you have to deal with temporal
descriptions (X loved Y until X discovered that Y was having an affair
with Z), and different narrative timelines (the audience's experience
of the timeline of Pulp Fiction is very different to that of the
characters; CSI usually shows multiple inconsistent views of the crime
over the course of an episode). You can also start modelling different
characters' beliefs (see, for example, the end of Romeo and Juliet,
where the plot hinges critically on what people think they know).

   I'm not sure if I've got any of the ontologies any more, but I can
ask around the group and see if it's on someone's hard disk still...

   Hugo.

> OK to here EXCEPT command 5 returns:
>  
> ['$e'|0]
>  
> 6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").
>  
> OK to here EXCEPT command 5 returns:
>  
> ['$e'|0]
>  
> 6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").
> ['$e'|1]
>  
> Wah!
>  
> Question 1: How do I see labels?
>  
> Question 2: Be cool to add a sequence of actions. I can probably figure this out, but is there an elegant solution?
>  
> Question 3: I'd love to visualize the graph. I see it can be done in Elixir. But I don't know Elixir. Has anyone programmed a way to visualize digraphs in Erlang?
>  
> Comment: Digraph is crying out for a comprehensive tutorial. I'd love to do it, but just don't know enough yet.
--
Hugo Mills             | Books are superior to radio: the soundtrack is
hugo@... carfax.org.uk | better
http://carfax.org.uk/  |
PGP: E2AB1DE4          |

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

signature.asc (853 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: digraph questions

Hugo Mills-2
In reply to this post by Richard O'Keefe
On Tue, Apr 09, 2019 at 12:46:21PM +1200, Richard O'Keefe wrote:
> The obvious way to visualise a graph would be to drive
> something like GraphViz or Gephi or, ideally, UbiGraph
> (https://github.com/alan86alves/ubigraph_server has a
> copy of the Linux x86-64 version; the official source
> is currently unreachable).  There is an erlubi. But
> perhaps the thing you might want to look at first is
> https://github.com/aol/erlgraph
> It will take a bit of patching to get up to date with
> current versions of Erlang and Cowboy.

   These kinds of graphs get *very* dense, and it's almost impossible
to draw the whole graph in any meaningful sense. You can't just throw
the graph at a graph drawing package and expect to get usable output.

   You really need to spend the time on working out what it is you
want to show, whether it's "everything directly relating to this one
character", or "the sequence of events in this scene", or "who was
with who over the course of the story", and then strip out everything
else to show the graph. You're going to be spending much more of your
time thinking about *what* to show than how to show it, in my
experience.

   Hugo.

> On Tue, 9 Apr 2019 at 11:29, <[hidden email]> wrote:
>
> > The Erlang digraph library looks like it may provide an interesting way to
> > diagram scenes in a novel.
> >
> >
> >
> > 1> Scene10 = digraph:new().
> >
> >
> >
> > Imagine:
> >
> >
> >
> > Setting:"park"
> >
> > Character1:"Franco"
> >
> > Character2:"Sophia"
> >
> >
> >
> > 2> digraph:add_vertex(Scene10, "Park", "Night").
> >
> > 3> digraph:add_vertex(Scene10, "Franco", "Old and fat").
> >
> > 4> digraph:add_vertex(Scene10, "Sophia", "Young and beautiful").
> >
> > 5> digraph:add_edge(Scene10, "Franco", "Sophia", "loves").
> >
> >
> >
> > OK to here EXCEPT command 5 returns:
> >
> >
> >
> > ['$e'|0]
> >
> >
> >
> > 6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").
> >
> >
> >
> > OK to here EXCEPT command 5 returns:
> >
> >
> >
> > ['$e'|0]
> >
> >
> >
> > 6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").
> >
> > ['$e'|1]
> >
> >
> >
> > Wah!
> >
> >
> >
> > Question 1: How do I see labels?
> >
> >
> >
> > Question 2: Be cool to add a sequence of actions. I can probably figure
> > this out, but is there an elegant solution?
> >
> >
> >
> > Question 3: I'd love to visualize the graph. I see it can be done in
> > Elixir. But I don't know Elixir. Has anyone programmed a way to visualize
> > digraphs in Erlang?
> >
> >
> >
> > Comment: Digraph is crying out for a comprehensive tutorial. I'd love to
> > do it, but just don't know enough yet.
> >
> >
> >
> > Many thanks,
> >
> >
> >
> > LRP
> >
> >
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > erlang-questions mailing list
> > [hidden email]
> > http://erlang.org/mailman/listinfo/erlang-questions
> >

> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions


--
Hugo Mills             | Books are superior to radio: the soundtrack is
hugo@... carfax.org.uk | better
http://carfax.org.uk/  |
PGP: E2AB1DE4          |

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

signature.asc (853 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: digraph questions

Mike French
In reply to this post by Hugo Mills-2

Yes, try Inception, or Memento, which has ~linear narrative of a non-linear character :)


The problem with RDF is that everything is a subset of RDF. Just as I gave up formal methods when an expert told me that "floating point... that's still a research topic" (RAL 1990), so I gave up RDF when the philosophers started arguing about a Standard Upper Ontology (SUO), for things like space and time, which looked like it could last for decades. There should be a harder prequel CS deadlock problem called The Arguing Philosophers, about where to have dinner in the first place).


For a practical interactive system that uses graph-based spatio-temporal data, see Palantir. In addition to tagged text and table listings, it has 3 connected views of the same data: graph, map and timeline. 


StoryFlow cites XKCD as a reference:


https://xkcd.com/657/


Mike





From: [hidden email] <[hidden email]> on behalf of Hugo Mills <[hidden email]>
Sent: Tuesday, April 9, 2019 11:43 AM
To: [hidden email]
Cc: [hidden email]
Subject: Re: [erlang-questions] digraph questions
 
On Mon, Apr 08, 2019 at 07:28:49PM -0400, [hidden email] wrote:
>
> The Erlang digraph library looks like it may provide an interesting way to diagram scenes in a novel.

> 1> Scene10 = digraph:new().

> Imagine:

> Setting:"park"
> Character1:"Franco"
> Character2:"Sophia"

> 2> digraph:add_vertex(Scene10, "Park", "Night").
> 3> digraph:add_vertex(Scene10, "Franco", "Old and fat").
> 4> digraph:add_vertex(Scene10, "Sophia", "Young and beautiful").
> 5> digraph:add_edge(Scene10, "Franco", "Sophia", "loves").

   Congratulations, you just invented a subset of RDF. :)

   Also, I fear that contextus.net has now vanished, but there were a
bunch of people at Southampton University about 10 years ago
(including me) who were working on narrative descriptions in RDF.

   It gets more complicated when you have to deal with temporal
descriptions (X loved Y until X discovered that Y was having an affair
with Z), and different narrative timelines (the audience's experience
of the timeline of Pulp Fiction is very different to that of the
characters; CSI usually shows multiple inconsistent views of the crime
over the course of an episode). You can also start modelling different
characters' beliefs (see, for example, the end of Romeo and Juliet,
where the plot hinges critically on what people think they know).

   I'm not sure if I've got any of the ontologies any more, but I can
ask around the group and see if it's on someone's hard disk still...

   Hugo.

> OK to here EXCEPT command 5 returns:

> ['$e'|0]

> 6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").

> OK to here EXCEPT command 5 returns:

> ['$e'|0]

> 6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").
> ['$e'|1]

> Wah!

> Question 1: How do I see labels?

> Question 2: Be cool to add a sequence of actions. I can probably figure this out, but is there an elegant solution?

> Question 3: I'd love to visualize the graph. I see it can be done in Elixir. But I don't know Elixir. Has anyone programmed a way to visualize digraphs in Erlang?

> Comment: Digraph is crying out for a comprehensive tutorial. I'd love to do it, but just don't know enough yet.

--
Hugo Mills             | Books are superior to radio: the soundtrack is
hugo@... carfax.org.uk | better
http://carfax.org.uk/  |
PGP: E2AB1DE4          |

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: digraph questions

Hugo Mills-2
On Tue, Apr 09, 2019 at 09:24:50AM +0000, Mike French wrote:
> Yes, try Inception, or Memento, which has ~linear narrative of a
> non-linear character :)

   It's almost more interesting (and more relatable) to find cases
which aren't science fiction, which is why I picked Pulp Fiction and
CSI for examples of time travel and alternate universes respectively.

   There's also fun to be had over characters that appear in different
guises: Holmes as played by Rathbone, Brett or Downey, say, or Death
as portrayed in Discworld, Sandman, The Seventh Seal, or Bill and
Ted...

> The problem with RDF is that everything is a subset of RDF. Just as
> I gave up formal methods when an expert told me that "floating
> point... that's still a research topic" (RAL 1990), so I gave up RDF
> when the philosophers started arguing about a Standard Upper
> Ontology (SUO), for things like space and time, which looked like it
> could last for decades. There should be a harder prequel CS deadlock
> problem called The Arguing Philosophers, about where to have dinner
> in the first place).

   Practical RDF, lesson 1: You can pretty much ignore anything that
calls itself an upper ontology, because it's mostly going to be
"here's all these obvious things, and we'll leave all the hard details
for you to sort out".

   There is, for example, a perfectly good time ontology (OWL Time,
from the W3C) which covers both topological and measured times, the
latter being open to multiple calendar representations (although they
concentrate on the proleptic Gregorian calendar in the spec).

   For spatial, there's a whole load of Geo-* stuff that works in two
dimensions, and mostly falls back on WKT. I've certainly seen a good
topological spatial representation, but that was nearly two decades
ago, and I think it's probably been lost since.

   The practical approach to RDF: pick what's already out there, and
what's practical to use now. Fill in the bits that aren't available
off the shelf yourself. Prov-O for processes, OWL Time for time, WKT
for spatial, QUDT for units, Data Cube for tablular structure, ...

> For a practical interactive system that uses graph-based spatio-temporal data, see Palantir. In addition to tagged text and table listings, it has 3 connected views of the same data: graph, map and timeline.
>
>
> StoryFlow cites XKCD as a reference:
>
>
> https://xkcd.com/657/
>
> ________________________________
> From: [hidden email] <[hidden email]> on behalf of Hugo Mills <[hidden email]>
> Sent: Tuesday, April 9, 2019 11:43 AM
> To: [hidden email]
> Cc: [hidden email]
> Subject: Re: [erlang-questions] digraph questions
>
> On Mon, Apr 08, 2019 at 07:28:49PM -0400, [hidden email] wrote:
> >
> > The Erlang digraph library looks like it may provide an interesting way to diagram scenes in a novel.
> >
> > 1> Scene10 = digraph:new().
> >
> > Imagine:
> >
> > Setting:"park"
> > Character1:"Franco"
> > Character2:"Sophia"
> >
> > 2> digraph:add_vertex(Scene10, "Park", "Night").
> > 3> digraph:add_vertex(Scene10, "Franco", "Old and fat").
> > 4> digraph:add_vertex(Scene10, "Sophia", "Young and beautiful").
> > 5> digraph:add_edge(Scene10, "Franco", "Sophia", "loves").
>
>    Congratulations, you just invented a subset of RDF. :)
>
>    Also, I fear that contextus.net has now vanished, but there were a
> bunch of people at Southampton University about 10 years ago
> (including me) who were working on narrative descriptions in RDF.
>
>    It gets more complicated when you have to deal with temporal
> descriptions (X loved Y until X discovered that Y was having an affair
> with Z), and different narrative timelines (the audience's experience
> of the timeline of Pulp Fiction is very different to that of the
> characters; CSI usually shows multiple inconsistent views of the crime
> over the course of an episode). You can also start modelling different
> characters' beliefs (see, for example, the end of Romeo and Juliet,
> where the plot hinges critically on what people think they know).
>
>    I'm not sure if I've got any of the ontologies any more, but I can
> ask around the group and see if it's on someone's hard disk still...
>
>    Hugo.
>
> > OK to here EXCEPT command 5 returns:
> >
> > ['$e'|0]
> >
> > 6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").
> >
> > OK to here EXCEPT command 5 returns:
> >
> > ['$e'|0]
> >
> > 6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").
> > ['$e'|1]
> >
> > Wah!
> >
> > Question 1: How do I see labels?
> >
> > Question 2: Be cool to add a sequence of actions. I can probably figure this out, but is there an elegant solution?
> >
> > Question 3: I'd love to visualize the graph. I see it can be done in Elixir. But I don't know Elixir. Has anyone programmed a way to visualize digraphs in Erlang?
> >
> > Comment: Digraph is crying out for a comprehensive tutorial. I'd love to do it, but just don't know enough yet.
>
--
Hugo Mills             | Great oxymorons of the world, no. 3:
hugo@... carfax.org.uk | Military Intelligence
http://carfax.org.uk/  |
PGP: E2AB1DE4          |

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

signature.asc (853 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: digraph questions

Lloyd R. Prentice-2
Much appreciate the many inspiring responses.

Bob, I must have experienced a touch of brain lapse. Turns out I did execute vertex/2. Just failed to notice that it returned the label. Apologies to all.

Hugo, et. al., I’m very interested in your experience graphing narrative structures. I can understand how attempts to graph the narrative flow of a serious work of fiction after the fact can result in dense graphs with many ontological issues.

I’m playing around with a kind writer’s sketch pad— a tool with which a writer can quickly visualize and construct a scene involving several characters and interactively play around with different sequences of motivation, action, and consequence.

In my experience as a novelist, I often don’t know what’s going to happen to my characters when I throw them together in a setting to construct a scene. I can write it out as a creative act of discovery, but then the temptation is to get stuck on that one of many possible solutions. So I’ve been thinking about a mind-map kind of application with quick turn-around to imagine and visualize different possible scenarios.

The graph structure definitely has limitations. Joe hits Bob is easy to graph. But why, what alternatives did Bob consider before responding, how is the dispute resolved, etc., is more challenging.

I welcome any and all ideas.

Thanks again to all.

Best,

Lloyd

Sent from my iPad

> On Apr 9, 2019, at 7:01 AM, Hugo Mills <[hidden email]> wrote:
>
>> On Tue, Apr 09, 2019 at 09:24:50AM +0000, Mike French wrote:
>> Yes, try Inception, or Memento, which has ~linear narrative of a
>> non-linear character :)
>
>   It's almost more interesting (and more relatable) to find cases
> which aren't science fiction, which is why I picked Pulp Fiction and
> CSI for examples of time travel and alternate universes respectively.
>
>   There's also fun to be had over characters that appear in different
> guises: Holmes as played by Rathbone, Brett or Downey, say, or Death
> as portrayed in Discworld, Sandman, The Seventh Seal, or Bill and
> Ted...
>
>> The problem with RDF is that everything is a subset of RDF. Just as
>> I gave up formal methods when an expert told me that "floating
>> point... that's still a research topic" (RAL 1990), so I gave up RDF
>> when the philosophers started arguing about a Standard Upper
>> Ontology (SUO), for things like space and time, which looked like it
>> could last for decades. There should be a harder prequel CS deadlock
>> problem called The Arguing Philosophers, about where to have dinner
>> in the first place).
>
>   Practical RDF, lesson 1: You can pretty much ignore anything that
> calls itself an upper ontology, because it's mostly going to be
> "here's all these obvious things, and we'll leave all the hard details
> for you to sort out".
>
>   There is, for example, a perfectly good time ontology (OWL Time,
> from the W3C) which covers both topological and measured times, the
> latter being open to multiple calendar representations (although they
> concentrate on the proleptic Gregorian calendar in the spec).
>
>   For spatial, there's a whole load of Geo-* stuff that works in two
> dimensions, and mostly falls back on WKT. I've certainly seen a good
> topological spatial representation, but that was nearly two decades
> ago, and I think it's probably been lost since.
>
>   The practical approach to RDF: pick what's already out there, and
> what's practical to use now. Fill in the bits that aren't available
> off the shelf yourself. Prov-O for processes, OWL Time for time, WKT
> for spatial, QUDT for units, Data Cube for tablular structure, ...
>
>> For a practical interactive system that uses graph-based spatio-temporal data, see Palantir. In addition to tagged text and table listings, it has 3 connected views of the same data: graph, map and timeline.
>>
>>
>> StoryFlow cites XKCD as a reference:
>>
>>
>> https://xkcd.com/657/
>>
>> ________________________________
>> From: [hidden email] <[hidden email]> on behalf of Hugo Mills <[hidden email]>
>> Sent: Tuesday, April 9, 2019 11:43 AM
>> To: [hidden email]
>> Cc: [hidden email]
>> Subject: Re: [erlang-questions] digraph questions
>>
>>> On Mon, Apr 08, 2019 at 07:28:49PM -0400, [hidden email] wrote:
>>>
>>> The Erlang digraph library looks like it may provide an interesting way to diagram scenes in a novel.
>>>
>>> 1> Scene10 = digraph:new().
>>>
>>> Imagine:
>>>
>>> Setting:"park"
>>> Character1:"Franco"
>>> Character2:"Sophia"
>>>
>>> 2> digraph:add_vertex(Scene10, "Park", "Night").
>>> 3> digraph:add_vertex(Scene10, "Franco", "Old and fat").
>>> 4> digraph:add_vertex(Scene10, "Sophia", "Young and beautiful").
>>> 5> digraph:add_edge(Scene10, "Franco", "Sophia", "loves").
>>
>>   Congratulations, you just invented a subset of RDF. :)
>>
>>   Also, I fear that contextus.net has now vanished, but there were a
>> bunch of people at Southampton University about 10 years ago
>> (including me) who were working on narrative descriptions in RDF.
>>
>>   It gets more complicated when you have to deal with temporal
>> descriptions (X loved Y until X discovered that Y was having an affair
>> with Z), and different narrative timelines (the audience's experience
>> of the timeline of Pulp Fiction is very different to that of the
>> characters; CSI usually shows multiple inconsistent views of the crime
>> over the course of an episode). You can also start modelling different
>> characters' beliefs (see, for example, the end of Romeo and Juliet,
>> where the plot hinges critically on what people think they know).
>>
>>   I'm not sure if I've got any of the ontologies any more, but I can
>> ask around the group and see if it's on someone's hard disk still...
>>
>>   Hugo.
>>
>>> OK to here EXCEPT command 5 returns:
>>>
>>> ['$e'|0]
>>>
>>> 6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").
>>>
>>> OK to here EXCEPT command 5 returns:
>>>
>>> ['$e'|0]
>>>
>>> 6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").
>>> ['$e'|1]
>>>
>>> Wah!
>>>
>>> Question 1: How do I see labels?
>>>
>>> Question 2: Be cool to add a sequence of actions. I can probably figure this out, but is there an elegant solution?
>>>
>>> Question 3: I'd love to visualize the graph. I see it can be done in Elixir. But I don't know Elixir. Has anyone programmed a way to visualize digraphs in Erlang?
>>>
>>> Comment: Digraph is crying out for a comprehensive tutorial. I'd love to do it, but just don't know enough yet.
>>
>
> --
> Hugo Mills             | Great oxymorons of the world, no. 3:
> hugo@... carfax.org.uk | Military Intelligence
> http://carfax.org.uk/  |
> PGP: E2AB1DE4          |

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: digraph questions

John Krukoff-2
In reply to this post by Lloyd R. Prentice-2
➢ Question 3: I'd love to visualize the graph. I see it can be done in Elixir. But I don't know Elixir. Has anyone programmed a way to visualize digraphs in Erlang?

I had the same problem, here was my solution: https://github.com/jkrukoff/digraph_export

If you’re working with non-trivial data sets, you’d likely need to invest some time in how the filtering and display options work in your viewer of choice if you’d like to make use my library.

--
John Krukoff
[hidden email]



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

smime.p7s (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: digraph questions

Lloyd R. Prentice-2

Way cool, John!

 

Thanks. I'll play.

 

Best,

 

Lloyd

 

 

-----Original Message-----
From: "John Krukoff" <[hidden email]>
Sent: Tuesday, April 9, 2019 11:35am
To: "[hidden email]" <[hidden email]>, "[hidden email]" <[hidden email]>
Subject: RE: [erlang-questions] digraph questions

➢ Question 3: I'd love to visualize the graph. I see it can be done in Elixir. But I don't know Elixir. Has anyone programmed a way to visualize digraphs in Erlang?

I had the same problem, here was my solution: https://github.com/jkrukoff/digraph_export

If you’re working with non-trivial data sets, you’d likely need to invest some time in how the filtering and display options work in your viewer of choice if you’d like to make use my library.

--
John Krukoff
[hidden email]



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: digraph questions

Richard O'Keefe
In reply to this post by Hugo Mills-2
I appreciate that these graphs get dense.
That is precisely why I mentioned Gephi and UbiGraph: three dimensional layout.
Ubigraph in particular is good at making dynamic 3D layouts;
if anyone knows a more actively maintained equivalent I would love to hear of it.

There's a fair bit of work going on in systems biology.
The C. elegans connectome (wormwiring.org), for example,
has many thousands of edges.  So visualising rather large
networks is a hot topic.


On Tue, 9 Apr 2019 at 20:52, Hugo Mills <[hidden email]> wrote:
On Tue, Apr 09, 2019 at 12:46:21PM +1200, Richard O'Keefe wrote:
> The obvious way to visualise a graph would be to drive
> something like GraphViz or Gephi or, ideally, UbiGraph
> (https://github.com/alan86alves/ubigraph_server has a
> copy of the Linux x86-64 version; the official source
> is currently unreachable).  There is an erlubi. But
> perhaps the thing you might want to look at first is
> https://github.com/aol/erlgraph
> It will take a bit of patching to get up to date with
> current versions of Erlang and Cowboy.

   These kinds of graphs get *very* dense, and it's almost impossible
to draw the whole graph in any meaningful sense. You can't just throw
the graph at a graph drawing package and expect to get usable output.

   You really need to spend the time on working out what it is you
want to show, whether it's "everything directly relating to this one
character", or "the sequence of events in this scene", or "who was
with who over the course of the story", and then strip out everything
else to show the graph. You're going to be spending much more of your
time thinking about *what* to show than how to show it, in my
experience.

   Hugo.

> On Tue, 9 Apr 2019 at 11:29, <[hidden email]> wrote:
>
> > The Erlang digraph library looks like it may provide an interesting way to
> > diagram scenes in a novel.
> >
> >
> >
> > 1> Scene10 = digraph:new().
> >
> >
> >
> > Imagine:
> >
> >
> >
> > Setting:"park"
> >
> > Character1:"Franco"
> >
> > Character2:"Sophia"
> >
> >
> >
> > 2> digraph:add_vertex(Scene10, "Park", "Night").
> >
> > 3> digraph:add_vertex(Scene10, "Franco", "Old and fat").
> >
> > 4> digraph:add_vertex(Scene10, "Sophia", "Young and beautiful").
> >
> > 5> digraph:add_edge(Scene10, "Franco", "Sophia", "loves").
> >
> >
> >
> > OK to here EXCEPT command 5 returns:
> >
> >
> >
> > ['$e'|0]
> >
> >
> >
> > 6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").
> >
> >
> >
> > OK to here EXCEPT command 5 returns:
> >
> >
> >
> > ['$e'|0]
> >
> >
> >
> > 6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").
> >
> > ['$e'|1]
> >
> >
> >
> > Wah!
> >
> >
> >
> > Question 1: How do I see labels?
> >
> >
> >
> > Question 2: Be cool to add a sequence of actions. I can probably figure
> > this out, but is there an elegant solution?
> >
> >
> >
> > Question 3: I'd love to visualize the graph. I see it can be done in
> > Elixir. But I don't know Elixir. Has anyone programmed a way to visualize
> > digraphs in Erlang?
> >
> >
> >
> > Comment: Digraph is crying out for a comprehensive tutorial. I'd love to
> > do it, but just don't know enough yet.
> >
> >
> >
> > Many thanks,
> >
> >
> >
> > LRP
> >
> >
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > erlang-questions mailing list
> > [hidden email]
> > http://erlang.org/mailman/listinfo/erlang-questions
> >

> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions


--
Hugo Mills             | Books are superior to radio: the soundtrack is
hugo@... carfax.org.uk | better
http://carfax.org.uk/  |
PGP: E2AB1DE4          |

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: digraph questions

Lloyd R. Prentice-2
Hi Richard,

I’ve found a few interesting JavaScript libraries for visualizing graphs, vis.js among others. I don’t know if they’re sufficient to deal with highly dense graphs or if they provide 3D rendering. Vis.js also has nice features for rendering time lines. 

Vis.js looks sufficiently feature rich for my purposes. So I’m looking into creating a set if custom Nitrogen elements based on vis.js. I’m both skill-set and time constrained so it will be awhile before I can show results. Ideally, I’d like to see a Nitrogen plug-in that’s highly interactive. But I’ve got to polish off erlPress first and much else to do.

Best wishes,

Lloyd

Sent from my iPad

On Apr 9, 2019, at 8:05 PM, Richard O'Keefe <[hidden email]> wrote:

I appreciate that these graphs get dense.
That is precisely why I mentioned Gephi and UbiGraph: three dimensional layout.
Ubigraph in particular is good at making dynamic 3D layouts;
if anyone knows a more actively maintained equivalent I would love to hear of it.

There's a fair bit of work going on in systems biology.
The C. elegans connectome (wormwiring.org), for example,
has many thousands of edges.  So visualising rather large
networks is a hot topic.


On Tue, 9 Apr 2019 at 20:52, Hugo Mills <[hidden email]> wrote:
On Tue, Apr 09, 2019 at 12:46:21PM +1200, Richard O'Keefe wrote:
> The obvious way to visualise a graph would be to drive
> something like GraphViz or Gephi or, ideally, UbiGraph
> (https://github.com/alan86alves/ubigraph_server has a
> copy of the Linux x86-64 version; the official source
> is currently unreachable).  There is an erlubi. But
> perhaps the thing you might want to look at first is
> https://github.com/aol/erlgraph
> It will take a bit of patching to get up to date with
> current versions of Erlang and Cowboy.

   These kinds of graphs get *very* dense, and it's almost impossible
to draw the whole graph in any meaningful sense. You can't just throw
the graph at a graph drawing package and expect to get usable output.

   You really need to spend the time on working out what it is you
want to show, whether it's "everything directly relating to this one
character", or "the sequence of events in this scene", or "who was
with who over the course of the story", and then strip out everything
else to show the graph. You're going to be spending much more of your
time thinking about *what* to show than how to show it, in my
experience.

   Hugo.

> On Tue, 9 Apr 2019 at 11:29, <[hidden email]> wrote:
>
> > The Erlang digraph library looks like it may provide an interesting way to
> > diagram scenes in a novel.
> >
> >
> >
> > 1> Scene10 = digraph:new().
> >
> >
> >
> > Imagine:
> >
> >
> >
> > Setting:"park"
> >
> > Character1:"Franco"
> >
> > Character2:"Sophia"
> >
> >
> >
> > 2> digraph:add_vertex(Scene10, "Park", "Night").
> >
> > 3> digraph:add_vertex(Scene10, "Franco", "Old and fat").
> >
> > 4> digraph:add_vertex(Scene10, "Sophia", "Young and beautiful").
> >
> > 5> digraph:add_edge(Scene10, "Franco", "Sophia", "loves").
> >
> >
> >
> > OK to here EXCEPT command 5 returns:
> >
> >
> >
> > ['$e'|0]
> >
> >
> >
> > 6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").
> >
> >
> >
> > OK to here EXCEPT command 5 returns:
> >
> >
> >
> > ['$e'|0]
> >
> >
> >
> > 6> digraph:add_edge(Scene10, "Sophia", "Franco", "hates").
> >
> > ['$e'|1]
> >
> >
> >
> > Wah!
> >
> >
> >
> > Question 1: How do I see labels?
> >
> >
> >
> > Question 2: Be cool to add a sequence of actions. I can probably figure
> > this out, but is there an elegant solution?
> >
> >
> >
> > Question 3: I'd love to visualize the graph. I see it can be done in
> > Elixir. But I don't know Elixir. Has anyone programmed a way to visualize
> > digraphs in Erlang?
> >
> >
> >
> > Comment: Digraph is crying out for a comprehensive tutorial. I'd love to
> > do it, but just don't know enough yet.
> >
> >
> >
> > Many thanks,
> >
> >
> >
> > LRP
> >
> >
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > erlang-questions mailing list
> > [hidden email]
> > http://erlang.org/mailman/listinfo/erlang-questions
> >

> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions


--
Hugo Mills             | Books are superior to radio: the soundtrack is
hugo@... carfax.org.uk | better
http://carfax.org.uk/  |
PGP: E2AB1DE4          |

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions