nodes

Colour specific node in igraph

感情迁移 提交于 2019-12-11 04:39:01
问题 I am trying to colour node 6 and 7 regardless of whatever letter is selected from object 'd'. g <- graph_from_literal(1:2:3:4:5 -- 6:7) # Rename (sum up all the vertices) d <- c("a", "b", "c", "d", "e", "f", "g","h", "i", "j") V(g)$name <- sample(d, 7, replace=TRUE) colours <- c("red") V(g)$color <- ifelse(V(g)$name == c('a','e'), "white", colours) plot.igraph(g, layout=layout_with_dh, vertex.label=V(g)$name, vertex.size=35, vertex.color=V(g)$color, #colors.r vertex.label.cex=0.7, ) I tried

Delete old nodes and relationships with Cypher in Neo4j 1.9

二次信任 提交于 2019-12-11 04:18:10
问题 I am using Neo4j 1.9 M03 in HA mode, my challenge is to remove all nodes and relationships as well as indices that are older than a certain date. For this I created a property for nodes and relationships. The property is a datestamp in the "YYMMDD" format. I'm trying to use the following Cypher query to perform the operation mentioned above: START n0=node(0), nx=node(*) MATCH n0-[r0?]-(), nx-[rx?]-() WHERE nx <> n0 AND HAS (nx.datestamp) AND nx.datestamp <= yyyymmdd OR HAS (rx.datestamp) AND

linked list sublist method-java

橙三吉。 提交于 2019-12-11 03:24:36
问题 I am attempting to write a subList method, which returns a list consisting of the current object list inclusively between indexes fromIndex and toIndex . For example, if I had list consisting of 3 5 7 9 11 20 23 and I called subList(0,3) , I should get a new list of 3 5 7 9 returned. I am using helper methods to assist in writing the method. My logic in writing this method is that I assign the head node to to be the node at index fromIndex while assigning the last node in the list to the node

javascript XSLT nodes, selecting the first of a group (merge-like)

大兔子大兔子 提交于 2019-12-11 03:13:16
问题 after reading some of the merge posts out here, my question appears to be simpler and I am not capable to find out the answer. So I post a new question. The original xml <data> <proteins> <protein> <accession>111</accession> </protein> </proteins> <peptides> <peptide> <accession>111</accession> <sequence>AAA</sequence> </peptide> <peptide> <accession>111</accession> <sequence>AAA</sequence> </peptide> <peptide> <accession>111</accession> <sequence>AAA</sequence> </peptide> <peptide>

Populate Attribute and values to all parent nodes of the XML file from 4th parent node

拈花ヽ惹草 提交于 2019-12-11 02:35:30
问题 I am new to XSLT and would like to add Attribute and Value of the same to all parent nodes starting from 2nd parent node. here the logic should be the if there is Main node, the attribute(Mainattribute) should be one time and for rest of all parent nodes under the Main node should have different attribute(childattribute) which should be same across all other than Main node. we have a input xml like below : It is just have some fields only, ideally there will be more tags and may differ. <?xml

Neo4j: Sum relationship properties where node properties equal Value A and Value B (intersection)

断了今生、忘了曾经 提交于 2019-12-11 01:38:23
问题 Basically my question is: how do I sum relationship properties where there is a related nodes that have properties equal to Value A and Value B? For example: I have a simple DB has the following relationship: (site)-[:HAS_MEMBER]->(user)-[:POSTED]->(status)-[:TAGGED_WITH]->(tag) On [:TAGGED_WITH] I have a property called "TimeSpent". I can easily SUM up all the time spent for a particular day and user by using the following query: MATCH (user)-[:POSTED]->(updates)-[r:TAGGED_WITH]->(tags)

Groovy XmlSlurper get value of the node without children

倾然丶 夕夏残阳落幕 提交于 2019-12-11 01:38:22
问题 I'm parsing HTML and trying to value of a parent node itself, without values of the children nodes. HTML example: <html> <body> <div> <a href="http://intro.com">extra stuff</a> Text I would like to get. <a href="http://example.com">link to example</a> </div> </body> </html> Code: def tagsoupParser = new org.ccil.cowan.tagsoup.Parser() def slurper = new XmlSlurper(tagsoupParser) def htmlParsed = slurper.parseText(stringToParse) println htmlParsed.body.div[0] However above code returns: extra

XSLT Group/merge childs (using key)

删除回忆录丶 提交于 2019-12-11 00:55:27
问题 I am trying to understand how to deduce a solution using a code I already wrote. In order to simplify I will explain first what I want to do and what I got so far. Suppose I have an XML variable in XSLT containing few nodes with the same title attribute. Using @Dimitre Novatchev solution I have managed to combine them into one node. So If I had : <t> <GroupData ID="xxx" Key="4" Temp="yyy"> <ItemData ID="zzz" Value="3"/> </GroupData> <GroupData ID="yyy" Key="4" Temp="yyy"> <ItemData ID="abc"

CytoscapeJS - show node neighborhood?

[亡魂溺海] 提交于 2019-12-10 20:59:11
问题 I have a dataset in JSON format containing information about nodes and edges which I am using to generate a network graph in cytoscapeJS. The JSON data contains id, value, shape, colour and visibleDisplay ('element' or 'none') attributes for nodes and id, source, target and label for edges . My stylesheet uses this 'visibleDisplay' property to show/ hide nodes, as needed, when the cy container is first initialised. I want to allow users to unhide nodes with an option to "Show neighbourhood" .

php simple xml how to read multiple nodes with different child node levels

南楼画角 提交于 2019-12-10 20:49:04
问题 I have an xml file that has different named nodes and multi level child nodes (that are different between each node.) How should I access the data? Will it require many nested for loops? Here is a sample of the xml code: <start_info> <info tabindex="1"> <infonumber>1</infonumber> <trees>green</trees> </info> </start_info> <people> <pe> <people_ages> <range number="1"> <age value="1">1</age> <age value="2">2</age> </range> </people_ages> </pe> </people> Here is my code so far: $xml = simplexml