How can I create a node in Memgraph using Cypher that has more than one label? - memgraphdb

I know that I can create a node with a label using the code:
CREATE (n:Person)
RETURN n;
But how can I add multiple labels at the time of creating?

If you wish to add multiple labels to a node when creating it do the following:
CREATE (n:Person:Department)
RETURN n;

Related

Custom function for aggregates in slickgrid

Is it possible that we can aggregate based on a custom function in slick grid?
For example, we have 3 columns A,B,C, the aggregate for C is calculated as follows
sum(abs(A)*C)/sum(abs(A))
Yes, you an definitely do that. The easiest way is to create a new aggregator object.
Check out: http://6pac.github.io/SlickGrid/examples/example-grouping.html
Copy an existing aggregator in Slick.DataView.js and mod it.

FileNet P8 ACCE Sweep job filter

I'm trying to setup a sweep job that moves a document from one class to a different class, but I only want to test right now -- not move ALL documents.
I was trying to add a filter to only pull over certain documents to test this before I pull the trigger, but it isn't working (ALL documents get listed in the results when I run this as preview).
The current filter I have is:
[DocumentTitle] like '%Z*%'
Any ideas what I need to do to change the filter to only have this run on the subset of documents I want??
Please clarify on below queries to resolve your issue:
1) Is your sweep job based on Java API / .net API? or
2) Is it based on FEM (Enterprise manager) tool
From the Filter : [DocumentTitle] like "%Z%" will filter all documents with the title %Z%, Please try to filter with ID to fetch one record, Once successful, then test with multiple records.
Thanks,
Habi
The sweep jobs typically take a condition that is similar to part after WHERE condition in search, the easiest way hence is simply to go to the search view, create your search, move to the SQL view tab, and then take whatever after WHERE condition and then add it to your sweep search filter.
Here are examples of filter conditions:
VersionStatus = 4 //All superseded documents
DateCreated < NOW() - TimeSpan(365, 'Days') //All documents that were created at least a year ago
StorageArea = OBJECT('{5E2BE09A-F4B1-49E2-A229-77FE32E5FEF1}') //All content in a specific storage area
VersionStatus = 4 AND DateCreated < NOW() - TimeSpan(365, 'Days') AND ContentSize > (1024 * 1024 * 500) //Complex logical expression
Final point in regard to your question about
I only want to test right now -- not move ALL documents.
Sweeps has Sweep Mode which defines how the sweep is going to execute, in your case you need to set it to Preview.

Xpath to extract data from a table using contains

Following 2 xpaths below work fine to extract data from a table.
//*[#id="codeRow"]/td/strong[contains(text(),"Besnier")]
//*[#id="codeRow"]/td[contains(text(),"Besnier")]
I want to combine these 2 and create 1 XPATH statement that can be used as needed.
I tried using or but it did not work
ForEx:
//*[#id="codeRow"]/td[contains(descendant::*/text() , "Besnier" )]
or [contains(text(),"Besnier")]
Please advise
Try this xpath:
//*[#id="codeRow"]/td[contains(., "Besnier")]
XPath engine will convert .(current node) to string, then call function contains().
The current node and all child nodes are searched for a text node fragment "Besnier", there is no need to use an axis to select all descendants and their text nodes.

propel nested set behavior

I woudl like to build an oriented Graph using propel. The behavior I am looking for is similar to the nested set but with multiple parents for one child.
What exists:
P: Parent Node
C: Child Node
(0,1)P <- (0,n)C
What I need:
(0,n)P <- (0,n)C
I have read this:
http://propelorm.org/behaviors/nested-set.html
and that: https://github.com/CraftyShadow/EqualNestBehavior
Could you give me some direction please?
I found a solution, I am using a ManyToMany relationship with the same table on the two relations links.
table Node
Table ParentNode (ParentFK: Node, NodeFK: Node)

What is the best way to add and order to Doctrine Nested Set Trees?

What is the best way to add a sense of order in Doctrine Nested Sets?
The documention contains several examples of how to get al the childeren of a specific node
$category->getNode()->getSiblings()
But how can I for example:
change the position of the fourth sibling to the second position
get only the second sibling
add a sibling between the second and third child
etc...
Do I have to manually add and ordercolumn to the model to do these operations?
To get the second previous sibling:
$anotherCategory = $category->getNode()->getPrevSibling()->getNode()->getPrevSibling();
To insert category in its place:
$category->getNode()->moveAsPrevSiblingOf($anotherCategory);
To add a new sibling between second and third child, you'd simply use insertAsNextSiblingOf instead of moveAsPrevSiblingOf.

Resources