[Summit] XEP dependency graph

Yusuke DOI yusuke.doi at toshiba.co.jp
Mon Jul 29 09:05:48 UTC 2013


Dear Steffen,

The script just reads <dependencies> so I've added nothing to existing
XEPs. The attached script can make dependency graph if executed on
extensions dir of xmpp repository. (you'll need to install lxml)

The output should be processed by graphviz or compatible softwares.

Regards,

Yusuke



(2013/07/28 15:08), Steffen Larsen wrote:
> Hi Yusuke,
> 
> Great stuff!. Is the data from all of the XEPs? the script you wrote is that taking just any text containing XEP-xxx and putting as data?
> I would like to a see it if you have it in github or any other SCM. An updated to the XEP xcd would be great to contain dependencies, tags (for textual labels) and versioning.
> But lets get the data first and verify it.
> 
> -Cheers!
> 
> /Steffen
> 
> On Jul 27, 2013, at 10:20 PM, Yusuke DOI <yusuke.doi at toshiba.co.jp> wrote:
> 
>> Dear folks,
>>
>> There was discussion about 'tagging' XEPs today. It's important to add
>> tags somehow, but I think we don't have where to start for now. To
>> bootstrap the classification of XEPs, I've wrote a tiny script to
>> extract dependency and gave it to graphviz.
>>
>> https://docs.google.com/file/d/0BzmV2k-V-sECNktwX1U0a2hHQTA/edit?usp=sharing
>>
>> Because the file is too large (width: 32767px), you'd have better view
>> with downloading it. It has too many edges and almost impossible to
>> view, but I think you can find which XEP referenced much.
>>
>> Here's top 18 list of most referenced XEPs and other documents.:
>> (refcnt>=6)
>>
>>     256 XMPP Core
>>      67 XMPP IM
>>      67 XEP-0030
>>      27 XEP-0060
>>      22 XEP-0045
>>      22 XEP-0004
>>      21 XEP-0001
>>      19 XEP-0163
>>      18 XEP-0166
>>      13 XEP-0115
>>       9 XEP-0082
>>       9 XEP-0054
>>       8 XEP-0167
>>       8 XEP-0068
>>       6 XEP-0138
>>       6 XEP-0124
>>       6 XEP-0049
>>       6 XEP-0016
>>
>> An idea: Most referred document may have manually-configured tags
>> (keywords), and the keywords can propagated through dependency graph to
>> set 'default set of keywords' if the XEP has no manually-set tags.
>>
>> Hoping it helps.
>>
>> -- 
>> // Yusuke DOI <yusuke.doi at toshiba.co.jp>
>>
> 


-- 
// Yusuke DOI <yusuke.doi at toshiba.co.jp>
-------------- next part --------------
import os
import sys
import pdb
from lxml import etree

if __name__ == '__main__':
    parser = etree.XMLParser(resolve_entities=False)

    filenames = filter(lambda fn: fn.startswith('xep-'),  os.listdir('.'))

    print 'digraph G{'
    for filename in filenames:
        xepname = filename.replace('.xml', '').upper()
        xeptree = etree.ElementTree()
        xeptree.parse(filename, parser=parser)
        for dependency in xeptree.findall('/header/dependencies/spec'):
            print ' "%s"->"%s"'%(xepname, dependency.text)
    print '}'


More information about the Summit mailing list