本文整理了Java中org.neo4j.graphdb.Relationship.getPropertyKeys
方法的一些代码示例,展示了Relationship.getPropertyKeys
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Relationship.getPropertyKeys
方法的具体详情如下:
包路径:org.neo4j.graphdb.Relationship
类名称:Relationship
方法名:getPropertyKeys
暂无
代码示例来源:origin: neo4j/neo4j
@Test
public void shouldStoreSuppliedPropertiesWhenCreatingRelationship() throws Exception
{
Map<String, Object> properties = new HashMap<>();
properties.put( "string", "value" );
properties.put( "integer", 17 );
long relId = actions.createRelationship( graphdbHelper.createNode(), graphdbHelper.createNode(), "LOVES",
properties )
.getId();
try ( Transaction tx = database.getGraph().beginTx() )
{
Relationship rel = database.getGraph().getRelationshipById( relId );
for ( String key : rel.getPropertyKeys() )
{
assertTrue( "extra property stored", properties.containsKey( key ) );
}
for ( Map.Entry<String, Object> entry : properties.entrySet() )
{
assertEquals( entry.getValue(), rel.getProperty( entry.getKey() ) );
}
}
}
代码示例来源:origin: neo4j-contrib/neo4j-apoc-procedures
public void add(Relationship relationship) {
for (String key : relationship.getPropertyKeys()) properties.add(key);
count++;
}
}
代码示例来源:origin: neo4j-contrib/neo4j-apoc-procedures
private void appendRelationship(PrintWriter out, Relationship rel, Reporter reporter) {
String cypher = this.cypherFormat.statementForRelationship(rel, uniqueConstraints, indexedProperties);
if (cypher != null && !"".equals(cypher)) {
out.println(cypher);
reporter.update(0, 1, Iterables.count(rel.getPropertyKeys()));
}
}
代码示例来源:origin: neo4j-contrib/neo4j-apoc-procedures
@Override
public String statementForRelationship(Relationship relationship, Map<String, String> uniqueConstraints, Set<String> indexedProperties) {
StringBuilder result = new StringBuilder(100);
result.append("MATCH ");
result.append(CypherFormatterUtils.formatNodeLookup("n1", relationship.getStartNode(), uniqueConstraints, indexedProperties));
result.append(", ");
result.append(CypherFormatterUtils.formatNodeLookup("n2", relationship.getEndNode(), uniqueConstraints, indexedProperties));
result.append(" CREATE (n1)-[r:" + CypherFormatterUtils.quote(relationship.getType().name()));
if (relationship.getPropertyKeys().iterator().hasNext()) {
result.append(" {");
result.append(CypherFormatterUtils.formatRelationshipProperties("", relationship, true));
result.append("}");
}
result.append("]->(n2);");
return result.toString();
}
}
代码示例来源:origin: neo4j-contrib/neo4j-apoc-procedures
public String mergeStatementForRelationship(CypherFormat cypherFormat, Relationship relationship, Map<String, String> uniqueConstraints, Set<String> indexedProperties) {
StringBuilder result = new StringBuilder(1000);
result.append("MATCH ");
result.append(CypherFormatterUtils.formatNodeLookup("n1", relationship.getStartNode(), uniqueConstraints, indexedProperties));
result.append(", ");
result.append(CypherFormatterUtils.formatNodeLookup("n2", relationship.getEndNode(), uniqueConstraints, indexedProperties));
result.append(" MERGE (n1)-[r:" + CypherFormatterUtils.quote(relationship.getType().name()) + "]->(n2)");
if (relationship.getPropertyKeys().iterator().hasNext()) {
result.append(cypherFormat.equals(CypherFormat.UPDATE_STRUCTURE) ? " ON CREATE SET " : " SET ");
result.append(CypherFormatterUtils.formatRelationshipProperties("r", relationship, false));
}
result.append(";");
return result.toString();
}
}
代码示例来源:origin: neo4j-contrib/graph-collections
@Override
public Iterable<String> getPropertyKeys()
{
return keyValueRelationship.getPropertyKeys();
}
代码示例来源:origin: org.neo4j/neo4j-graph-collections
@Override
public Iterable<String> getPropertyKeys()
{
return keyValueRelationship.getPropertyKeys();
}
代码示例来源:origin: org.neo4j/neo4j-shell
@Override
public Iterable<String> getPropertyKeys()
{
return actual.getPropertyKeys();
}
代码示例来源:origin: org.neo4j/neo4j-shell
@Override
public Iterable<String> getPropertyKeys()
{
return object().getPropertyKeys();
}
代码示例来源:origin: com.lordofthejars/nosqlunit-neo4j
private Map<String, String> findRelationshipKeys(Iterable<Relationship> relationships) {
Map<String, String> edgeKeyTypes = new HashMap<String, String>();
for (Relationship relationship : relationships) {
Iterable<String> keys = relationship.getPropertyKeys();
for (String key : keys) {
if (!edgeKeyTypes.containsKey(key)) {
edgeKeyTypes.put(key, getStringType(relationship.getProperty(key)));
}
}
}
return edgeKeyTypes;
}
代码示例来源:origin: lordofthejars/nosql-unit
private Map<String, String> findRelationshipKeys(Iterable<Relationship> relationships) {
Map<String, String> edgeKeyTypes = new HashMap<String, String>();
for (Relationship relationship : relationships) {
Iterable<String> keys = relationship.getPropertyKeys();
for (String key : keys) {
if (!edgeKeyTypes.containsKey(key)) {
edgeKeyTypes.put(key, getStringType(relationship.getProperty(key)));
}
}
}
return edgeKeyTypes;
}
代码示例来源:origin: neo4j-contrib/graph-collections
TempRelationship(Relationship rel){
endNode = rel.getEndNode();
props = new HashMap<String, Object>();
for(String key: rel.getPropertyKeys()){
props.put(key, rel.getProperty(key));
}
}
代码示例来源:origin: org.neo4j/neo4j-graph-collections
TempRelationship(Relationship rel){
endNode = rel.getEndNode();
props = new HashMap<String, Object>();
for(String key: rel.getPropertyKeys()){
props.put(key, rel.getProperty(key));
}
}
代码示例来源:origin: org.commonjava.maven.atlas/atlas-driver-neo4j-embedded
public static void cloneRelationshipProperties( final Relationship from, final Relationship to )
{
final Iterable<String> keys = from.getPropertyKeys();
for ( final String key : keys )
{
to.setProperty( key, from.getProperty( key ) );
}
}
代码示例来源:origin: SciGraph/SciGraph
private void relationshipGeneration(JsonGenerator generator, Relationship relationship)
throws IOException {
generator.writeStartObject();
generator.writeStringField("type", relationship.getType().name());
for (String k : relationship.getPropertyKeys()) {
resultSerializer(generator, k, relationship.getProperty(k));
}
generator.writeEndObject();
}
}
代码示例来源:origin: maxdemarzi/graph_processing
@GET
@Path("/warmup")
public String warmUp(@Context GraphDatabaseService db) {
try ( Transaction tx = db.beginTx()) {
for ( Node n : db.getAllNodes()) {
n.getPropertyKeys();
for ( Relationship relationship : n.getRelationships()) {
relationship.getPropertyKeys();
relationship.getStartNode();
}
}
}
return "Warmed up and ready to go!";
}
代码示例来源:origin: com.graphaware/neo4j-tx-event-api
/**
* Inform this object about a relationship that has been created.
*
* @param relationship that has been created.
*/
public void relationshipCreated(Relationship relationship) {
if (commitInProgress) {
return;
}
createdRelationships.add(relationship);
for (String key : relationship.getPropertyKeys()) {
assignedRelationshipProperties.put(new IdAndKey(relationship.getId(), key),
PropertyEntryImpl.assigned(relationship, key, relationship.getProperty(key), null));
}
incrementMutationsAndCommitIfNeeded();
}
代码示例来源:origin: SciGraph/SciGraph
Relationship mockRealtionship(Node start, Node end) {
Relationship r = mock(Relationship.class);
when(r.getPropertyKeys()).thenReturn(Collections.<String>emptySet());
when(r.getType()).thenReturn(RelationshipType.withName("FOO"));
when(r.getStartNode()).thenReturn(start);
when(r.getEndNode()).thenReturn(end);
return r;
}
代码示例来源:origin: org.neo4j/neo4j-graph-collections
private void moveValueRelationship( Relationship valueRelationship, Node targetPage )
{
Relationship newRelationship = targetPage.createRelationshipTo(
valueRelationship.getEndNode(), GraphCollection.RelationshipTypes.VALUE );
for ( String key : valueRelationship.getPropertyKeys() )
{
newRelationship.setProperty( key, valueRelationship.getProperty( key ) );
}
valueRelationship.delete();
}
代码示例来源:origin: neo4j-contrib/graph-collections
private void moveValueRelationship( Relationship valueRelationship, Node targetPage )
{
Relationship newRelationship = targetPage.createRelationshipTo(
valueRelationship.getEndNode(), GraphCollection.RelationshipTypes.VALUE );
for ( String key : valueRelationship.getPropertyKeys() )
{
newRelationship.setProperty( key, valueRelationship.getProperty( key ) );
}
valueRelationship.delete();
}
内容来源于网络,如有侵权,请联系作者删除!